Implementation details and fixes
@csudre is already working on this.
Since Oct 9, 2022.
Assessment
This issue has not been assessed yet.
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.
- Dominant language
- Python
- Stars
- 105
- Forks
- 18
- PR merge metrics
- No merged PRs in 30d
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
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.
More from Project-MONAI/MetricsReloaded
-
Difficulty 1/5 Under an hour Newbie friendliness 68/100
-
MorphologyOps.foreground_component() ignores connectivity parameter, always uses 1-connectivityOpen
Difficulty 2/5 1-3 hours Newbie friendliness 55/100
-
Difficulty 3/5 1-2 days Newbie friendliness 35/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 50/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 52/100
All issues in Project-MONAI/MetricsReloaded
Similar issues
-
good first issue hacktoberfest
Difficulty 1/5 Under an hour Newbie friendliness 92/100
RogueAlg0/taken#387 · 4 comments ·
Maintainers usually reply within 1 day
-
tool-calling
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
vllm-project/vllm#59838 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 92/100
raullenchai/Rapid-MLX#4042 ·
Maintainers usually reply within 1 day
-
documentation
Difficulty 1/5 Under an hour Newbie friendliness 92/100
transitmatters/mbta-slow-zone-bot#70 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
open-webui/open-webui#31871 · 1 comment ·
Maintainers usually reply within 1 day