@@ -172,6 +172,7 @@ def __init__(
172
172
self ,
173
173
segment_descriptions : List [SegmentDescription ],
174
174
custom_tags : Optional [Dict [str , str ]] = None ,
175
+ omit_empty_frames : bool = True ,
175
176
* args ,
176
177
** kwargs ,
177
178
):
@@ -192,12 +193,15 @@ def __init__(
192
193
Args:
193
194
segment_descriptions: List[SegmentDescription]
194
195
Object encapsulating the description of each segment present in the segmentation.
195
- custom_tags: OptonalDict[ str, str], optional
196
+ custom_tags: Optional[Dict[ str, str] ], optional
196
197
Dictionary for setting custom DICOM tags using Keywords and str values only
198
+ omit_empty_frames: bool, optional
199
+ Whether to omit frames that contain no segmented pixels from the output segmentation.
197
200
"""
198
201
199
202
self ._seg_descs = [sd .to_segment_description (n ) for n , sd in enumerate (segment_descriptions , 1 )]
200
203
self ._custom_tags = custom_tags
204
+ self ._omit_empty_frames = omit_empty_frames
201
205
202
206
def compute (self , op_input : InputContext , op_output : OutputContext , context : ExecutionContext ):
203
207
"""Performs computation for this operator and handles I/O.
@@ -290,6 +294,7 @@ def create_dicom_seg(self, image: np.ndarray, dicom_series: DICOMSeries, output_
290
294
manufacturer_model_name = "MONAI Deploy App SDK" ,
291
295
software_versions = version_str ,
292
296
device_serial_number = "0000" ,
297
+ omit_empty_frames = self ._omit_empty_frames ,
293
298
)
294
299
295
300
# Adding a few tags that are not in the Dataset
0 commit comments