Skip to content

81 fix invalid volume classification base cataloging #82

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

CavRiley
Copy link
Collaborator

@CavRiley CavRiley commented Apr 4, 2025

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 or invalid_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.

  • Tag your last commit.
  • Update the package version in pyproject.toml (e.g., to 0.9.8).
  • Update the changelog in 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:

        "16_0": {
            "VolumeModality": "INVALID",
            "SeriesModality": "INVALID",
            "AcqPlane": "INVALID",
            "Isotropic": "False",
            "ModalityProbabilities": "invalid_volume",
            "Bvalue": "-12345",
            "SeriesDescription": "*series_description_placeholder*",
            "Contrast": "None",
            "PixelSpacing_0": "U",
            "PixelSpacing_1": "N",
            "StudyInstanceUID": "*study_instance_UID_placeholder*",
            "SeriesInstanceUID": "*series_instance_UID_placeholder*",
            "SeriesNumber": "16",
            "ImageOrientationPatient": "UNKNOWN_ImageOrientationPatient",
            "PixelBandwidth": "UNKNOWN_PixelBandwidth",

and a valid ModalityProbabilities example:

        "6_0": {
            "VolumeModality": "t1w",
            "SeriesModality": "t1w",
            "AcqPlane": "ax",
            "Isotropic": "False",
            "ModalityProbabilities": {
                "GUESS_ONNX": "t1w",
                "GUESS_ONNX_t1w": "1.0",
                "GUESS_ONNX_gret2star": "0.0",
                "GUESS_ONNX_t2w": "0.0",
                "GUESS_ONNX_flair": "0.0",
                "GUESS_ONNX_b0": "0.0",
                "GUESS_ONNX_tracew": "0.0",
                "GUESS_ONNX_adc": "0.0",
                "GUESS_ONNX_fa": "0.0",
                "GUESS_ONNX_eadc": "0.0",
                "GUESS_ONNX_dwig": "0.0"
            },

A potential change we can look into is providing a more descriptive message for the ModalityProbabilities key.

Sorry, something went wrong.

…lements
@CavRiley CavRiley linked an issue Apr 4, 2025 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

INVALID classificaiton should not prevent basic cataloging
1 participant