Skip to content

Commit

Permalink
Merge pull request #472 from frheault/new_connectivity_pairwise_metric
Browse files Browse the repository at this point in the history
Replace SSD with RMSE in connectivity comparison script
  • Loading branch information
arnaudbore authored Jul 8, 2021
2 parents c44e5c2 + bb56c8f commit f4ea3d3
Showing 1 changed file with 4 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@
import argparse
import itertools
import json
import logging
import os
import shutil

import numpy as np

Expand Down Expand Up @@ -71,7 +68,8 @@ def main():
else:
all_matrices.append(tmp_mat)

output_measures_dict = {'SSD': [], 'correlation': [], 'w_dice_voxels' : [], 'dice_voxels' : []}
output_measures_dict = {'RMSE': [], 'correlation': [],
'w_dice_voxels': [], 'dice_voxels': []}

if args.single_compare:
if args.single_compare in args.in_matrices:
Expand All @@ -82,8 +80,8 @@ def main():
pairs = list(itertools.combinations(all_matrices, r=2))

for i in pairs:
ssd = np.sum((i[0] - i[1]) ** 2)
output_measures_dict['SSD'].append(ssd)
rmse = np.sqrt(np.mean((i[0]-i[1])**2))
output_measures_dict['RMSE'].append(rmse)
corrcoef = np.corrcoef(i[0].ravel(), i[1].ravel())
output_measures_dict['correlation'].append(corrcoef[0][1])
dice, w_dice = compute_dice_voxel(i[0], i[1])
Expand Down

0 comments on commit f4ea3d3

Please sign in to comment.