Skip to content

Commit 05409d9

Browse files
authored
Enhanced multi-value DateElement parsing (#370)
Signed-off-by: M Q <[email protected]> Signed-off-by: M Q <[email protected]>
1 parent 6cdc09d commit 05409d9

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

monai/deploy/operators/dicom_series_selector_operator.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,13 @@ def _select_series(self, attributes: dict, study: DICOMStudy, all_matched=False)
225225
# This is mainly for attributes like ImageType
226226
if not attr_value:
227227
try:
228-
attr_value = [series.get_sop_instances()[0].get_native_sop_instance()[key].repval]
228+
# Can use some enhancements, especially multi-value where VM > 1
229+
elem = series.get_sop_instances()[0].get_native_sop_instance()[key]
230+
if elem.VM > 1:
231+
attr_value = [elem.repval] # repval: str representation of the element’s value
232+
else:
233+
attr_value = elem.value # element's value
234+
229235
series_attr.update({key: attr_value})
230236
except Exception:
231237
logging.info(f" Attribute {key} not at instance level either.")

0 commit comments

Comments
 (0)