Commit 12fe920b authored by sjromuel's avatar sjromuel
Browse files

d

parent 517703b8
......@@ -26,9 +26,11 @@ def main():
for gt_type in gt_types:
dice_Score16 = []
hdd_16 = []
for patientnumber in range(16):
patient_dsc = []
patient_hdd = []
if gt_type == 'ctfgt2':
seg_npy = np.load(file_path+"P"+str(patientnumber+1).zfill(2)+"_seg.gipl.npy")
......@@ -60,8 +62,22 @@ def main():
slice_dsc = dice_loss(noisygt, seg)
patient_dsc.append(slice_dsc)
y_true_np = np.squeeze(seg[0, :, :, 0].numpy() > 0.5)
y_true_np = y_true_np.astype(np.float_)
pred_np = np.squeeze(noisygt[0, :, :, 0].numpy() > 0.5)
pred_np = pred_np.astype(np.float_)
hausdorff_distance_filter = sitk.HausdorffDistanceImageFilter()
hausdorff_distance_filter.Execute(sitk.GetImageFromArray(y_true_np), sitk.GetImageFromArray(pred_np))
patient_hdd.append(hausdorff_distance_filter.GetHausdorffDistance())
hdd_16.append(np.mean(patient_hdd))
dice_Score16.append(np.mean(patient_dsc))
print(gt_type, dice_Score16)
print(gt_type, "HDD: ", hdd_16)
print("Dice-Score mean: ", np.mean(dice_Score16))
print("Dice-Score std: ", np.std(dice_Score16))
print("HDD mean: ", np.mean(hdd_16))
print("HDD std: ", np.std(hdd_16))
......
......@@ -20,7 +20,7 @@ def main():
root = tk.Tk()
root.withdraw()
file_path = filedialog.askopenfilename(initialdir="finalResults/complete_thresh/")
file_path = filedialog.askopenfilename(initialdir="finalResults/complete_seg/ae_class_cv_seg/")
file_path = file_path[:-9]
print(file_path)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment