Skip to content

Make the output DICOM SR instance part of the original study #394

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

Merged
merged 2 commits into from
Nov 22, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 27 additions & 4 deletions examples/apps/breast_density_classifer_app/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,22 +19,45 @@ def compose(self):
"0.1",
"Center for Augmented Intelligence in Imaging, Mayo Clinic, Florida",
)
my_equipment = EquipmentInfo(manufacturer="MONAI Deploy App SD", manufacturer_model="DICOM SR Writer")
my_equipment = EquipmentInfo(manufacturer="MONAI Deploy App SDK", manufacturer_model="DICOM SR Writer")
my_special_tags = {"SeriesDescription": "Not for clinical use"}
study_loader_op = DICOMDataLoaderOperator()
series_selector_op = DICOMSeriesSelectorOperator(rules="")
series_selector_op = DICOMSeriesSelectorOperator(rules=Sample_Rules_Text)
series_to_vol_op = DICOMSeriesToVolumeOperator()
classifier_op = ClassifierOperator()
sr_writer_op = DICOMTextSRWriterOperator(
copy_tags=False, model_info=model_info, equipment_info=my_equipment, custom_tags=my_special_tags
)
copy_tags=True, model_info=model_info, equipment_info=my_equipment, custom_tags=my_special_tags
) # copy_tags=True to use Study and Patient modules of the original input

self.add_flow(study_loader_op, series_selector_op, {"dicom_study_list": "dicom_study_list"})
self.add_flow(
series_selector_op, series_to_vol_op, {"study_selected_series_list": "study_selected_series_list"}
)
self.add_flow(series_to_vol_op, classifier_op, {"image": "image"})
self.add_flow(classifier_op, sr_writer_op, {"result_text": "classification_result"})
# Pass the Study series to the SR writer for copying tags
self.add_flow(series_selector_op, sr_writer_op, {"study_selected_series_list": "study_selected_series_list"})


# This is a sample series selection rule in JSON, simply selecting a MG series.
# If the study has more than 1 MG series, then all of them will be selected.
# Please see more detail in DICOMSeriesSelectorOperator.
# For list of string values, e.g. "ImageType": ["PRIMARY", "ORIGINAL"], it is a match if all elements
# are all in the multi-value attribute of the DICOM series.

Sample_Rules_Text = """
{
"selections": [
{
"name": "MG Series",
"conditions": {
"Modality": "(?i)MG",
"ImageType": ["PRIMARY"]
}
}
]
}
"""


def test():
Expand Down