3dTcorrelate not computed with datasets with equal length

Hello,

I’m trying to run 3dTcorrelate with two datasets that have the same number of time points (215) according to 3dinfo -nt, but then 3dTcorrelate indicates that they don’t have the same length. Here are the commands

3dTcorrelate -overwrite -pearson -Fisher -prefix TCORRmap.nii.gz P3SBJ01_Events01_MEICA_RHO0_BIC_SPMG1.dr2HRF_E02.nii.gz P3SBJ01_Events01_DN.FBrain.spm.fitts.IM.nii.gz
P3SBJ01_Events01_MEICA_RHO0_BIC_SPMG1.dr2HRF_E02.nii.gz is different length than P3SBJ01_Events01_DN.FBrain.spm.fitts.IM.nii.gz

3dinfo -nt P3SBJ01_Events01_MEICA_RHO0_BIC_SPMG1.dr2HRF_E02.nii.gz
215
3dinfo -nt P3SBJ01_Events01_DN.FBrain.spm.fitts.IM.nii.gz
215

After this error, I tried to investigate possible reasons and noticed that the first dataset (P3SBJ01_Events01_MEICA_RHO0_BIC_SPMG1.dr2HRF_E02.nii.gz) is ‘-abuc’, whereas the second dataset (P3SBJ01_Events01_DN.FBrain.spm.fitts.IM.nii.gz) is ‘-epan’. Could this be the reason why 3dTcorrelate is not working?

If this were the case, I also tried to change the data type of the first dataset from -abuc to -epan with 3drefit -epan P3SBJ01_Events01_MEICA_RHO0_BIC_SPMG1.dr2HRF_E02.nii.gz). However, although the command runs, it seems that no change is actually done because the dataset continues to be -abuc according to 3dinfo.

Any suggestions would be really appreciated.

Thanks,
Cesar

Hi again,

The error appeared because one of the datasets had TR = 0, and using 3drefit -TR sorted it out.

Thanks,
Cesar

Hi Cesar,

Thanks for figuring that out. It is a bit strange though,

While I can imagine an ntt vs nvals difference when
converting from NIFTI to AFNI (internally), the ultimate
test that 3dTcorrelate uses which leads to that error
message compares exactly what gets printed out via
the “3dinfo -nt” command.

This reminds me of your similar issue reading and
writing those files in R, which, despite spending some
time on, I have yet to resolve…

  • rick