Project-MONAI / Project-MONAI/MetricsReloaded
Implementation details and fixes
Open
@csudre is already working on this.
Since Oct 9, 2022.
bug
enhancement
- Dominant language
- Python
- Stars
- 104
- Forks
- 18
- PR merge metrics
- No merged PRs in 30d
Description
- To decrease code repetition and chance of implementation errors some functions/classes can be moved to a utility library:
https://github.com/csudre/MetricsReloaded/blob/mikael-mods/utils.py
and imported when needed, i.e.,
https://github.com/csudre/MetricsReloaded/blob/f7f6296468b6556c882cccebb8b6a973d2352e01/pairwise_measures.py#L6
This could also helps in highligting dependencies that would have to be dealt with for a potential MONAI conversion (e.g., skeletonize). - Parenthesis missing around shape argument, fix:
https://github.com/csudre/MetricsReloaded/blob/f7f6296468b6556c882cccebb8b6a973d2352e01/pairwise_measures.py#L428 - Ensure
refandpredare binarised, fix:
https://github.com/csudre/MetricsReloaded/blob/f7f6296468b6556c882cccebb8b6a973d2352e01/pairwise_measures.py#L180
https://github.com/csudre/MetricsReloaded/blob/f7f6296468b6556c882cccebb8b6a973d2352e01/pairwise_measures.py#L181 - Euclidean distance transform errors as it has two return variables by default, fix:
https://github.com/csudre/MetricsReloaded/blob/f7f6296468b6556c882cccebb8b6a973d2352e01/utils.py#L104 - Centre of mass function name same as variable name, fix (has also been moved to
utils.py):
https://github.com/csudre/MetricsReloaded/blob/f7f6296468b6556c882cccebb8b6a973d2352e01/utils.py#L93 - Maybe include a flag for enabling/disabling the debugging print statements?
- Note that
np.percentileinterpolates, c.f., Fig 7 in Common... paper that points to a discrete value. - Using a histogram in all_multi_threshold_values might be cleaner, i.e.
https://github.com/csudre/MetricsReloaded/blob/f7f6296468b6556c882cccebb8b6a973d2352e01/prob_pairwise_measures.py#L80 - Added a function
x_at_yfor less repeated code:
https://github.com/csudre/MetricsReloaded/blob/f7f6296468b6556c882cccebb8b6a973d2352e01/utils.py#L107
i.e.,
https://github.com/csudre/MetricsReloaded/blob/f7f6296468b6556c882cccebb8b6a973d2352e01/prob_pairwise_measures.py#L236 - No need to load image data to get nifti shape, i.e.
https://github.com/csudre/MetricsReloaded/blob/f7f6296468b6556c882cccebb8b6a973d2352e01/mixed_measures_processes.py#L142 - The
per_label_dictfunctions in the classes inmixed_measures_processes.pycould perhaps be implemented in a base class, which would lead to less lines of code.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.