ROI in orig to tlrc

Hi all,

I have a binary ROI in the original space that I had created using freesurfer. Now I’m using 3dallienate to transform it to tlrc space, but I don’t get the tlrc ROI in the right location. Here’s the line that I’m using:
3dAllineate -prefix stand_ROI -input ROI.nii -master anat_w_skull_warped+tlrc. -1Dmatrix_apply warp.anat.Xat.1D -final NN

I’m guessing that I’m not using the right matrix (warp.anat.Xat.1D). Is that the problem?


Hi, Ana-

How did you generate that warp.anat.Xat.1D file?


The warp.anat.Xat.1D file was generated when I run for resting state data. I assumed that that warp.anat.Xat.1D file was the matrix that resulted from the alignment of the tlrc template and the anatomical image, but I don’t know for sure.

In any case, I just noticed what could be the main issue: The ROI was created in the same subject that I’m using in afni now, however, the T1 that I was using in freesurfer to create the ROI doesn’t have the same dimensions as the anatomical that I’m using in afni (the one I used for In this case, I assume I need to resample the ROI first (3dresample?) and then run 3dAllineate to transform the resampled ROI to tlrc space?

Thanks for any input!

Hi Ana,

That should be a reasonable matrix to use. I expect you are basically applying the 3dAllineate command from that subject proc script that follows the comment “# warp anat follower datasets (affine)”. Is that the case? Let me reference this AFNI_data6/FT_analysis/s15.proc.FT.uber script for comparison. Is that the command you are using, presumably with a -mast_dxyz option?

The matrix that is applied is an xyz-to-xyz matrix, so it does not require the ROI to be on the same grid (so 3dresample is not needed). But to be sure, when viewed in afni, is the ROI in the correct spatical location when overlayed on the anatomical dataset that is used for the -source option in that 3dAllineate command?

  • rick

Hi Rick,

Based on your message, I’ve tried several things (including the -mast_dxyz option in some cases), but nothing worked.

First thing, trying to answer your question: The ROI is in the correct spatial location when overlayed on the anatomical T1 original dataset from freesurfer. Although I’m not sure if that’s the anatomical I should be using in -source as you mentioned. I tried that as well, just in case, and it didn’t work either.

Also, you mentioned that resampling shouldn’t be necessary because the matrix applied is a xyz-to-xyz matrix. I wanted to ask you, just to make sure that’s the case. I run 3dinfo to compare the freesurfer mask/ROI in the orig space that I’m trying to transform to tlrc, and the anat_w_skull_warped+tlrc. that I’m using as the master. Here are the results:
-freesurfer ROI in orig space:
Geometry String: “MATRIX(1,0,0,-136.7615,0,-1.49012e-08,-1.,133.7361,1.862645e-09,-1.,0,132.4308):256,256,256”
Data Axes Tilt: Plumb
Data Axes Orientation:
first (x) = Right-to-Left
second (y) = Superior-to-Inferior
third (z) = Posterior-to-Anterior [-orient RSP]
R-to-L extent: -136.761 [R] -to- 118.239 [L] -step- 1.000 mm [256 voxels]
A-to-P extent: -121.264 [A] -to- 133.736 [P] -step- 1.000 mm [256 voxels]
I-to-S extent: -122.569 [I] -to- 132.431 [S] -step- 1.000 mm [256 voxels]

-master anat_w_skull_warped+tlrc (generated when I run for resting state data):
Geometry String: “MATRIX(1,0,0,-80,0,1,0,-80,0,0,1,-65):161,191,151”
Data Axes Tilt: Plumb
Data Axes Orientation:
first (x) = Right-to-Left
second (y) = Anterior-to-Posterior
third (z) = Inferior-to-Superior [-orient RAI]
R-to-L extent: -80.000 [R] -to- 80.000 [L] -step- 1.000 mm [161 voxels]
A-to-P extent: -80.000 [A] -to- 110.000 [P] -step- 1.000 mm [191 voxels]
I-to-S extent: -65.000 [I] -to- 85.000 [S] -step- 1.000 mm [151 voxels]

I still think that resampling may be necessary and that could be the problem, but please let me know what your thoughts are. I don’t know what else to try. Thanks!