Hi,
Trying to convert Siemens DICOM MRS files with suspect. This works for most files, but the ones created by a Siemens WIP for navigator gated spectroscopy fail. Somehow the script tries to get the data in a shape with a dimension of 64. It is a single FID of 1024 points, but created with a protocol with multiple measurements. Not 64, but 2.
Other spectra translate just fine.
I looked at the .py and I see it correctly pulls the data dimension from that wonderful obsure carefully hidden Siemens CSA header. I cannot see where the number 64 comes from. How can I fix this?
ValueError Traceback (most recent call last)
in
----> 1 arr_data = suspect.io.load_siemens_dicom(“XX_svs_se_ubp_WSRFoffTR2TE25.0-2ave.IMA”)
/opt/conda/lib/python3.7/site-packages/suspect/io/siemens.py in load_siemens_dicom(filename)
149 complex_data = complex_array_from_iter(iter(data_floats),
150 length=len(data_floats) // 2,
–> 151 shape=data_shape)
152
153 in_plane_rot = csa_header[“VoiInPlaneRotation”]
/opt/conda/lib/python3.7/site-packages/suspect/io/_common.py in complex_array_from_iter(data_iter, length, shape, chirality)
26 complex_array = np.fromiter(complex_iter, “complex64”, length)
27 if shape is not None:
—> 28 complex_array = np.reshape(complex_array, shape).squeeze()
29 return complex_array
<array_function internals> in reshape(*args, **kwargs)
/opt/conda/lib/python3.7/site-packages/numpy/core/fromnumeric.py in reshape(a, newshape, order)
299 [5, 6]])
300 “”"
–> 301 return _wrapfunc(a, ‘reshape’, newshape, order=order)
302
303
/opt/conda/lib/python3.7/site-packages/numpy/core/fromnumeric.py in _wrapfunc(obj, method, *args, **kwds)
59
60 try:
—> 61 return bound(*args, **kwds)
62 except TypeError:
63 # A TypeError occurs if the object does have such a method in its
ValueError: cannot reshape array of size 1024 into shape (64,1,1,1024)