81 fix invalid volume classification base cataloging #82
+22
−19
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Overview
Previously, when running the classify study script with the json flag, invalid volumes would be represented with an empty dictionary. That functionality is incorrect and we need the fields that are collected from each volume to be included in the JSON cataloging (especially study instance UID).
Implementation
Removed the check at the end of each series' volume iteration for invalid volumes to be replaced with an empty dictionary. Additionally, made a
ModalityProbabilities
key in the volume dictionary with the modality probabilities if the volume is valid orinvalid_volume
if the volume is invalid.PR Checklist
This PR does not affect the
src
directory and does not require a new tag or update to the package, so the following checklist does not need to be fulfilled.pyproject.toml
(e.g., to 0.9.8).pyproject.toml
to reflect your changes.Testing
Manual testing using multiple subjects DICOM scans was conducted to ensure proper functionality.
Problems Faced
N/A
Notes
The following is an example of an invalid volume in the JSON format:
and a valid ModalityProbabilities example:
A potential change we can look into is providing a more descriptive message for the
ModalityProbabilities
key.