Skip to content

Commit

Permalink
putting the ncc in the metric calculation itself for clarity
Browse files Browse the repository at this point in the history
  • Loading branch information
sarthakpati committed Dec 19, 2024
1 parent 08dc42a commit 8b9a797
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion GANDLF/cli/generate_metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,7 @@ def __percentile_clip(
if compute_ncc:
calculated_ncc_metrics = ncc_metrics(output_infill, gt_image_infill)
for key, value in calculated_ncc_metrics.items():
overall_stats_dict[current_subject_id][f"ncc_{key}"] = value.item()
overall_stats_dict[current_subject_id][key] = value.item()

# only voxels that are to be inferred (-> flat array)
# these are required for mse, psnr, etc.
Expand Down
10 changes: 5 additions & 5 deletions GANDLF/metrics/synthesis.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,9 +195,9 @@ def ncc_metrics(prediction: torch.Tensor, target: torch.Tensor) -> dict:
onesImage = corr_image == corr_image
stats_filter.Execute(corr_image, onesImage)
return {
"mean": stats_filter.GetMean(1),
"std": stats_filter.GetSigma(1),
"max": stats_filter.GetMaximum(1),
"min": stats_filter.GetMinimum(1),
"median": stats_filter.GetMedian(1),
"ncc_mean": stats_filter.GetMean(1),
"ncc_std": stats_filter.GetSigma(1),
"ncc_max": stats_filter.GetMaximum(1),
"ncc_min": stats_filter.GetMinimum(1),
"ncc_median": stats_filter.GetMedian(1),
}

0 comments on commit 8b9a797

Please sign in to comment.