Skip to content

Commit

Permalink
Merge pull request #717 from FelixSteinbauer/FelixSteinbauer-patch-1-2
Browse files Browse the repository at this point in the history
Added parameter to toggle NCC computation
  • Loading branch information
sarthakpati authored Aug 28, 2023
2 parents 32fd05c + bc0d3fa commit 72eb99f
Showing 1 changed file with 14 additions and 12 deletions.
26 changes: 14 additions & 12 deletions GANDLF/cli/generate_metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -253,18 +253,20 @@ def __percentile_clip(input_tensor, reference_tensor=None, p_min=0.5, p_max=99.5
] = structural_similarity_index(gt_image_infill, output_infill, mask).item()

# ncc metrics
overall_stats_dict[current_subject_id]["ncc_mean"] = ncc_mean(
gt_image_infill, output_infill
)
overall_stats_dict[current_subject_id]["ncc_std"] = ncc_std(
gt_image_infill, output_infill
)
overall_stats_dict[current_subject_id]["ncc_max"] = ncc_max(
gt_image_infill, output_infill
)
overall_stats_dict[current_subject_id]["ncc_min"] = ncc_min(
gt_image_infill, output_infill
)
compute_ncc = parameters.get("compute_ncc", True)
if compute_ncc:
overall_stats_dict[current_subject_id]["ncc_mean"] = ncc_mean(
gt_image_infill, output_infill
)
overall_stats_dict[current_subject_id]["ncc_std"] = ncc_std(
gt_image_infill, output_infill
)
overall_stats_dict[current_subject_id]["ncc_max"] = ncc_max(
gt_image_infill, output_infill
)
overall_stats_dict[current_subject_id]["ncc_min"] = ncc_min(
gt_image_infill, output_infill
)

# only voxels that are to be inferred (-> flat array)
# these are required for mse, psnr, etc.
Expand Down

0 comments on commit 72eb99f

Please sign in to comment.