help > Error when importing fmriprep output to CONN toolbox
Showing 1-4 of 4 posts
Display:
Results per page:
Jun 10, 2021  03:06 PM | Meishan AI
Error when importing fmriprep output to CONN toolbox
I have fmriprep output for a single subject:

/anat/
./anat:
sub-06_desc-aparcaseg_dseg.nii.gz
sub-06_desc-aseg_dseg.nii.gz
sub-06_desc-brain_mask.json
sub-06_desc-brain_mask.nii.gz
sub-06_desc-preproc_T1w.json
sub-06_desc-preproc_T1w.nii.gz
sub-06_dseg.nii.gz
sub-06_from-fsnative_to-T1w_mode-image_xfm.txt
sub-06_from-MNI152NLin2009cAsym_to-T1w_mode-image_xfm.h5
sub-06_from-T1w_to-fsnative_mode-image_xfm.txt
sub-06_from-T1w_to-MNI152NLin2009cAsym_mode-image_xfm.h5
sub-06_hemi-L_inflated.surf.gii
sub-06_hemi-L_midthickness.surf.gii
sub-06_hemi-L_pial.surf.gii
sub-06_hemi-L_smoothwm.surf.gii
sub-06_hemi-R_inflated.surf.gii
sub-06_hemi-R_midthickness.surf.gii
sub-06_hemi-R_pial.surf.gii
sub-06_hemi-R_smoothwm.surf.gii
sub-06_label-CSF_probseg.nii.gz
sub-06_label-GM_probseg.nii.gz
sub-06_label-WM_probseg.nii.gz
sub-06_space-MNI152NLin2009cAsym_desc-brain_mask.json
sub-06_space-MNI152NLin2009cAsym_desc-brain_mask.nii.gz
sub-06_space-MNI152NLin2009cAsym_desc-preproc_T1w.json
sub-06_space-MNI152NLin2009cAsym_desc-preproc_T1w.nii.gz
sub-06_space-MNI152NLin2009cAsym_dseg.nii.gz
sub-06_space-MNI152NLin2009cAsym_label-CSF_probseg.nii.gz
sub-06_space-MNI152NLin2009cAsym_label-GM_probseg.nii.gz
sub-06_space-MNI152NLin2009cAsym_label-WM_probseg.nii.gz

ses-pre/
func/
sub-06_ses-pre_task-rest_desc-confounds_regressors.json
sub-06_ses-pre_task-rest_desc-confounds_regressors.tsv
sub-06_ses-pre_task-rest_space-fsaverage5_hemi-L.func.gii
sub-06_ses-pre_task-rest_space-fsaverage5_hemi-R.func.gii
sub-06_ses-pre_task-rest_space-fsnative_hemi-L.func.gii
sub-06_ses-pre_task-rest_space-fsnative_hemi-R.func.gii
sub-06_ses-pre_task-rest_space-MNI152NLin2009cAsym_res-2_boldref.nii.gz
sub-06_ses-pre_task-rest_space-MNI152NLin2009cAsym_res-2_desc-aparcaseg_dseg.nii.gz
sub-06_ses-pre_task-rest_space-MNI152NLin2009cAsym_res-2_desc-aseg_dseg.nii.gz
sub-06_ses-pre_task-rest_space-MNI152NLin2009cAsym_res-2_desc-brain_mask.json
sub-06_ses-pre_task-rest_space-MNI152NLin2009cAsym_res-2_desc-brain_mask.nii.gz
sub-06_ses-pre_task-rest_space-MNI152NLin2009cAsym_res-2_desc-preproc_bold.json
sub-06_ses-pre_task-rest_space-MNI152NLin2009cAsym_res-2_desc-preproc_bold.nii
sub-06_ses-pre_task-rest_space-T1w_boldref.nii.gz
sub-06_ses-pre_task-rest_space-T1w_desc-aparcaseg_dseg.nii.gz
sub-06_ses-pre_task-rest_space-T1w_desc-aseg_dseg.nii.gz
sub-06_ses-pre_task-rest_space-T1w_desc-brain_mask.json
sub-06_ses-pre_task-rest_space-T1w_desc-brain_mask.nii.gz
sub-06_ses-pre_task-rest_space-T1w_desc-preproc_bold.json
sub-06_ses-pre_task-rest_space-T1w_desc-preproc_bold.nii.gz


When I was trying to import this output into CONN, it gave me this error:

unzipping gz files...Importing data... please wait
unzipping gz files...ERROR DESCRIPTION:

Undefined function 'gunzip' for input arguments of type 'cell'.
Error in conn_gz2nii (line 17)
filename(redo)=gunzip(filename(redo));
Error in conn_getinfo (line 13)
filename=conn_gz2nii(filename);
Error in conn_file (line 11)
[nV,str,icon,filename]=conn_getinfo(filename,doconvert);
Error in conn_set_functional (line 8)
[CONN_x.Setup.functional{nsub}{nses},nV]=conn_file(out);
Error in conn_importvol2bids (line 294)
nV=conn_set_functional(nsub(end),nses(end),nset,out); % note: when nsubs = [nsubs1 nsubs2] or nses = [nses1 nses2] file_bids(nsub1,nses1) is assigned to nsub2,nses2 (in order to allow subject- and session- independent data)
Error in conn_importbids (line 59)
[nill,nill,nV]=conn_importvol2bids(filename{n2},nsub,nses,'func',[],[],[],[],[],true);
Error in conn (line 5895)
if bids_dofunc, [ok,err]=conn_importbids(info.dataset_select.func.data.file,'type','functional','subjects',nsubs,'subjects_id',bids_subj_id,'nset',nset,'localcopy',localcopy,'copytoderiv',copytoderiv); ERR=[ERR err]; end
CONN20.c
SPM12 + DAiSS DEM FieldMap MEEGtools suit
Matlab v.2020b
project: CONN20.c
storage: 22388.4Gb available
spm @ /home/ai.me/spm12
conn @ /work/cbhlab/software/conn

It seems that there are something wrong with the unzipping...I unzipped the files manually but it still gave me the same error. Does anyone have insignt on this issue? Thanks so much!
Jun 11, 2021  10:06 PM | Alfonso Nieto-Castanon - Boston University
RE: Error when importing fmriprep output to CONN toolbox
Hi,

That is strange, as gunzip is a function that is part of Matlab base functions so it should always be accessible. Perhaps this may indicate some problem with your Matlab installation so I would perhaps suggest to try restoring the default Matlab paths using something like the following in Matlab command line:

   restoredefaultpath
   addpath /home/ai.me/spm12
   addpath /work/cbhlab/software/conn
   savepath

and then try starting CONN and importing your data again to see if that helps

Best
Alfonso

  
Originally posted by Meishan AI:
I have fmriprep output for a single subject:

/anat/
./anat:
sub-06_desc-aparcaseg_dseg.nii.gz
sub-06_desc-aseg_dseg.nii.gz
sub-06_desc-brain_mask.json
sub-06_desc-brain_mask.nii.gz
sub-06_desc-preproc_T1w.json
sub-06_desc-preproc_T1w.nii.gz
sub-06_dseg.nii.gz
sub-06_from-fsnative_to-T1w_mode-image_xfm.txt
sub-06_from-MNI152NLin2009cAsym_to-T1w_mode-image_xfm.h5
sub-06_from-T1w_to-fsnative_mode-image_xfm.txt
sub-06_from-T1w_to-MNI152NLin2009cAsym_mode-image_xfm.h5
sub-06_hemi-L_inflated.surf.gii
sub-06_hemi-L_midthickness.surf.gii
sub-06_hemi-L_pial.surf.gii
sub-06_hemi-L_smoothwm.surf.gii
sub-06_hemi-R_inflated.surf.gii
sub-06_hemi-R_midthickness.surf.gii
sub-06_hemi-R_pial.surf.gii
sub-06_hemi-R_smoothwm.surf.gii
sub-06_label-CSF_probseg.nii.gz
sub-06_label-GM_probseg.nii.gz
sub-06_label-WM_probseg.nii.gz
sub-06_space-MNI152NLin2009cAsym_desc-brain_mask.json
sub-06_space-MNI152NLin2009cAsym_desc-brain_mask.nii.gz
sub-06_space-MNI152NLin2009cAsym_desc-preproc_T1w.json
sub-06_space-MNI152NLin2009cAsym_desc-preproc_T1w.nii.gz
sub-06_space-MNI152NLin2009cAsym_dseg.nii.gz
sub-06_space-MNI152NLin2009cAsym_label-CSF_probseg.nii.gz
sub-06_space-MNI152NLin2009cAsym_label-GM_probseg.nii.gz
sub-06_space-MNI152NLin2009cAsym_label-WM_probseg.nii.gz

ses-pre/
func/
sub-06_ses-pre_task-rest_desc-confounds_regressors.json
sub-06_ses-pre_task-rest_desc-confounds_regressors.tsv
sub-06_ses-pre_task-rest_space-fsaverage5_hemi-L.func.gii
sub-06_ses-pre_task-rest_space-fsaverage5_hemi-R.func.gii
sub-06_ses-pre_task-rest_space-fsnative_hemi-L.func.gii
sub-06_ses-pre_task-rest_space-fsnative_hemi-R.func.gii
sub-06_ses-pre_task-rest_space-MNI152NLin2009cAsym_res-2_boldref.nii.gz
sub-06_ses-pre_task-rest_space-MNI152NLin2009cAsym_res-2_desc-aparcaseg_dseg.nii.gz
sub-06_ses-pre_task-rest_space-MNI152NLin2009cAsym_res-2_desc-aseg_dseg.nii.gz
sub-06_ses-pre_task-rest_space-MNI152NLin2009cAsym_res-2_desc-brain_mask.json
sub-06_ses-pre_task-rest_space-MNI152NLin2009cAsym_res-2_desc-brain_mask.nii.gz
sub-06_ses-pre_task-rest_space-MNI152NLin2009cAsym_res-2_desc-preproc_bold.json
sub-06_ses-pre_task-rest_space-MNI152NLin2009cAsym_res-2_desc-preproc_bold.nii
sub-06_ses-pre_task-rest_space-T1w_boldref.nii.gz
sub-06_ses-pre_task-rest_space-T1w_desc-aparcaseg_dseg.nii.gz
sub-06_ses-pre_task-rest_space-T1w_desc-aseg_dseg.nii.gz
sub-06_ses-pre_task-rest_space-T1w_desc-brain_mask.json
sub-06_ses-pre_task-rest_space-T1w_desc-brain_mask.nii.gz
sub-06_ses-pre_task-rest_space-T1w_desc-preproc_bold.json
sub-06_ses-pre_task-rest_space-T1w_desc-preproc_bold.nii.gz


When I was trying to import this output into CONN, it gave me this error:

unzipping gz files...Importing data... please wait
unzipping gz files...ERROR DESCRIPTION:

Undefined function 'gunzip' for input arguments of type 'cell'.
Error in conn_gz2nii (line 17)
filename(redo)=gunzip(filename(redo));
Error in conn_getinfo (line 13)
filename=conn_gz2nii(filename);
Error in conn_file (line 11)
[nV,str,icon,filename]=conn_getinfo(filename,doconvert);
Error in conn_set_functional (line 8)
[CONN_x.Setup.functional{nsub}{nses},nV]=conn_file(out);
Error in conn_importvol2bids (line 294)
nV=conn_set_functional(nsub(end),nses(end),nset,out); % note: when nsubs = [nsubs1 nsubs2] or nses = [nses1 nses2] file_bids(nsub1,nses1) is assigned to nsub2,nses2 (in order to allow subject- and session- independent data)
Error in conn_importbids (line 59)
[nill,nill,nV]=conn_importvol2bids(filename{n2},nsub,nses,'func',[],[],[],[],[],true);
Error in conn (line 5895)
if bids_dofunc, [ok,err]=conn_importbids(info.dataset_select.func.data.file,'type','functional','subjects',nsubs,'subjects_id',bids_subj_id,'nset',nset,'localcopy',localcopy,'copytoderiv',copytoderiv); ERR=[ERR err]; end
CONN20.c
SPM12 + DAiSS DEM FieldMap MEEGtools suit
Matlab v.2020b
project: CONN20.c
storage: 22388.4Gb available
spm @ /home/ai.me/spm12
conn @ /work/cbhlab/software/conn

It seems that there are something wrong with the unzipping...I unzipped the files manually but it still gave me the same error. Does anyone have insignt on this issue? Thanks so much!
Jun 13, 2021  07:06 PM | Meishan AI
RE: Error when importing fmriprep output to CONN toolbox
Dear Alfonso,

I just tried and I can import without error this time! Thank you so much for helping.

Best,
Meishan
Jun 30, 2021  08:06 PM | Meishan AI
RE: Error when importing fmriprep output to CONN toolbox
Dear Alfonso,

This is a follow-up question about this case. I was trying to import another BIDs format dataset, and it still gave me the exact same error.

I followed your way to restore the path and then add back the paths, but it didn't work this time. The error still came up.

Is there any other possiblity to fix this? The version of MATLAB and CONN toolbox are the same as I posted for the former question.

Thank you!
Meishan