openmrslab / suspect

MRS processing tools
https://suspect.readthedocs.io/en/latest/
MIT License
33 stars 23 forks source link

Siemens DICOM vs rda transform #118

Open c42f opened 6 years ago

c42f commented 6 years ago

Should the transform computed for a Siemens DICOM and the associated exported RDA be exactly the same?

I've got some data where this seems not to be the case, nor do the computed row_vector and column_vector match. Unfortunately I can't attach the full data here, but here are some snippets:

relevant part of rda header:

SequenceName: *svs_se
SequenceDescription: *svs_se
[...]
SliceThickness: 15.000000
PositionVector[0]: -33.703157
PositionVector[1]: 21.192990
PositionVector[2]: -27.051218
RowVector[0]: -0.000503
RowVector[1]: -0.099769
RowVector[2]: 0.995010
ColumnVector[0]: -0.003086
ColumnVector[1]: 0.995006
ColumnVector[2]: 0.099767
VOIPositionSag: -33.753210
VOIPositionCor: 35.369816
VOIPositionTra: -18.092139
VOIThickness: 15.000000
VOIPhaseFOV: 30.000000
VOIReadoutFOV: 15.000000
VOINormalSag: 0.999995
VOINormalCor: 0.003020
VOINormalTra: 0.000808
VOIRotationInPlane: -0.099933
FoVHeight: 30.000000
FoVWidth: 15.000000
FoV3D: 15.000000
PercentOfRectFoV: 1.000000
NumberOfRows: 1
NumberOfColumns: 1
NumberOf3DParts: 1
PixelSpacingRow: 30.000000
PixelSpacingCol: 15.000000
PixelSpacing3D: 15.000000

And dumped values from the DICOM:

csa_header["VoiInPlaneRotation"] =  -0.099933
csa_header["VoiOrientation"] =  [0.999995, 0.00302, 0.000808]
csa_header["PixelSpacing"] =  [30.0, 15.0]
csa_header["SliceThickness"] =  15.0
csa_header["VoiPosition"] =  [-33.75321, 35.369816, -18.092139]
c42f commented 5 years ago

Some hints may be had in Gannet which has quite a terrifying heuristic for determining the correct voxel rotation:

https://github.com/richardedden/Gannet3.0/blob/master/GannetMask_SiemensTWIX.m

Some code archeology leads also to the vox2ras family of functions, for example: https://github.com/FNNDSC/matlab/blob/master/misc/vox2ras_aa.m http://www.nmr.mgh.harvard.edu/~rudolph/software/vox2ras/doc/vox2ras.html