File tree Expand file tree Collapse file tree 2 files changed +10
-6
lines changed
Expand file tree Collapse file tree 2 files changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -112,18 +112,22 @@ def computeQualityMeasures(lP: np.ndarray,
112112 fnr = fn / (fn + tp )
113113
114114
115-
116-
117- dicecomputer = sitk .LabelOverlapMeasuresImageFilter ()
118- dicecomputer .Execute (labelTrue > 0.5 , labelPred > 0.5 )
115+ v_pred = np .sum (labelPred > 0.5 )
116+ v_gdth = np .sum (labelTrue > 0.5 )
117+ if v_pred + v_gdth == 0 : # prediction results and ground truth are all 0
118+ vs = 0
119+ else :
120+ vs = 2 * (v_pred - v_gdth ) / (v_pred + v_gdth )
121+ # dicecomputer = sitk.LabelOverlapMeasuresImageFilter()
122+ # dicecomputer.Execute(labelPred > 0.5, labelTrue > 0.5)
119123
120124 quality ["dice" ] = dice
121125 quality ["jaccard" ] = jaccard
122126 quality ["precision" ] = precision
123127 quality ["recall" ] = recall
124128 quality ["fnr" ] = fnr
125129 quality ["fpr" ] = fpr
126- quality ["vs" ] = dicecomputer . GetVolumeSimilarity ()
130+ quality ["vs" ] = vs
127131
128132 quality ["TP" ] = tp
129133 quality ["TN" ] = tn
Original file line number Diff line number Diff line change 2424
2525setuptools .setup (
2626 name = "seg_metrics" , # Replace with your own username
27- version = "1.2.7 " ,
27+ version = "1.2.8 " ,
2828 author = "Jingnan Jia" ,
2929 author_email = "jiajingnan2222@gmail.com" ,
3030 description = "A package to compute different segmentation metrics for 2D/3D medical images." ,
You can’t perform that action at this time.
0 commit comments