diff --git a/compute_metrics_reloaded.py b/compute_metrics_reloaded.py index 3037128..148a7bd 100644 --- a/compute_metrics_reloaded.py +++ b/compute_metrics_reloaded.py @@ -157,10 +157,10 @@ def compute_metrics_single_subject(prediction, reference, metrics): # append entry into the output_list to store the metrics for the current subject metrics_dict = {'reference': reference, 'prediction': prediction} - # NOTE: this is hacky fix to try to speed up metrics computation, tread very carefully - if len(unique_labels) == 2: - # compute metrics only for lesions - unique_labels = unique_labels[1:] + # # NOTE: this is hacky fix to try to speed up metrics computation, tread very carefully + # if len(unique_labels) == 2: + # # compute metrics only for lesions + # unique_labels = unique_labels[1:] # loop over all unique labels, e.g., voxels with values 1, 2, ... # by doing this, we can compute metrics for each label separately, e.g., separately for spinal cord and lesions @@ -260,11 +260,11 @@ def main(): # Convert JSON data to pandas DataFrame df = build_output_dataframe(output_list) - # create a separate dataframe for columns where EmptyRef and EmptyPred is True - df_empty_masks = df[(df['EmptyRef'] == True) & (df['EmptyPred'] == True)] + # # create a separate dataframe for columns where EmptyRef and EmptyPred is True + # df_empty_masks = df[(df['EmptyRef'] == True) & (df['EmptyPred'] == True)] - # keep only the rows where either pred or ref is non-empty or both are non-empty - df = df[(df['EmptyRef'] == False) | (df['EmptyPred'] == False)] + # # keep only the rows where either pred or ref is non-empty or both are non-empty + # df = df[(df['EmptyRef'] == False) | (df['EmptyPred'] == False)] # Compute mean and standard deviation of metrics across all subjects df_mean = (df.drop(columns=['reference', 'prediction', 'EmptyRef', 'EmptyPred']).groupby('label').