Skip to content

Commit

Permalink
Handle lack of VOIPositionSag in XA20 data.
Browse files Browse the repository at this point in the history
  • Loading branch information
wtclarke committed Mar 2, 2024
1 parent 19d1e15 commit 66b07bb
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions spec2nii/Siemens/rda.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,10 +101,16 @@ def convert_rda(rda_path, fname_out, verbose):
data_cmplx = data_cmplx.reshape((1, 1, 1) + data_cmplx.shape)
data_shape = (1, 1, 1)

imagePositionPatient = np.asarray([
_locale_float(hdr['VOIPositionSag']),
_locale_float(hdr['VOIPositionCor']),
_locale_float(hdr['VOIPositionTra'])])
try:
imagePositionPatient = np.asarray([
_locale_float(hdr['VOIPositionSag']),
_locale_float(hdr['VOIPositionCor']),
_locale_float(hdr['VOIPositionTra'])])
except KeyError:
imagePositionPatient = np.asarray([
_locale_float(hdr['PositionVector[0]']),
_locale_float(hdr['PositionVector[1]']),
_locale_float(hdr['PositionVector[2]'])])

half_shift = False

Expand Down

0 comments on commit 66b07bb

Please sign in to comment.