@@ -107,20 +107,35 @@ def find_thresholds(cochlea_annotations, cochlea, data_seg, table_measurement):
107107 # loop over all annotated blocks
108108 for annotated_center in annotated_centers :
109109 intensities = []
110+ annotator_success = []
111+ annotator_failure = []
112+ annotator_missing = []
110113 # loop over annotated block from single user
111114 for annotator_key in annotation_dics .keys ():
112115 if annotated_center not in annotation_dics [annotator_key ]["center_strings" ]:
116+ annotator_missing .append (os .path .basename (annotator_key ))
113117 continue
114118 else :
115119 median_intensity = annotation_dics [annotator_key ][annotated_center ]["median_intensity" ]
116120 if median_intensity is None :
117121 print (f"No threshold for { os .path .basename (annotator_key )} and crop { annotated_center } ." )
122+ annotator_failure .append (os .path .basename (annotator_key ))
118123 else :
119124 intensities .append (median_intensity )
125+ annotator_success .append (os .path .basename (annotator_key ))
126+
120127 if len (intensities ) == 0 :
121128 print (f"No viable annotation for cochlea { cochlea } and crop { annotated_center } ." )
129+ median_int_avg = None
122130 else :
123- intensity_dic [annotated_center ] = {"median_intensity" : float (sum (intensities ) / len (intensities ))}
131+ median_int_avg = float (sum (intensities ) / len (intensities )),
132+
133+ intensity_dic [annotated_center ] = {
134+ "median_intensity" : median_int_avg ,
135+ "annotation_success" : annotator_success ,
136+ "annotation_failure" : annotator_failure ,
137+ "annotation_missing" : annotator_missing ,
138+ }
124139
125140 return intensity_dic
126141
0 commit comments