Skip to content

Commit

Permalink
add defaults to ref_map and pred_map
Browse files Browse the repository at this point in the history
  • Loading branch information
NathanMolinier committed Nov 28, 2024
1 parent cd8d9d4 commit bbc3a00
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions compute_metrics_reloaded.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ def get_images_in_folder(prediction, reference):
return prediction_files, reference_files


def compute_metrics_single_subject(prediction, reference, metrics, ref_map, pred_map):
def compute_metrics_single_subject(prediction, reference, metrics, ref_map=None, pred_map=None):
"""
Compute MetricsReloaded metrics for a single subject
:param prediction: path to the nifti image with the prediction
Expand Down Expand Up @@ -232,7 +232,7 @@ def build_output_dataframe(output_list):
return df


def process_subject(prediction_file, reference_file, metrics, ref_map, pred_map):
def process_subject(prediction_file, reference_file, metrics, ref_map=None, pred_map=None):
"""
Wrapper function to process a single subject.
"""
Expand Down Expand Up @@ -288,7 +288,7 @@ def main():
# Collect the results
output_list.extend(results)
else:
metrics_dict = compute_metrics_single_subject(args.prediction, args.reference, args.metrics, args.ref_map, args.pred_map)
metrics_dict = compute_metrics_single_subject(args.prediction, args.reference, args.metrics, ref_map, pred_map)
# Append the output dictionary (representing a single reference-prediction pair per subject) to the output_list
output_list.append(metrics_dict)

Expand Down

0 comments on commit bbc3a00

Please sign in to comment.