3dTcorrelate Iresp

AFNI version info (afni -ver):
AFNI_23.0.02

Hello,
I am using 3dTcorrelate to correlate two -iresp datasets from different sessions, where one has been warped to the other, so they are in the same space.

Using 3dinfo confirms that both datasets have the same dimensions:
Geometry String: "MATRIX(2,0,0,-106,0,-2,0,68.54363,0,0,2,-91.07583):106,106,60"
Data Axes Tilt: Plumb
Data Axes Orientation:
first (x) = Right-to-Left
second (y) = Posterior-to-Anterior
third (z) = Inferior-to-Superior [-orient RPI]
R-to-L extent: -106.000 [R] -to- 104.000 [L] -step- 2.000 mm [106 voxels]
A-to-P extent: -141.456 [A] -to- 68.544 [P] -step- 2.000 mm [106 voxels]
I-to-S extent: -91.076 [I] -to- 26.924 [S] -step- 2.000 mm [ 60 voxels]
Number of time steps = 21 Time step = 1.00000s Origin = 0.00000s

However, the resulting Tcorr image has different dimensions and looks offset when opening it in the viewer:
Geometry String: "MATRIX(2,0,0,-106,0,-2,0,68.98258,0,0,2,-90.05051):106,106,60"
Data Axes Tilt: Plumb
Data Axes Orientation:
first (x) = Right-to-Left
second (y) = Posterior-to-Anterior
third (z) = Inferior-to-Superior [-orient RPI]
R-to-L extent: -106.000 [R] -to- 104.000 [L] -step- 2.000 mm [106 voxels]
A-to-P extent: -141.017 [A] -to- 68.983 [P] -step- 2.000 mm [106 voxels]
I-to-S extent: -90.051 [I] -to- 27.949 [S] -step- 2.000 mm [ 60 voxels]

This is my 3dTcorrelate command:

3dTcorrelate -pearson /Users/letitia/Documents/$subjses1.session1/iresp_zpad_session1.nii.gz
/Users/letitia/Documents/$subjses2.session2/iresp_zpad_session2_warped.nii.gz
-prefix $statsdir1/Iresp_correl_ses1and2_pearson.nii.gz

Hm, that's interesting. What is the output of:

3dinfo \
   -same_all_grid \
    /Users/letitia/Documents/$subjses1.session1/iresp_zpad_session1.nii.gz \
    /Users/letitia/Documents/$subjses2.session2/iresp_zpad_session2_warped.nii.gz 

?

--pt

Hi Paul,

Thank you for your reply. I have done this before and this is the output:
|1|1|1|0|1|
|1|1|1|0|1|

Best,
Letitia

OK, that reflects the fact that those datasets are not in fact on the same grid. The 5 numbers there represent checking the sameness (= 1) or differenceness (= 0) in these properties:

  • -same_dim
  • -same_delta
  • -same_orient
  • -same_center
  • -same_obl

So, in your dataset case, the centers of the dsets are different. I'm a little surprised they could be processed together.

How did you warp one to the other?

--pt

Hi again Paul,

I checked the two 'iresp' images again using the -same_all_grid and they indeed have all the same dimensions. I compared datasets from different subjects before that was my mistake.

These are my warping commads:
3dQwarp -allineate -base min_outlier_session1.nii.gz -source min_outlier_session2.nii.gz -prefix session2-qwarp.nii.gz

3dNwarpApply -source iresp_zpad_session2.nii.gz -nwarp session2-qwarp_WARP.nii.gz -master min_outlier_session1.nii.gz -prefix iresp_zpad_session2_warped.nii.gz

Howdy-

Checking back on this. Is the described issue resolved by comparing the two different datasets, or was that just about the header stuff? Are you still seeing the resulting image of offset in the viewer, even though the input dsets are on the same grid?

If the misalignment persists, I notice that your provided is given as:

3dTcorrelate                                               \
    -pearson                                               \
    /Users/letitia/Documents/$subjses1.session1/iresp_zpad_session1.nii.gz \
    /Users/letitia/Documents/$subjses2.session2/iresp_zpad_session2_warped.nii.gz \
    -prefix   $statsdir1/Iresp_correl_ses1and2_pearson.nii.gz

... but I think the order should be different, and be:

3dTcorrelate                                               \
    -pearson                                               \
    -prefix   $statsdir1/Iresp_correl_ses1and2_pearson.nii.gz \
    /Users/letitia/Documents/$subjses1.session1/iresp_zpad_session1.nii.gz \
    /Users/letitia/Documents/$subjses2.session2/iresp_zpad_session2_warped.nii.gz

... where the important feature is that the "input" datasets should be the final two arguments of the call (the other option order shouldn't matter).

--pt