How could I get the TP, FP, FN, TN?

(Butui Hu) #1

I’m trying to evaluate my segmentation result. I could use sitk.LabelOverlapMeasuresImageFilter to get dice, FPR, FNR. I wonder if there any filter for calculating confusion matrix so that I could calcalate every metric based on it?

(Ziv Yaniv) #2

Hello @hubutui,

TP,FP, FN, TN are not standard measures for evaluating segmentation so we don’t have a turnkey solution, you can compute them yourself using logical operators between images. The common measures are overlap (Dice, Jaccard) and surface distances (Hausdorff, mean surface etc.). This Jupyter notebook illustrates these common segmentation evaluation measures.

Hopefully these will work for you.

(Butui Hu) #3

Thank you. As this paper says, overlap metrics are calculated from TP, FP, TN, FN. It would help the user to calculate other metrics based on these.
Also, sklearn.metrics is also a good choice.