Result space after running 3dMVM on MNI images

AFNI version info (afni -ver): 24.1.16

Dear all,

I'm running analyses using as input SPM-processed images (MNI based). In the data table of 3dMVM there are the paths to the nifti images (not transformed in brik/head). Using 3dinfo to test the effective space of the input images the output showed "ORIG".
Indeed, after the analyses have run, the results file is +orig. Trying to visualize the result in afni using as Underlay the standard T1 (the same used in SPM processing), the function where am i do not work. Consequently, we used 3drefit to update the header of the results file and of the standard t1 image in +tlrc. This time it was possible to effectively use the Where am i function. However, now the significant clusters are visualized out of the boundaries of the brain (the same T1 template, now +tlrc).

Any suggestion would be extremely helpful
Thanks

Bea

Are the datasets all in some sort of MNI space? Can you verify alignment with the appropriate MNI template then? How did you refit these to MNI space exactly?

In NIFTI datasets, the header information for stating whether something is in a "standard" or "original"/native space is denoted by the sform_code and qform_code. More about this is written here:
https://afni.nimh.nih.gov/pub/dist/doc/htmldoc/nifti/main_toc.html
... and here specifically:
https://afni.nimh.nih.gov/pub/dist/doc/htmldoc/nifti/qsform_code.html

To check the values of this info for your input NIFTI dataset, you can use:

nifti_tool -disp_hdr
-field qform_code -field sform_code
-infiles DSET

Basically, there are integer value for the sform_code and qform_code quantities that encode the space info. Most of the code values are clear as to whether it is "original space" or standard. These can be clearly translated into "+orig" or "+tlrc" within AFNI filenaming. However, SPM likes to use the "ambiguous" one quite often. Therefore, in terms of assigning a "+orig" or "+tlrc", the software and/or user have to pick which way to tilt the interpretation. Sigh. My guess is that either one or both of your dataset's sform_code and qform_code values is "2", the dreaded ambiguous one. Please verify if this is the case (one might be 0 and the other 2, that will still result in the present issue).

Indeed, the AFNI GUI for historical reasons doesn't underlay/overlay a mix of +orig and +tlrc datasets, originally as a helpful measure so people didn't erroneously mix datasets in different spaces.

There are 2 things you can do to control the final space. Firstly you can set the AFNI environment variable AFNI_NIFTI_VIEW to control whether the dreaded [qsf]orm_code of 2 is treated like orig or tlrc:

AFNI_NIFTI_VIEW

The default view extension used for output when creating AFNI format datasets from NIFTI datasets.This variable is only applicable for sform and qform codes that do not have clearly defined views (sform/qform code = 2). Set to “tlrc” or “orig”. See also AFNI_DEFAULT_STD_SPACE and AFNI_NIFTI_PRIORITY. Note sform/qform code=5 can be used for spaces other than MNI or TLRC including MNI_ANAT or D99 spaces.

If you put the followign in your ~/.afnirc settings file, for example:

AFNI_NIFTI_VIEW = tlrc

... then the next time you run a program that outputs a new dataset, and that dataset has the [qs]form_code of 2, it should come out as +tlrc.

You could also use 3drefit to change the attributes of space and AFNI view space within the dataset itself, but if you will do these analyses often, then you might want to control it from the environment variable side.

--pt