@@ -57,8 +57,8 @@ def __init__(
57
57
fragment : Fragment ,
58
58
* args ,
59
59
output_folder : Union [str , Path ],
60
- copy_tags : bool ,
61
60
model_info : ModelInfo ,
61
+ copy_tags : bool = True ,
62
62
equipment_info : Optional [EquipmentInfo ] = None ,
63
63
custom_tags : Optional [Dict [str , str ]] = None ,
64
64
** kwargs ,
@@ -67,7 +67,8 @@ def __init__(
67
67
68
68
Args:
69
69
output_folder (str or Path): The folder for saving the generated DICOM instance file.
70
- copy_tags (bool): True for copying DICOM attributes from a provided DICOMSeries.
70
+ copy_tags (bool): True, default, for copying DICOM attributes from a provided DICOMSeries.
71
+ If True and no DICOMSeries obj provided, runtime exception is thrown.
71
72
model_info (ModelInfo): Object encapsulating model creator, name, version and UID.
72
73
equipment_info (EquipmentInfo, optional): Object encapsulating info for DICOM Equipment Module.
73
74
Defaults to None.
@@ -120,7 +121,7 @@ def setup(self, spec: OperatorSpec):
120
121
"""
121
122
122
123
spec .input (self .input_name_text )
123
- spec .input (self .input_name_dcm_series )
124
+ spec .input (self .input_name_dcm_series ). condition ( ConditionType . NONE ) # Optional input
124
125
125
126
def compute (self , op_input , op_output , context ):
126
127
"""Performs computation for this operator and handles I/O.
@@ -143,10 +144,11 @@ def compute(self, op_input, op_output, context):
143
144
if not result_text :
144
145
raise IOError ("Input is read but blank." )
145
146
147
+ study_selected_series_list = None
146
148
try :
147
149
study_selected_series_list = op_input .receive (self .input_name_dcm_series )
148
150
except Exception :
149
- study_selected_series_list = None
151
+ pass
150
152
151
153
dicom_series = None # It can be None if not to copy_tags.
152
154
if self .copy_tags :
0 commit comments