I am trying to add a MultiValue
to a list. But I am getting an error stating that I can't. I have also tried .append
and .extend
the multivalues to the list but get the error that you cannot add NaN values to a list. Also, I am having trouble understanding what exactly is MultiValue
.
The code that I am trying to run is:
original_z_spacing = np.abs(patient_data[0].ImagePositionPatient[2]
- patient_data[1].ImagePositionPatient[2])
# obtain rescaled HU array
hu_array = get_hounsfield_unit_array(patient_data)
original_spacings = np.array(patient_data[0].PixelSpacing + [original_z_spacing], dtype='float32') # the error occurs here
The patient data is a folder of 1595 folders containing dicom files. I am running this code on Python 3.7 and pydicom version 1.4.2. The error that I am getting is:
TypeError: unsupported operand type(s) for +: 'MultiValue' and 'list'