Skip to content

Commit 3298b7d

Browse files
authored
Merge pull request #394 from Project-MONAI/mqin/breast_density
Make the output DICOM SR instance part of the original study
2 parents 6e7f9b3 + 2174f38 commit 3298b7d

File tree

1 file changed

+27
-4
lines changed
  • examples/apps/breast_density_classifer_app

1 file changed

+27
-4
lines changed

examples/apps/breast_density_classifer_app/app.py

Lines changed: 27 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,22 +19,45 @@ def compose(self):
1919
"0.1",
2020
"Center for Augmented Intelligence in Imaging, Mayo Clinic, Florida",
2121
)
22-
my_equipment = EquipmentInfo(manufacturer="MONAI Deploy App SD", manufacturer_model="DICOM SR Writer")
22+
my_equipment = EquipmentInfo(manufacturer="MONAI Deploy App SDK", manufacturer_model="DICOM SR Writer")
2323
my_special_tags = {"SeriesDescription": "Not for clinical use"}
2424
study_loader_op = DICOMDataLoaderOperator()
25-
series_selector_op = DICOMSeriesSelectorOperator(rules="")
25+
series_selector_op = DICOMSeriesSelectorOperator(rules=Sample_Rules_Text)
2626
series_to_vol_op = DICOMSeriesToVolumeOperator()
2727
classifier_op = ClassifierOperator()
2828
sr_writer_op = DICOMTextSRWriterOperator(
29-
copy_tags=False, model_info=model_info, equipment_info=my_equipment, custom_tags=my_special_tags
30-
)
29+
copy_tags=True, model_info=model_info, equipment_info=my_equipment, custom_tags=my_special_tags
30+
) # copy_tags=True to use Study and Patient modules of the original input
3131

3232
self.add_flow(study_loader_op, series_selector_op, {"dicom_study_list": "dicom_study_list"})
3333
self.add_flow(
3434
series_selector_op, series_to_vol_op, {"study_selected_series_list": "study_selected_series_list"}
3535
)
3636
self.add_flow(series_to_vol_op, classifier_op, {"image": "image"})
3737
self.add_flow(classifier_op, sr_writer_op, {"result_text": "classification_result"})
38+
# Pass the Study series to the SR writer for copying tags
39+
self.add_flow(series_selector_op, sr_writer_op, {"study_selected_series_list": "study_selected_series_list"})
40+
41+
42+
# This is a sample series selection rule in JSON, simply selecting a MG series.
43+
# If the study has more than 1 MG series, then all of them will be selected.
44+
# Please see more detail in DICOMSeriesSelectorOperator.
45+
# For list of string values, e.g. "ImageType": ["PRIMARY", "ORIGINAL"], it is a match if all elements
46+
# are all in the multi-value attribute of the DICOM series.
47+
48+
Sample_Rules_Text = """
49+
{
50+
"selections": [
51+
{
52+
"name": "MG Series",
53+
"conditions": {
54+
"Modality": "(?i)MG",
55+
"ImageType": ["PRIMARY"]
56+
}
57+
}
58+
]
59+
}
60+
"""
3861

3962

4063
def test():

0 commit comments

Comments
 (0)