Sep-20-2017, 05:40 PM
I have moved further in this script and changed it a bit. Now I am importing data from a text file and comparing my dicom data to the values in the text file. I ran into another similar issue that I have not been able to solve.
(epi_hd.data_element(parameter).value) gives me the correct value
but...
(data.parameter) is not recognized even though data.SAR returns the correct value.
error:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: 'module' object has no attribute 'parameter'
Does anyone have any helpful suggestions?
Thanks a lot
import dicom import os import numpy from matplotlib import pyplot, cm epi_hd = dicom.read_file("epi/i00001.1") def getVarFromFile(epi_template2): import imp f = open(epi_template2) global data data = imp.load_source('data', '', f) f.close() getVarFromFile('/path/to/epi_template2') parameters = "SAR", "Rows", "Modality", "Columns" for parameter in parameters: if (epi_hd.data_element(parameter).value) != (data.parameter): print("%s: EPI PARAMETER MISMATCH!!!!!") % parameterThe issue is with looping through the parameter values.
(epi_hd.data_element(parameter).value) gives me the correct value
but...
(data.parameter) is not recognized even though data.SAR returns the correct value.
error:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: 'module' object has no attribute 'parameter'
Does anyone have any helpful suggestions?
Thanks a lot