Hi, R-
OK, then if the alignment was good at those earlier stages, then that is where the data should be. Note that depending on how you smooth the data, that can "push" the extent of the data outside the masking that was performed, and hence you can/will see things outside that mask. Again, I personally would recommend to not mask the data, to be able to see everything everywhere, and have a sense of SNR, artifact, alignment, etc. It is often quite informative.
That 3dresample command seems fine for regridding data if you needed to, but that should not be necessary in this situation if the datasets have appropriate header info.
Looking at your input dataset name, Tcorr_r_001+orig, I can see it is labelled in the header as being in "subject" or "original" space, because of the +orig. In the NIFTI header of your output/processed data, please check and see what the sform_code and qform_code values are:
nifti_tool -disp_hdr -field sform_code -field qform_code -infiles DSET
For a dataset in standard/template space, you should see either 3, 4 or 5 in at least one of those (and either a duplicated number, or one of the pair being 0). These are the agreed upon NIFTI standard values for data in a template space.
- 3 is specifically Talairach-Tournoux space;
- 4 is specifically MNI (well, one of the many MNI varieties)
- 5 is any other template space.
Please see here for more details. These map to the AFNI view space names, like "+orig" or "+tlrc" in the AFNI BRIK/HEAD format filenames (see that same page linked at the start of this paragraph).
In the AFNI GUI, you can't overlay a +orig dset on a +tlrc one, or vice versa. So, the resampling here is not required to regrid your data, the important function it is performing is changing the view space label within the dset here, so your input dataset gets a template-space one from the MNI*SSW.nii.gz header. This is because either Tcorr_r_001+orig is not actually in a template space, or the dataset it was derived from had misleading header info. That can be checked with the above nifti_tool command. Compare that output with running that nifti_tool command on the
MNI152_2009_template_SSW.nii.gz template dset, whose qform_code and sform_code values are both (appropriately) 4.
To see what space and view info the MNI template has, you can run:
$ 3dinfo -space -av_space MNI152_2009_template_SSW.nii.gz
MNI_2009c_asym +tlrc
Notice how the space info is even more specific than just MNI. This is because there are maaaany flavors of MNI template.
If you want to change just the space info in a dset to match that, you can do it as follows, rather than resampling the data:
# copy the dset, because the next cmd changes header info 'in place'
3dcopy DSET_IN DSET_OUT
# change header info to match the MNI template
3drefit -space MNI_2009c_asym -view tlrc DSET_OUT
After this, even thought DSET_IN and the MNI template wouldn't view together in the AFNI GUI, the header-adjusted DSET_OUT and MNI template will, even though they have different grids, like voxel size, etc.).
--pt