@@ -19,22 +19,45 @@ def compose(self):
19
19
"0.1" ,
20
20
"Center for Augmented Intelligence in Imaging, Mayo Clinic, Florida" ,
21
21
)
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" )
23
23
my_special_tags = {"SeriesDescription" : "Not for clinical use" }
24
24
study_loader_op = DICOMDataLoaderOperator ()
25
- series_selector_op = DICOMSeriesSelectorOperator (rules = "" )
25
+ series_selector_op = DICOMSeriesSelectorOperator (rules = Sample_Rules_Text )
26
26
series_to_vol_op = DICOMSeriesToVolumeOperator ()
27
27
classifier_op = ClassifierOperator ()
28
28
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
31
31
32
32
self .add_flow (study_loader_op , series_selector_op , {"dicom_study_list" : "dicom_study_list" })
33
33
self .add_flow (
34
34
series_selector_op , series_to_vol_op , {"study_selected_series_list" : "study_selected_series_list" }
35
35
)
36
36
self .add_flow (series_to_vol_op , classifier_op , {"image" : "image" })
37
37
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
+ """
38
61
39
62
40
63
def test ():
0 commit comments