questions > RE: dcm2niix Image Flip
May 18, 2017  05:05 PM | Anderson Napolitano - The University of New Mexico
RE: dcm2niix Image Flip
Hi Dr. Rorden,

Sorry for responding again without waiting for your response but I would just like to know your opinion about what I have found earlier regarding the conversion.

I imported both the original data and the dcm2niix-converted data through nibabel to verify that the voxel space is indeed flipped. It is flipped. From there, I've checked both of their affine matrices and both seems to be different, so I though maybe I can check to see if such flip is reflected on their respective affines.

The affines for the original image and the converted image is:

A_orig = [[ 0.29249999, 0. , 0. , -37.29374695],
[ 0. , 0.29249999, 0. , -37.29374695],
[ 0. , 0. , -0.29249999, 1.60874999],
[ 0. , 0. , 0. , 1. ]]

Orientation_orig = (R,A,I)

A_conv = [[ -0.078125 , 0. , -0. , 9.06762981],
[ -0. , 0.0859375 , -0. , -14.87300301],
[ 0. , 0. , 1.15999997, -9.28507042],
[ 0. , 0. , 0. , 1. ]]

Orientation_conv = (L,A,S)

respectively. The image that I'm working with (256,256,12) is flipped by the z-axis (if the matrix is viewed with 256 * 256 slice facing the observer) after conversion. Hence, voxel (0,0,0) translates to (0,255,0) after conversion in the voxel space.

One would expect that by mapping both voxel coordinates to the subject-reference space (taking note of their respective affines and orientations) that we will get the same subject-reference space locations.

Multiplying (0,0,0,1) to A_orig gives: [-37.29374695, -37.29374695, 1.60874999, 1. ]

and 

Multiplying (0,255,0,1) to A_conv gives: [ 9.06762981, 7.04105949, -9.28507042, 1. ]

If we take their respective orientations into account, voxel (0,0,0) is 37.3 to the left of the subject-scanner reference space origin and voxel (0,255,0) is only 9.06 mm to the left of the subject-scanner reference space origin.

These does not agree which means that the converted image's affine does not reflect such flip.

Are you seeing anything wrong with my computation?

Thanks you so much,
Anderson

Threaded View

TitleAuthorDate
Anderson Napolitano May 17, 2017
RE: dcm2niix Image Flip
Anderson Napolitano May 18, 2017
Chris Rorden May 19, 2017
Lindsay Quandt Aug 15, 2017
Chris Rorden Aug 19, 2017
Chris Rorden Aug 16, 2017
Anderson Napolitano May 19, 2017
Chris Rorden May 18, 2017
Anderson Napolitano May 18, 2017