@@ -212,8 +212,10 @@ def get_binary_evaluation_score(s_volume, g_volume, spacing, metric):
212212 score = binary_iou (s_volume ,g_volume )
213213 elif (metric_lower == 'assd' ):
214214 score = binary_assd (s_volume , g_volume , spacing )
215+ score = min (score , 20 ) # to reject outliers
215216 elif (metric_lower == "hd95" ):
216217 score = binary_hd95 (s_volume , g_volume , spacing )
218+ score = min (score , 50 ) # to reject outliers
217219 elif (metric_lower == "rve" ):
218220 score = binary_relative_volume_error (s_volume , g_volume )
219221 elif (metric_lower == "volume" ):
@@ -269,8 +271,8 @@ def evaluation(config):
269271 :param label_fuse: (option, bool) If true, fuse the labels in the `label_list`
270272 as the foreground, and other labels as the background. Default is False.
271273 :param organ_name: (str) The name of the organ for segmentation.
272- :param ground_truth_folder_root : (str) The root dir of ground truth images.
273- :param segmentation_folder_root : (str or list) The root dir of segmentation images.
274+ :param ground_truth_folder : (str) The root dir of ground truth images.
275+ :param segmentation_folder : (str or list) The root dir of segmentation images.
274276 When a list is given, each list element should be the root dir of the results of one method.
275277 :param evaluation_image_pair: (str) The csv file that provide the segmentation
276278 images and the corresponding ground truth images.
@@ -366,23 +368,23 @@ def main():
366368
367369 """
368370 parser = argparse .ArgumentParser ()
369- parser .add_argument ("-cfg" , help = "configuration file for evaluation" ,
371+ parser .add_argument ("-- cfg" , help = "configuration file for evaluation" ,
370372 required = False , default = None )
371- parser .add_argument ("-metric" , help = "evaluation metrics, e.g., dice, or [dice, assd]" ,
373+ parser .add_argument ("-- metric" , help = "evaluation metrics, e.g., dice, or [dice, assd]" ,
372374 required = False , default = None )
373- parser .add_argument ("-cls_num" , help = "number of classes" ,
375+ parser .add_argument ("-- cls_num" , help = "number of classes" ,
374376 required = False , default = None )
375- parser .add_argument ("-cls_index" , help = "The class index for evaluation, e.g., 255, [1, 2]" ,
377+ parser .add_argument ("-- cls_index" , help = "The class index for evaluation, e.g., 255, [1, 2]" ,
376378 required = False , default = None )
377- parser .add_argument ("-gt_dir" , help = "path of folder for ground truth" ,
379+ parser .add_argument ("-- gt_dir" , help = "path of folder for ground truth" ,
378380 required = False , default = None )
379- parser .add_argument ("-seg_dir" , help = "path of folder for segmentation" ,
381+ parser .add_argument ("-- seg_dir" , help = "path of folder for segmentation" ,
380382 required = False , default = None )
381- parser .add_argument ("-name_pair" , help = "the .csv file for name mapping in case"
383+ parser .add_argument ("-- name_pair" , help = "the .csv file for name mapping in case"
382384 " the names of one case are different in the gt_dir "
383385 " and seg_dir" ,
384386 required = False , default = None )
385- parser .add_argument ("-out" , help = "the output .csv file name" ,
387+ parser .add_argument ("-- out" , help = "the output .csv file name" ,
386388 required = False , default = None )
387389 args = parser .parse_args ()
388390 print (args )
@@ -402,5 +404,3 @@ def main():
402404
403405if __name__ == '__main__' :
404406 main ()
405-
406- main ()
0 commit comments