Error rotating animal data

Hello,

I do neuroimaging in pigs and in order to get a brain extracted image to work with, I have to 1) deoblique my data, 2) rotate into proper orientation, and 3) manually draw a mask around the brain in AFNI and 4) apply the mask to my rotated image.

I am getting an error for one of my T1 scans where it will not rotate, although T2 worked just fine. This is the error that I am getting:

afni-24.1.02:~/Desktop/L014$ 3drotate -rotate -90 180 180 -prefix T1_rot.nii T1_do.nii
++ 3drotate: AFNI version=AFNI_24.1.02 (Apr 9 2024) [64-bit]
++ Authored by: RW Cox

Fatal Signal 11 (SIGSEGV) received
fft_shift2
apply_zshear
apply_3shear
THD_rota_vol
3drotate main
Bottom of Debug Stack
** Command line was:
3drotate -rotate -90 180 180 -prefix T1_rot.nii T1_do.nii
** AFNI version = AFNI_24.1.02 Compile date = Apr 9 2024
** [[Precompiled binary linux_openmp_64: Apr 9 2024]]
** Program Death **
** If you report this crash to the AFNI message board,
** please copy the error messages EXACTLY, and give
** the command line you used to run the program, and
** any other information needed to repeat the problem.
** You may later be asked to upload data to help debug.
** Crash log is appended to file /home/jovyan/.afni.crashlog

Does anyone have any experience dealing with this error? Any suggestions?

Best,
AHN

Hi, AHN-

Hmm, that is odd to fail for just one dataset and not the other. First, I would simply run 3dinfo .. on it, to make sure there is not a header problem.

Is this procedure what might be "desphinxifying" a dataset, which particularly happens in nonhuman imaging because while humans lie "nose up" in the scanner and animals are "nose along" it? That is, the axial plane of the human head is perpendicular to the Z-axis of the scanner, while the nonhuman is parallel to it? In the end, one typically wants to have the dataset planes appear to have been acquired in a more "human" orientation, yes?

When I do a procedure like that, I use 3drefit to effectively change the orientation of the data by adjusting the header. We actually have a program called desphinxify that wraps around this 3drefit functionality, to facilitate this process. It also removes obliquity from your data (and has no resampling effect, which is good).

The thing that you, the user, have to provide is what is the intermediate orientation value that going from RAI defines the set of rotations? As the help describes, for many datasets "RIP" would be the common (albeit ominous-sounding) choice. "LIP" is another common one. The trick is that you the user must specify it---getting the final left and right correct is something you need to specify. Many people know what that is by reorienting a "reference set" to verify that they get left/right (as well as all other more easily visually-verifiable orientations) correct. I guess you do actually have that already, because you could run desphinxify on your original T2w dataset and calibrate the -orient_mid .. value that matches what you have correctly done already. Then you should be able to apply that to your T1w dataset. That is how I would do this procedure.

Of course, if there is a header problem or something with your input dataset, then neither program will work.

--pt