Skip to content

Unit testing tolerances + more consistent definition of SNR #79

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 12 commits into from
Mar 17, 2025
Merged
6 changes: 3 additions & 3 deletions phantoms/MR_XCAT_qMRI/sim_ivim_sig.py
Original file line number Diff line number Diff line change
Expand Up @@ -459,9 +459,9 @@ def parse_bvalues_file(file_path):
signals = np.squeeze(voxels[int(voxels.shape[0] * voxel_selector_fraction)]).tolist()
generic_data[name] = {
'noise': noise,
'D': np.mean(Dim[selector], axis=0),
'f': np.mean(fim[selector], axis=0),
'Dp': np.mean(Dpim[selector], axis=0),
'D': np.median(Dim[selector], axis=0),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Median now?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, somehow there was a weird rounding happening in the np.mean that made values become 0.0000000000000001 off or so. So all round values become D= 0.0029999999999 instead of 0.003 etc.

'f': np.median(fim[selector], axis=0),
'Dp': np.median(Dpim[selector], axis=0),
'data': signals
}
generic_data['config'] = {
Expand Down
109 changes: 16 additions & 93 deletions tests/IVIMmodels/unit_tests/algorithms.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,92 +16,35 @@
],
"IAR_LU_biexp": {
"tolerances": {
"rtol": {
"f": 5,
"D": 5,
"Dp": 25
},
"atol": {
"f": 1e-2,
"D": 1e-2,
"Dp": 1e-1
}

}
},
"IAR_LU_modified_mix": {
"tolerances": {
"rtol": {
"f": 5,
"D": 5,
"Dp": 25
},
"atol": {
"f": 1e-2,
"D": 1e-2,
"Dp": 1e-1
}

}
},
"IAR_LU_modified_topopro": {
"tolerances": {
"rtol": {
"f": 5,
"D": 5,
"Dp": 25
},
"atol": {
"f": 1e-2,
"D": 1e-2,
"Dp": 1e-1
}

}
},
"IAR_LU_segmented_2step": {
"tolerances": {
"rtol": {
"f": 5,
"D": 5,
"Dp": 25
},
"atol": {
"f": 1e-2,
"D": 1e-2,
"Dp": 1e-1
}

}
},
"IAR_LU_segmented_3step": {
"tolerances": {
"rtol": {
"f": 5,
"D": 5,
"Dp": 25
},
"atol": {
"f": 1e-2,
"D": 1e-2,
"Dp": 1e-1
}

}
},
"IAR_LU_subtracted": {
"tolerances": {
"rtol": {
"f": 5,
"D": 5,
"Dp": 25
},
"atol": {
"f": 1e-2,
"D": 1e-2,
"Dp": 1e-1
}

}
},
"ETP_SRI_LinearFitting": {
"xfail_names": {
"Vein": true
},
"options": {
"thresholds": [500]
},
Expand All @@ -117,51 +60,31 @@
"Dp": 0
},
"dynamic_rtol": {
"offset": 0,
"noise": 0,
"ratio": 0,
"noiseCrossRatio": 10,
"f": 1,
"offset": 0.001,
"noise": 200,
"scale_f": false,
"f": 2,
"D": 1,
"Dp": 2
"Dp": 3
},
"dynamic_atol": {
"offset": 5e-2,
"noise": 0,
"ratio": 0,
"noiseCrossRatio": 10,
"noise": 10,
"scale_f": false,
"f": 1,
"D": 1,
"D": 0.001,
"Dp": 2
}
}
},
"OGC_AmsterdamUMC_biexp_segmented": {
"tolerances": {
"rtol": {
"f": 5,
"D": 5,
"Dp": 25
},
"atol": {
"f": 1e-2,
"D": 1e-2,
"Dp": 1e-1
}

}
},
"OJ_GU_seg": {
"tolerances": {
"rtol": {
"f": 5,
"D": 5,
"Dp": 25
},
"atol": {
"f": 1e-2,
"D": 1e-2,
"Dp": 1e-1
}

}
}
}
Loading
Loading