Skip to content
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

Simplify mapping metric to labels image #658

Merged
merged 6 commits into from
Jun 12, 2024
Merged

Conversation

yoda-vid
Copy link
Collaborator

The labels metadata are now loaded automatically if possible when mapping a metric to a labels image. The labels image suffix can also be specified directly as a CLI argument (eg --reg_suffixes annotationLevel1.mhd), which is more consistent with other functions that use this CLI argument.

Additional changes:

  • CLI arguments are printed to console even at regular (ie not just debug) verbosity level since these args can be so important for any level of troubleshooting and recording
  • Region export only warns instead of producing an error when Excel-related packages are not installed
  • Added a function to parse sub-region IDs from a flat (2D) table instead of requiring a hierarchical (eg JSON) table

yoda-vid added 5 commits June 12, 2024 14:48
These arguments can be helpful for general logging. Pretty-print them for readability.
- Change Excel export error to a warning
- Catach missing Jinja2 error and output warning
… image

Use the labels metadata so that user do not have to specify the path manually.
The registered image has been specified through the level, which assumes that the file has been generated through the labels level remap function. To allow more flexibility in specifying a labels image, users can now give any registered suffix, which is also more consistent with other MM tasks. The function has also been renamed to reflect its more general use in mapping a metric to labels rather than only generating a difference image.
All the children of a given label are often needed from a table, when the hierarchical JSON file is not present. Add a function to obtain these children recursively, assuming that the given table has a column of immediate parents for each label.
@yoda-vid yoda-vid added the enhancement New feature or request label Jun 12, 2024
@yoda-vid yoda-vid added this to the v1.6.0 milestone Jun 12, 2024
@yoda-vid yoda-vid merged commit fd0fe38 into master Jun 12, 2024
5 checks passed
@yoda-vid yoda-vid deleted the simplify_mapped_metric branch June 12, 2024 22:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant