CONN module help
conn_module
provides access to independent CONN modules conn_module(module_name, ...) runs individual CONN's module "module_name" on user-defined data conn_module
Current module names: PREPROCESSING, GLM
PREPROCESSING : runs CONN preprocessing pipeline on user-defined data
Basic syntax
conn_module preprocessing; Advanced syntax:
conn_module('preprocessing', fieldname1, fieldvalue1 , fieldname2, fieldvalue2, ...)
Input data is specified with field name/value pairs as defined in Setup conn_batch documentation Preprocessing options are specified with field name/value pairs as defined in Setup.preprocessing conn_batch documentation (all Setup.preprocessing fields are available to conn_module)
functionals : list of functional data files for each subject and session { { Sub1Ses1, Sub1Ses2, ...}, {Sub2Ses1, Sub2Ses2, ...}, ...}
structurals : list of structural data files { Sub1, Sub2, ...}
steps : list of preprocessing steps (tpye "conn_module preprocessing steps" for a list of valid preprocessing step names)
See "doc conn_batch" for a complete list of all preprocessing options See Nieto-Castanon, 2020 for details about these preprocessing steps and pipelines (www.conn-toolbox.org/fmri-methods)
Alternative syntax:
conn_module('preprocessing',optionsfile)
Input data and preprocessing options defined in .cfg (see conn_loadcfgfile/conn_savecfgfile) or .json (see spm_jsonread/spm_jsonwrite) structure text file Alternative syntax:
conn_module preprocessing steps
Returns full list of valid preprocessing steps
conn_module('preprocessing',optionsfile)
Input data and preprocessing options defined in .cfg (see conn_loadcfgfile/conn_savecfgfile) or .json (see spm_jsonread/spm_jsonwrite) structure text file Alternative syntax:
conn_module preprocessing steps
Returns full list of valid preprocessing steps
Example #1: to run user-selected preprocessing pipeline or steps on the specified functional/structural data
conn_module( 'preprocessing' , ... 'functionals', {{ '/data/func.nii' }} , ... 'structurals', { '/data/anat.nii' } , ... 'steps', '' );
Example #2: to run CONN's default minimal preprocessing pipeline on the specified functional/structural data (modify/add parameters below according to your data)
conn_module( 'preprocessing',... 'functionals', {{ '/data/func.nii' }},... 'structurals', { '/data/anat.nii' },... 'steps', 'default_mni',... 'RT', 2,... 'sliceorder',' interleaved (Siemens)');
Example #3: to run CONN's default minimal preprocessing pipeline + default denoising pipeline on the specified functional/structural data (modify/add parameters below according to your data)
conn_module( 'preprocessing', ... 'functionals', {{ '/data/func.nii' }}, ... 'structurals', { '/data/anat.nii' }, ... 'steps', {'default_mni', 'functional_regression', 'functional_bandpass'}, ... 'reg_names', {'realignment', 'scrubbing', 'White Matter', 'CSF'}, ... 'reg_dimensions', [inf, inf, 5, 5], ... 'reg_deriv', [1, 0, 0, 0], ... 'bp_filter', [0.008 inf] )
conn_module( 'preprocessing' , ... 'functionals', {{ '/data/func.nii' }} , ... 'structurals', { '/data/anat.nii' } , ... 'steps', '' );
Example #2: to run CONN's default minimal preprocessing pipeline on the specified functional/structural data (modify/add parameters below according to your data)
conn_module( 'preprocessing',... 'functionals', {{ '/data/func.nii' }},... 'structurals', { '/data/anat.nii' },... 'steps', 'default_mni',... 'RT', 2,... 'sliceorder',' interleaved (Siemens)');
Example #3: to run CONN's default minimal preprocessing pipeline + default denoising pipeline on the specified functional/structural data (modify/add parameters below according to your data)
conn_module( 'preprocessing', ... 'functionals', {{ '/data/func.nii' }}, ... 'structurals', { '/data/anat.nii' }, ... 'steps', {'default_mni', 'functional_regression', 'functional_bandpass'}, ... 'reg_names', {'realignment', 'scrubbing', 'White Matter', 'CSF'}, ... 'reg_dimensions', [inf, inf, 5, 5], ... 'reg_deriv', [1, 0, 0, 0], ... 'bp_filter', [0.008 inf] )
see also: CONN_BATCH
GLM : runs CONN second-level analyses on user-defined data
Basic syntax:
conn_module glm;
Advanced syntax:
conn_module('glm', fieldname1, fieldvalue1, fieldname2, fieldvalue2, ...)
with the following field name/value pairs:
data : list of NIFTI files entered into second-level analysis (Nsubjects x Nmeasures) defining one or multiple outcome / dependent measures note: when entering multiple files per subject (e.g. repeated measures) enter first all files (one per subject) for measure#1, followed by all files for measure#2, etc. note: nifti files may contani 3d volume-level data, fsaverage surface-level data, or ROI-to-ROI data (see conn_surf_write and conn_mtx_write to create surface/matrix nifti files) alternatively list of SPM.mat files containing first-level analyses (Nsubjects x 1, or Nsubjects x Nmeasures) alternatively list of folder names containing SPM.mat first-level analyses (Nsubjects x 1, or Nsubjects x Nmeasures)
design_matrix : design matrix (Nsubjects x Neffects) defining different explanatory / independent measures or subject-effects enter one row for each subject each row should contain one value/number per modeled effect/covariate
contrast_between: between-subjects contrast vector/matrix (Nc1 x Neffects)
contrast_within : within-subjects contrast vector/matrix (Nc2 x Nmeasures)
contrast_names : (optional, only when entering SPM.mat files in #data field) list of contrast names to select from first-level analysis files (Nmeasures x 1)
data_labels : (optional) labels of columns of data matrix
design_labels : (optional) labels of columns of design matrix
mask : (optional) analysis mask file
analysistype : (optional) analysis type 1: include both parametric and non-parametric stats; 2: include only parametric stats; 3: include only non-parametric stats
design : (optional, for back-compatibility) transpose of design_matrix (Neffects x Nsubjects); enter one row for each modeled effect (across subjects); each row should contain one value/number per subject
folder : (optional) folder where analysis are stored; default current folder
Alternative syntax:
conn_module('glm',optionsfile)
input data and GLM options defined in .cfg (see conn_loadcfgfile/conn_savecfgfile) or .json (see spm_jsonread/spm_jsonwrite) structure text file Alternative syntax:
spmfolder=conn_module('glm',...)
skips results display step (only computes second-level analysis, and returns folder where results are stored) use conn_display(spmfolder) syntax to then launch the results explorer window on previously computed analyses
See also "doc conn_display" for displaying GLM results See Nieto-Castanon, 2020 for details about General Linear Model analyses (www.conn-toolbox.org/fmri-methods)
Example #1: performs user-defined second-level analysis
conn_module glm;
Example #2: performs a one-sample t-test and stores the analysis results in the current folder
conn_module('glm', ... 'design_matrix',[1; 1; 1; 1] ,... 'data',{'subject1.img'; 'subject2.img'; 'subject3.img'; 'subject4.img'} );
Example #3: performs a two-sample t-test and stores the analysis results in the current folder
conn_module('glm', ... 'design_matrix',[1 0; 1 0; 0 1; 0 1; 0 1],... 'data', {'subject1_group1.img'; 'subject2_group1.img'; 'subject1_group2.img'; 'subject2_group2.img'; 'subject3_group2.img'},... 'contrast_between',[1 -1]);
Example #4: performs a paired t-test and stores the analysis results in the current folder
conn_module('glm', ... 'design_matrix', [1; 1; 1; 1],... 'data', {'subject1_time1.img', subject1_time2.img'; 'subject2_time1.img', subject2_time2.img'; 'subject3_time1.img', subject3_time2.img'; 'subject4_time1.img', subject4_time2.img'},... 'contrast_beetween',1,... 'contrast_within',[1 -1]);
conn_module glm;
Example #2: performs a one-sample t-test and stores the analysis results in the current folder
conn_module('glm', ... 'design_matrix',[1; 1; 1; 1] ,... 'data',{'subject1.img'; 'subject2.img'; 'subject3.img'; 'subject4.img'} );
Example #3: performs a two-sample t-test and stores the analysis results in the current folder
conn_module('glm', ... 'design_matrix',[1 0; 1 0; 0 1; 0 1; 0 1],... 'data', {'subject1_group1.img'; 'subject2_group1.img'; 'subject1_group2.img'; 'subject2_group2.img'; 'subject3_group2.img'},... 'contrast_between',[1 -1]);
Example #4: performs a paired t-test and stores the analysis results in the current folder
conn_module('glm', ... 'design_matrix', [1; 1; 1; 1],... 'data', {'subject1_time1.img', subject1_time2.img'; 'subject2_time1.img', subject2_time2.img'; 'subject3_time1.img', subject3_time2.img'; 'subject4_time1.img', subject4_time2.img'},... 'contrast_beetween',1,... 'contrast_within',[1 -1]);
Additional functionality: conn_module('get', 'structurals'); outputs current structural files (e.g. output of structural preprocessing steps) conn_module('get', 'functionals'); outputs current functional files (e.g. output of functional preprocessing steps) conn_module('get', 'l1covariates'); outputs first-level covariate files (e.g. other potential outputs of functional preprocessing) conn_module('get', 'l1covariates',covname); outputs covname first-level covariate files (e.g. other potential outputs of functional preprocessing) conn_module('get', 'l2covariates'); outputs second-level covariate files (e.g. other potential outputs of functional preprocessing) conn_module('get', 'l2covariates',covname); outputs covname second-level covariate files (e.g. other potential outputs of functional preprocessing) conn_module('get', 'masks'); outputs Grey Matter/White Matter/CSF files (e.g. other potential outputs of functional preprocessing) conn_module('get', 'masks',roiname); outputs roiname files (e.g. other potential outputs of functional preprocessing)
see also: CONN DISPLAY