3dTcorr1D length is less than ii?! error

Hi AFNI Gurus,

I’m attempting to generate files for a seed based connectivity analysis using 3dTcorr1D, but I keep getting the following error:

++ 3dTcorr1D: AFNI version=AFNI_20.0.24 (Mar 30 2020) [64-bit]
 + reading dataset file /Users/laurenlebois/Desktop/AURORA/faces/betas/sub-100203_con_0001.nii
 + reading 1D file /Users/laurenlebois/Desktop/AURORA/faces/group_analysis/Connectivity_analyses/sub-100203_LmPFC_Fear-Neut_TS.1D
** FATAL ERROR: Input dataset /Users/laurenlebois/Desktop/AURORA/faces/betas/sub-100203_con_0001.nii length is less than ii?!
** Program compile date = Mar 30 2020

3dmaskave ran successfully on the sub-100203_con_0001.nii file to generate the 1D file for 3dTcorr1D - so I’m unclear on what is causing this problem. Any advice on how to proceed?

Thanks for your time!

Hi, Lauren-

Could you please copy+paste your full command here?

Also, what are the outputs of:

1d_tool.py -show_rows_cols -infile /Users/laurenlebois/Desktop/AURORA/faces/group_analysis/Connectivity_analyses/sub-100203_LmPFC_Fear-Neut_TS.1D


3dinfo -nv /Users/laurenlebois/Desktop/AURORA/faces/betas/sub-100203_con_0001.nii



Hi Paul,

Certainly! Here is the full command:

	set expt_path = /Users/laurenlebois/Desktop/AURORA/
	set expt_name = faces/
	set group_data_dir = group_analysis/Connectivity_analyses
	set mask = sphere-mask-LmPFC-12+50+4.nii
	set mask_path = /Users/laurenlebois/Desktop/AURORA/faces/group_analysis/ROI_analyses/Masks
	set beta_path = /Users/laurenlebois/Desktop/AURORA/faces/betas/
	set beta_file = con_0001.nii
	set subjects_included = (sub-100203 sub-100311)
	set y1D = LmPFC_Fear-Neut_TS
	set output_file = F-N_LmPFC
#  *****************************************************************************************
	      foreach subj ($subjects_included)
			3dmaskave 											\
				-mask {$mask_path}/{$mask}						\
				-quiet											\
				  {$beta_path}{$subj}_{$beta_file}				\
				  >> {$expt_path}{$expt_name}{$group_data_dir}/{$subj}_{$y1D}.1D
			3dTcorr1D																							\
				-pearson																						\
				-Fisher																							\
				-prefix {$expt_path}{$expt_name}{$group_data_dir}/{$subj}_{$output_file}_Connectivity.nii.gz	\
				{$beta_path}{$subj}_{$beta_file}																\

The output of 1d_tool.py:

~ % 1d_tool.py -show_rows_cols -infile /Users/laurenlebois/Desktop/AURORA/faces/group_analysis/Connectivity_analyses/sub-100203_LmPFC_Fear-Neut_TS.1D 
rows = 1, cols = 1

The output of 3dinfo:

~ % 3dinfo -nv /Users/laurenlebois/Desktop/AURORA/faces/betas/sub-100203_con_0001.nii


Hi, Lauren-

OK, the problem is with the inputs.

From 3dTcorr1D’s help:

Usage: 3dTcorr1D [options] xset y1D   ~1~

Computes the correlation coefficient between each voxel time series
in the input 3D+time dataset 'xset' and each column in the 1D time
series file 'y1D', and stores the output values in a new dataset.

The “xset” you have been using is a beta value, not a data set of time series (3D+time dataset). Your “3dinfo -nv …” command should return a number of volumes much larger than 1. For example, if you have processed your data with afni_proc.py, you would probably use the “fitts*” file (for task analysis) or “errts*” file (for resting/naturalistic data).

Your 1D file would also be a time series of numbers, probably 1 column with as many rows as time points in your “xset” dataset.

Maybe also can I ask, how do you want to create your ROIs for this analysis? Spheres around certain (x,y,z) coords, or premade blobs?


Hi Paul,

Thank you so much! I think I understand, but just to clarify, if my aim is to look at the connectivity between my ROI (say a 5mm sphere that I made using x,y,z coordinates located in the vmPFC - not a premade blob), and all other voxels in the brain in my task (specifically, a fear > neutral face contrast from this task), I could use 3dTcorr1D if:

  1. My y1D file was set up as a file with a row for each participant’s average beta value in that ROI, e.g.,:
    subj01 fear>neutral vmPFC ROI average beta value
    subj02 fear>neutral vmPFC ROI average beta value

  2. My xset file was one bucketed file that included a brick for each subject’s individual functional contrast beta file, e.g.,:
    subj01 fear>neutral contrast beta file . nii
    subj02 fear>neutral contrast beta file . nii