@@ -110,7 +110,8 @@ def __init__(
110
110
custom_tags (Dict[str, str], optional): Dictionary for setting custom DICOM tags using Keywords and str values only. Defaults to None.
111
111
112
112
Raises:
113
- ValueError: If copy_tags is true and no DICOMSeries object provided.
113
+ ValueError: If copy_tags is true and no DICOMSeries object provided, or
114
+ if result cannot be found either in memory or from file.
114
115
"""
115
116
116
117
self ._logger = logging .getLogger ("{}.{}" .format (__name__ , type (self ).__name__ ))
@@ -153,7 +154,7 @@ def compute(self, op_input: InputContext, op_output: OutputContext, context: Exe
153
154
try :
154
155
file_path = op_input .get ("classification_result_file" )
155
156
except ItemNotExistsError :
156
- raise ItemNotExistsError ("None of the named inputs exists " )
157
+ raise ValueError ("None of the named inputs for result can be found. " )
157
158
# Read file, and if exception, let it bubble up
158
159
with open (file_path .path , "r" ) as f :
159
160
result_text = f .read ().strip ()
@@ -217,7 +218,7 @@ def write(self, content_text, dicom_series: DICOMSeries, output_dir: Path):
217
218
# Use text value for example
218
219
ds .ValueType = "TEXT"
219
220
220
- ## ConceptNameCode Sequence
221
+ # ConceptNameCode Sequence
221
222
seq_concept_name_code = Sequence ()
222
223
ds_concept_name_code = Dataset ()
223
224
ds_concept_name_code .CodeValue = "18748-4"
@@ -400,16 +401,13 @@ def write_common_modules(
400
401
seq_contributing_equipement = Sequence ()
401
402
ds_contributing_equipement = Dataset ()
402
403
ds_contributing_equipement .PurposeOfReferenceCodeSequence = seq_purpose_of_reference_code
403
- ds_contributing_equipement .Manufacturer = (
404
- model_info .creator
405
- ) # '(121014, DCM, “Device Observer Manufacturer")'
406
- ds_contributing_equipement .ManufacturerModel = (
407
- model_info .name
408
- ) # u'(121015, DCM, “Device Observer Model Name")'
409
- ds_contributing_equipement .SoftwareVersionNumber = (
410
- model_info .version
411
- ) # u'(111003, DCM, “Algorithm Version")'
412
- ds_contributing_equipement .DeviceUID = model_info .uid # u'(121012, DCM, “Device Observer UID")'
404
+ # '(121014, DCM, “Device Observer Manufacturer")'
405
+ ds_contributing_equipement .Manufacturer = model_info .creator
406
+ # u'(121015, DCM, “Device Observer Model Name")'
407
+ ds_contributing_equipement .ManufacturerModel = model_info .name
408
+ # u'(111003, DCM, “Algorithm Version")'
409
+ ds_contributing_equipement .SoftwareVersionNumber = model_info .version
410
+ ds_contributing_equipement .DeviceUID = model_info .uid # u'(121012, DCM, “Device Observer UID")'
413
411
seq_contributing_equipement .append (ds_contributing_equipement )
414
412
ds .ContributingEquipementSequence = seq_contributing_equipement
415
413
0 commit comments