Including a voxel wise covaraite in 3dMVM

Hello,

I am attempting to include a voxel-wise covariate (a nifti file showing the grey matter probability maps from VBM analysis) in my 3dMVM script see below, but I keep getting this error and I am not sure what this pertains to. Any help or suggestions is much appreciated!

Error in dim(vQV) ← c(dimx, dimy, dimz, length(unique(lop$dataStr[, lop$vQV[1]]))) :
dims [product 42024960] do not match the length of object [351351000]
Execution halted

All the best,
Klad

3dMVM -prefix Fed_VBM -jobs 4
-bsVars group
-wsVars "phasereinf"
-vVars VBM
-SS_type 3
-num_glt 19
-gltLabel 1 3way_inter -gltCode 1 'group : 1
pat -1ctrl phase : 1acq -1rev reinf : 1corr -1incor’
-gltLabel 2 group_phase -gltCode 2 'group : 1
pat -1ctrl phase : 1acq -1rev’
-gltLabel 3 group_reinf -gltCode 3 'group : 1
pat -1ctrl reinf : 1corr -1incor’
-gltLabel 4 phase_reinf -gltCode 4 'phase : 1
acq -1rev reinf : 1corr -1incor’
-gltLabel 5 group -gltCode 5 'group : 1
pat -1ctrl’
-gltLabel 6 phase -gltCode 6 'phase : 1
acq -1rev’
-gltLabel 7 reinf -gltCode 7 'reinf : 1
corr -1incor’
-gltLabel 8 acq_group -gltCode 8 'phase : 1
acq group : 1pat -1ctrl’
-gltLabel 9 rev_group -gltCode 9 ‘phase : 1rev group : 1pat -1ctrl’
-gltLabel 10 corr_group -gltCode 10 'reinf : 1
corr group : 1pat -1ctrl’
-gltLabel 11 incor_group -gltCode 11 ‘reinf : 1incor group : 1pat -1ctrl’
-gltLabel 12 acq_reinf -gltCode 12 'phase : 1
acq reinf : 1corr -1incor’
-gltLabel 13 rev_reinf -gltCode 13 ‘phase : 1rev reinf : 1corr -1incor’
-gltLabel 14 corr_phase -gltCode 14 'reinf : 1
corr phase: 1acq -1rev’
-gltLabel 15 incor_phase -gltCode 15 ‘reinf : 1incor phase : 1acq -1rev’
-gltLabel 16 group_acq_corr -gltCode 16 'group : 1
pat -1ctrl phase : 1acq reinf : 1corr’
-gltLabel 17 group_acq_incor -gltCode 17 'group : 1
pat -1ctrl phase : 1acq reinf : 1incor’
-gltLabel 18 group_rev_corr -gltCode 18 'group : 1
pat -1ctrl phase : 1rev reinf : 1corr’
-gltLabel 19 group_rev_incor -gltCode 19 'group : 1
pat -1ctrl phase : 1rev reinf : 1*incor’
-dataTable
Subj group phase reinf VBM InputFile
6292 pat acq corr 6292/smwc16292.nii 6292/Proc_FIRST_3RUNS_6292_April2019.results/6292_RevP_acq_corr_fed+tlrc
6292 pat acq incor 6292/smwc16292.nii 6292/Proc_FIRST_3RUNS_6292_April2019.results/6292_RevP_acq_incor_fed+tlrc
6292 pat rev corr 6292/smwc16292.nii 6292/Proc_FIRST_3RUNS_6292_April2019.results/6292_RevP_rev_corr_fed+tlrc




.

Klad, do those voxel-wise covariate files have the same dimensions (or resolutions) as the input files? If not, that would be the cause for the error message.

Hi Gang,

I completed VBM using SPM and indicates the specific voxel size, bounding box to match the the MNI template I used for registration (SSwarper). I indicated the smoothing to match what I used in my AFNI pre-processing script. Should I have indicated the voxel size to match my fmri data instead

Thank you,
Tamara

Tamara, can you verify whether the voxel-wise covariate files and those response variable files have the same voxel size using 3dinfo?

They do not (see 3dinfo below).

Do you suggest I alter the VBM input so that it aligns with a 2x2x2 voxel size to match my fmri outputs?

Essentially, I ran VBM using SPM and I would like to enter the grey matter maps as a covariate in my analysis to account for differences in atrophy in my groups. During one of the VBM steps (align to an MNI template), I specified the voxel size of the MNI template I used in AFNI (sswarper). Do you recommend I change this to the voxel size of my fmri data?

Since the fmri data was registered using the MNI template in SSwarper, shouldn’t they have the same voxel size?

Thank you very much!

My VBM files:
Data Axes Orientation:
first (x) = Right-to-Left
second (y) = Posterior-to-Anterior
third (z) = Inferior-to-Superior [-orient RPI]
R-to-L extent: -97.000 [R] -to- 97.000 [L] -step- 1.000 mm [195 voxels]
A-to-P extent: -115.000 [A] -to- 115.000 [P] -step- 1.000 mm [231 voxels]
I-to-S extent: -97.000 [I] -to- 97.000 [S] -step- 1.000 mm [195 voxels]

Stats file:
Data Axes Orientation:
first (x) = Left-to-Right
second (y) = Posterior-to-Anterior
third (z) = Inferior-to-Superior [-orient LPI]
R-to-L extent: -95.000 [R] -to- 95.000 [L] -step- 2.000 mm [ 96 voxels]
A-to-P extent: -95.000 [A] -to- 131.000 [P] -step- 2.000 mm [114 voxels]
I-to-S extent: -77.000 [I] -to- 113.000 [S] -step- 2.000 mm [ 96 voxels]

Do you suggest I alter the VBM input so that it aligns with a 2x2x2 voxel size to match my fmri outputs?

Use 3dresample to change the covariate files to the same resolution as the FMRI data. If your original FMRI data resolution is something like 3.75 x 3.75 x 4, you may consider changing all the files (including both FMRI and covariates) to a resolution of, for example, 3 x 3 x 3. There is nothing you’d gain with a finer voxel size of 2 x 2 x 2.

Thank you very much! I will give that a try.

In addition to using 3dsample, I noticed that the orientation of my stats file and my VBM images may be different, though, I am not too sure (one is right to left, and the other is left to right). Do I need to flip my VBM to match my stats file?

Thank you again.

My VBM files:
Data Axes Orientation:
first (x) = Right-to-Left
second (y) = Posterior-to-Anterior
third (z) = Inferior-to-Superior [-orient RPI]
R-to-L extent: -97.000 [R] -to- 97.000 [L] -step- 1.000 mm [195 voxels]
A-to-P extent: -115.000 [A] -to- 115.000 [P] -step- 1.000 mm [231 voxels]
I-to-S extent: -97.000 -to- 97.000 [S] -step- 1.000 mm [195 voxels]

Stats file:
Data Axes Orientation:
first (x) = Left-to-Right
second (y) = Posterior-to-Anterior
third (z) = Inferior-to-Superior [-orient LPI]
R-to-L extent: -95.000 [R] -to- 95.000 [L] -step- 2.000 mm [ 96 voxels]
A-to-P extent: -95.000 [A] -to- 131.000 [P] -step- 2.000 mm [114 voxels]
I-to-S extent: -77.000 -to- 113.000 [S] -step- 2.000 mm [ 96 voxels]

The VBM output orientation is determined by SPM. While it’s likely that’s okay, mistakes could happen, and left-right flipping problems happen more often than we would like (see link to prepress paper below). We have tools in align_epi_anat.py with the “-check_flip” option, but that works well for anatomical and EPI datasets. It’s not too useful for statistical or computed results. You may want to change the orientation of the input datasets to VBM by left-right flipping it intentionally with 3dLRflip to flip the voxel values or 3drefit -orient to flip the orientation info in the header. Either way creates an incorrect dataset. If the VBM processing results in the same output, then there’s likely a problem. If it results in a mirror image, then that is a good and expected result.

https://www.medrxiv.org/content/10.1101/19009787v1

Thank you very much!