help
help > RE: Voxels squeezed in y and z directions by transformation matrix after conversion to NIfTI from oblique Siemens mosaic DICOM slices
Jul 9, 2018 02:07 PM | Chris Rorden
RE: Voxels squeezed in y and z directions by transformation matrix after conversion to NIfTI from oblique Siemens mosaic DICOM slices
You should contact the people who developed the software, this is a
problem with that software, not with dcm2niix. This Matlab code
demonstrates how to detect the true distance between voxels using
the NIfTI SForm. The script below simply calculates the mm
coordinates for a source voxel as well as the neighboring voxels
located left, anterior and superior. It then uses Pythagorean
theorem to compute the distance between the source voxel and each
of its neighbors:
Input:
mm = (hdr.mat * [0 0 0 1; 1 0 0 1; 0 1 0 1; 0 0 1 1]'); %mm position of slices
Xmm = sqrt((mm(1,1)-mm(1,2))^2 + (mm(2,1)-mm(2,2))^2 + (mm(3,1)-mm(3,2))^2) %distance between slices
Ymm = sqrt((mm(1,1)-mm(1,3))^2 + (mm(2,1)-mm(2,3))^2 + (mm(3,1)-mm(3,3))^2) %distance between slices
Zmm = sqrt((mm(1,1)-mm(1,4))^2 + (mm(2,1)-mm(2,4))^2 + (mm(3,1)-mm(3,4))^2) %distance between slices
Output:
Xmm =1.9998
Ymm =2.0000
Zmm =2.0000
So your voxels are still isotropic, but the image space is not aligned to world space (the MRI was acquired rotated with respect to the scanner bore).
Input:
mm = (hdr.mat * [0 0 0 1; 1 0 0 1; 0 1 0 1; 0 0 1 1]'); %mm position of slices
Xmm = sqrt((mm(1,1)-mm(1,2))^2 + (mm(2,1)-mm(2,2))^2 + (mm(3,1)-mm(3,2))^2) %distance between slices
Ymm = sqrt((mm(1,1)-mm(1,3))^2 + (mm(2,1)-mm(2,3))^2 + (mm(3,1)-mm(3,3))^2) %distance between slices
Zmm = sqrt((mm(1,1)-mm(1,4))^2 + (mm(2,1)-mm(2,4))^2 + (mm(3,1)-mm(3,4))^2) %distance between slices
Output:
Xmm =1.9998
Ymm =2.0000
Zmm =2.0000
So your voxels are still isotropic, but the image space is not aligned to world space (the MRI was acquired rotated with respect to the scanner bore).
Threaded View
Title | Author | Date |
---|---|---|
Samuel Holly | Jul 6, 2018 | |
Chris Rorden | Jul 6, 2018 | |
Samuel Holly | Jul 9, 2018 | |
Chris Rorden | Jul 9, 2018 | |
Samuel Holly | Jul 10, 2018 | |