translationalneuromodeling / tapas

TAPAS - Translational Algorithms for Psychiatry-Advancing Science
https://translationalneuromodeling.github.io/tapas/
GNU General Public License v3.0
211 stars 88 forks source link

PHYSIO with multiecho data #270

Open AndongZhou12 opened 1 month ago

AndongZhou12 commented 1 month ago

Dear Lars,

I am currently using the PhysIO toolbox for generating the regressors for 7T multi-echo data. I also got the CSF and whiter matter anat files, and combined functional nii file and realignment parameters. However, no matter how I modify my codes (I also tried turn off the ROIs and parameters), the same error appeared: 03-Jun-2024 22:07:16 - Failed 'TAPAS PhysIO Toolbox' Error using horzcat Dimensions of arrays being concatenated are not consistent. In file "/Users/zhouandong/Desktop/spm12/toolbox/PhysIO/tapas_physio_main_create_regressors.m" (???), function "append_regressors" at line 466. In file "/Users/zhouandong/Desktop/spm12/toolbox/PhysIO/tapas_physio_main_create_regressors.m" (???), function "tapas_physio_main_create_regressors" at line 363. In file "/Users/zhouandong/Desktop/spm12/toolbox/PhysIO/tapas_physio_cfg_matlabbatch.m" (???), function "run_physio" at line 1661.

Can you give me some suggestions?

The following modules did not run: Failed: TAPAS PhysIO Toolbox

800_PULS.log 800_RESP.log 800_Info.log ME.txt

Best wishes, Andong

mrikasper commented 3 weeks ago

Dear Andong,

The horzcat error points to an issue with the length of the multiple regressors vectors, presumably the one created from the logfiles vs. the nifti image files CSF etc.). Here are some questions to explore:

  1. If you only use the logfiles (no noise_rois), does the script run through?
  2. If you only use the noise_rois (no logfiles specified), does the script run through?
  3. Does your .nii file exactly have 344 volumes, as specified in the sqpar.Nscans?
  4. If not, or if (2) fails with a wrong number of volumes, you may have to specify the 344 volumes within the 4D nifti-file explicitly, e.g.,
matlabbatch{1}.spm.tools.physio.model.noise_rois.yes.fmri_files = {
'/Users/zhouandong/Desktop/800p/800_CNBT.nii,1'
'/Users/zhouandong/Desktop/800p/800_CNBT.nii,2'
...
'/Users/zhouandong/Desktop/800p/800_CNBT.nii,344'
}

You can use functions such as spm_select to create this array automatically.

I hope this helps!

All the best, Lars

AndongZhou12 commented 3 weeks ago

Dear Andong,

The horzcat error points to an issue with the length of the multiple regressors vectors, presumably the one created from the logfiles vs. the nifti image files CSF etc.). Here are some questions to explore:

  1. If you only use the logfiles (no noise_rois), does the script run through?
  2. If you only use the noise_rois (no logfiles specified), does the script run through?
  3. Does your .nii file exactly have 344 volumes, as specified in the sqpar.Nscans?
  4. If not, or if (2) fails with a wrong number of volumes, you may have to specify the 344 volumes within the 4D nifti-file explicitly, e.g.,
matlabbatch{1}.spm.tools.physio.model.noise_rois.yes.fmri_files = {
'/Users/zhouandong/Desktop/800p/800_CNBT.nii,1'
'/Users/zhouandong/Desktop/800p/800_CNBT.nii,2'
...
'/Users/zhouandong/Desktop/800p/800_CNBT.nii,344'
}

You can use functions such as spm_select to create this array automatically.

I hope this helps!

All the best, Lars

Dear Lars,

Thank you for the suggestions, there are very helpful and I found the mistakes I made. One is that the realignment parameter I got from AFNI is not compatible with SPM (AFNI uses degrees for the roll, pitch and yaw parameters, whereas SPM12 uses radians), therefore I transfrom them into the correct version for SPM. The second mistake is a bit embarrassing, I think I mistakenly typed the Nscans to 344 (it is 342 instead!) After that I can get the regressors and SPM.mat with the logfiles and the movement files.

However, when I want to added the final step (the ROIs: the combined nii and white matter and CSF files), I can see a fancy plot been generated but got this error message: '14-Jun-2024 16:16:52 - Failed 'TAPAS PhysIO Toolbox' Unrecognized field name "cm". In file "/Users/zhouandong/Desktop/spm12/toolbox/PhysIO/code/model/tapas_physio_create_noise_rois_regressors.m" (???), function "tapas_physio_create_noise_rois_regressors" at line 186. In file "/Users/zhouandong/Desktop/spm12/toolbox/PhysIO/tapas_physio_main_create_regressors.m" (???), function "tapas_physio_main_create_regressors" at line 360. In file "/Users/zhouandong/Desktop/spm12/toolbox/PhysIO/tapas_physio_cfg_matlabbatch.m" (???), function "run_physio" at line 1661.

The following modules did not run: Failed: TAPAS PhysIO Toolbox'

Can you give me some more guidance, I am really appreciated for the help!

Best wishes, Andong 22391718346250_ pic

AndongZhou12 commented 3 weeks ago

Dear Andong,

The horzcat error points to an issue with the length of the multiple regressors vectors, presumably the one created from the logfiles vs. the nifti image files CSF etc.). Here are some questions to explore:

  1. If you only use the logfiles (no noise_rois), does the script run through?
  2. If you only use the noise_rois (no logfiles specified), does the script run through?
  3. Does your .nii file exactly have 344 volumes, as specified in the sqpar.Nscans?
  4. If not, or if (2) fails with a wrong number of volumes, you may have to specify the 344 volumes within the 4D nifti-file explicitly, e.g.,
matlabbatch{1}.spm.tools.physio.model.noise_rois.yes.fmri_files = {
'/Users/zhouandong/Desktop/800p/800_CNBT.nii,1'
'/Users/zhouandong/Desktop/800p/800_CNBT.nii,2'
...
'/Users/zhouandong/Desktop/800p/800_CNBT.nii,344'
}

You can use functions such as spm_select to create this array automatically.

I hope this helps!

All the best, Lars

Hi Lars,

after trying: physio.verbose.level = 1;

I succeed!!!!!

Thank u so much!

Best wishes, Andong