3d reorientation and reslice coronal view

Hi Afni experts,
I have a question, we did a anatomical mri to macaque, but the orientation looks not perfect coronal cut, and by extension in all the others planes. How I know, because I have a previous mri from several years back and the image are not similar, and from the horizontal view the hemispheres are very asymmetrical
I would like to reoriented the mri and reslices coronal view. I tried to do reorient by using

3dWarp -oblique2card T1w_shft.nii.gz

but I didn’t see any change.
I though to align with a template as NMT_v2.0_sym_05mm.nii.gz

 3dresample  -master NMT_v2.0_sym_05mm.nii.gz -prefix T1_new.nii.gz  -input T1w.nii.gz 

The output was distorted images.
I am doing this because I need to detect the chamber position to plan electrophysiology recording, but the position from the mri don’t make sense with the coordinate we used when we implanted it.
I appreciate any help

Hi, Fabian-

To clarify, are you wanting to do something like going from “sphinx” positioning of an acquired macaque dataset to “human” positioning?

Otherwise, can you clarify this description “not perfect coronal cut” – in what way is it not perfect?

Is your dataset oblique? What is the output of:

3dinfo -orient -obliquity DSET_NAME


Hi Taylor,
Probable my statement “not perfect coronal cut” is incorrect. I attached first the 2011 mri I can see the chamber perpendicular and the second 2020 the same chamber but in angle and checking this mri I don’t see the chamber correctly in the coronal view.

3dinfo -orient -obliquity T1w.nii.gz
LSP     0.000

Looking now the two mri the sagittal is not proper position as the canonical coordinate I assume, how can I move to the canonical coordinates?
Thanks for the help

Hi, Fabian-

OK, thanks for the attached images-- that does help to clarify it. I think you would want your brains “axialized” better: that is, you want the brain rotated in space so that it appears in the field of view with standard view planes/slices.

My guess is that this dataset might have been acquired obliquely – which is why I asked for the output of that “3dinfo -obliquity …” command – but that the obliquity matrix info has been lost in the header – because the 3dinfo command shows no obliquity present.

Soooo, is this the dataset only converted from DICOMs? Or is there an earlier version of it, which you can check to see if it has obliquity information, using either the same 3dinfo command above, or more explicitly for the whole matrix:

3dWarp -deoblique -disp_obl_xform_only DSET_NAME



Hi Taylor,
The T1w from the current mri. I did before

3drefit -deoblique -orient LSP T1w.nii.gz 

Because the orientation is like the image you see at the end.
Horizontal - Sagittal - Coronal view from afni.
If I applied 3drefit -deoblique -orient LSP then the orientation is agreed with the view in afni
I applied to the original mri

3dWarp -deoblique -disp_obl_xform_only DSET_NAME

++ 3dWarp: AFNI version=AFNI_20.2.14 (Aug 21 2020) [64-bit]
++ Authored by: RW Cox
# mat44 Obliquity Transformation ::
      1.000000      0.000001     -0.000000      -0.000114
     -0.000001      0.990024     -0.140901      -5.472626
      0.000000      0.140901      0.990024     -18.687933

The original is from nifti file. The scanner we use is a siemmens prima 3T , the data is saved in dicom and nifti, I downloaded the nifti



Hi, Fabian-

Thanks for the further details. I think there are 2 things going on here:

  • your dataset was acquired with the macaque in sphinx position (so, where the “axial” brainslices of a human brain would be, there are now upside-down coronal views; etc.).
  • your dataset was acquired with obliquity (so there is a rotation+translation of the FOV relative to “scanner coords”).

These are manageable; it might be easier if I take a look at the dataset in question. I will send you an email to upload the data, if possible.


Hi Taylor,
Thanks I sent an email to you.