CONN BATCH batch functionality for connectivity toolbox
  
  Defines experiment information and/or run processing steps programmatically
  
  conn_batch syntax:
  
  1) conn_batch(BATCH);
     where BATCH is a structure (with fields defined in the section below)
     e.g. 
        clear BATCH;
        BATCH.Setup.RT=2;
        conn_batch(BATCH);
  
  2) conn_batch('fieldname1',fieldvalue1,'fieldname2',fieldvalue2,...) 
     where 'fieldname*' are individual BATCH structure fields
     e.g. 
        conn_batch('Setup.RT',2); 
  
  3) conn_batch(batchfilename)
     where batchfilename is a .mat file containing a batch structure
     or a .m file containing a Matlab script
     e.g.
        conn_batch('mybatchfile.mat');
 
  note1: in standalone releases use syntax (from system-prompt):
      conn batch batchfilename    : runs a batch file (.m or .mat)
      conn batch "matlabcommands" : runs one or several matlab commands 
  note2: syntax conn_batch({BATCH1 BATCH2 ...}) processes sequentially multiple batch structures (equivalent to conn_batch(BATCH1); conn_batch(BATCH2); ... e.g. useful when defining/running multiple first- or second- level analyses)
 
 _________________________________________________________________________________________________________________________________________________
  
  BATCH structure fields:
  
   filename          : conn_*.mat project file (defaults to currently open project)
   parallel          : Parallelization options (defaults to local procesing / no parallelization)
   subjects          : Subset of subjects to run processing steps or define parameters for (defaults to all subjects)
   Setup             : Information/processes regarding experiment Setup and Preprocessing
   Denoising         : Information/processes regarding Denoising step
   Analysis          : Information/processes regarding first-level analyses
   Results           : Information/processes regarding second-level analysis/results

  BATCH.parallel DEFINES PARALLELIZATION OPTIONS (applies to any Setup/Setup.preprocessing/Denoising/Analysis steps) %!
   parallel            
  
     N               : Number of parallel jobs; 0 to run locally ([0])
     profile         : (when parallel.N>0) Name of parallelization profile (defaults to profile marked as default in GUI.Tools.GridSettings) (the command "conn_jobmanager profiles" shows the list of available profiles, or use GUI Tools.GridSettings to add/edit profiles)

  BATCH.Setup DEFINES EXPERIMENT SETUP AND PERFORMS INITIAL DATA EXTRACTION AND/OR PREPROCESSING STEPS %!
   Setup               
  
     isnew           : 1/0 is this a new conn project [0]
     done            : 1/0: 0 defines fields only; 1 runs SETUP processing steps [0]
     overwrite       : (for done=1) 1/0 overwrites target files if they exist [1]
  
     nsubjects       : Number of subjects
     RT              : Repetition time (seconds) [2]
     acquisitiontype : 1/0: Continuous acquisition of functional volumes [1] 
  
     functionals     : functionals{nsub}{nses} char array of functional volume files (for voxel-level analyses; see roifunctionals below) 
     structurals     : structurals{nsub} char array of structural volume files 
                       OR structurals{nsub}{nses} char array of anatomical session-specific volume files 
     roifunctionals  : (for Setup.rois.roiextract>0) structure array identifying one or several additional functional datasets for ROI-level timeseries extraction (e.g. to specify the location of unsmoothed functional volumes, functional volumes coregistered to specific ROIs, etc.) (default roifunctionals.roiextract=2)
        roiextract            : Source of functional data: 1: same as 'Setup.functionals' field; 2: same as 'Setup.functionals' field after removing leading 's' from filename; 3: other (same as 'Setup.functionals' field but using alternative filename-change rule; see roiextract_rule below and help conn_rulebasedfilename); 4: other (explicitly specify the functional volume files; see roiextract_functionals below) [2] 
        roiextract_rule       : (for roiextract==3) regexprep(filename,roiextract_rule{2},roiextract_rule{3}) converts filenames in 'Setup.functionals' field to filenames that will be used when extracting BOLD signal ROI timeseries (if roiextract_rule{1}==2 filename is interpreted as a full path; if roiextract_rule{1}==1 filename is interpreted as only the file *name* -no file path, no file extension-)    
        roiextract_functionals: (for roiextract==4) roiextract_functionals{nsub}{nses} char array of functional volume files
  
     add             : 1/0; use 0 (default) to define the full set of subjects in your experiment; use 1 to define an additional set of subjects (to be added to any already-existing subjects in your project) [0]
                       When using add=1, the following fields are expected to contain the information for the new/added subjects *only*: Setup.functionals, Setup.structurals, Setup.roiextract_functionals, Setup.unwarp_functionals, Setup.spmfiles, Setup.masks.Grey/White/CSF, Setup.rois.files, Setup.conditions.onsets/durations, Setup.covariates.files
                       When using Setup.add=1 in combination with Setup.done, Setup.preprocessing, Denoising.done, and/or Analysis.done only the new/added subjects will be processed
                       When using Setup.add=1 the BATCH.subjects field is disregarded/overwritten to point to the new/added subjects only
                       Setup.add cannot be used in combination with any of the Setup.rois.add, Setup.conditions.add, or Setup.covariates.add options within the same batch structure
  
     masks
       Grey          : masks.Grey{nsub} char array of grey matter mask volume file [defaults to Grey mask extracted from structural volume] 
       White         : masks.White{nsub} char array of white matter mask volume file [defaults to White mask extracted from structural volume] 
       CSF           : masks.CSF{nsub} char array of CSF mask volume file [defaults to CSF mask extracted from structural volume] 
                     : each of these fields can also be defined as a double cell array for session-specific files (e.g. mask.Grey{nsub}{nses} grey matter file for subject nsub and session nses)
                     : each of these fields can also be defined as a structure with fields files/dimensions/etc. (same as 'Setup.rois' below).
     rois
       names         : rois.names{nroi} char array of ROI name [defaults to ROI filename]
       files         : rois.files{nroi}{nsub}{nses} char array of roi file (rois.files{nroi}{nsub} char array of roi file, to use the same roi for all sessions; or rois.files{nroi} char array of roi file, to use the same roi for all subjects)
       dimensions    : rois.dimensions{nroi} number of ROI dimensions - # temporal components to extract from ROI [1] (set to 1 to extract the average timeseries within ROI voxels; set to a number greater than 1 to extract additional PCA timeseries within ROI voxels; set to 0 to compute a weighted sum within ROI voxels (ROI mask values are interpreted as weights))
       multiplelabels: rois.multiplelabels(nroi) 1/0 to indicate roi file contains multiple labels/ROIs (default: set to 1 if there exist an associated .txt or .xls file with the same filename and in the same folder as the roi file)
       mask          : rois.mask(nroi) 1/0 to mask with grey matter voxels [0] 
       regresscovariates: rois.regresscovariates(nroi) 1/0 to regress known first-level covariates before computing PCA decomposition of BOLD signal within ROI [1 if dimensions>1; 0 otherwise] 
       roiextract    : rois.roiextract(nroi) index n to Setup.roifunctionals(n) identifying functional dataset coregistered to this ROI to extract BOLD timeseries from [1] (set to 0 to extract BOLD signal from Setup.functionals instead)
       add           : 1/0; use 0 (default) to define the full set of ROIs to be used in your analyses; use 1 to define an additional set of ROIs (to be added to any already-existing ROIs in your project) [0]
   
     conditions
       names         : conditions.names{ncondition} char array of condition name
       onsets        : conditions.onsets{ncondition}{nsub}{nses} vector of condition onsets (in seconds)
       durations     : conditions.durations{ncondition}{nsub}{nses} vector of condition durations (in seconds)
       param         : conditions.param(ncondition) temporal modulation (0 for no temporal modulation; positive index to first-level covariate for other temporal interactions) 
       filter        : conditions.filter{ncondition} temporal/frequency decomposition ([] for no decomposition; [low high] for fixed band-pass frequency filter; [N] for filter bank decompositoin with N frequency filters; [Duration Onsets] in seconds for sliding-window decomposition where Duration is a scalar and Onsets is a vector of two or more sliding-window onset values) 
       missingdata   : 1/0 Allow subjects with missing condition data (empty onset/duration fields in *all* of the sessions) [0] 
       add           : 1/0; use 0 (default) to define the full set of conditions to be used in your analyses; use 1 to define an additional set of conditions (to be added to any already-existing conditions in your project) [0]
 
     covariates
       names         : covariates.names{ncovariate} char array of covariate name
       files         : covariates.files{ncovariate}{nsub}{nses} char array of covariate file 
       add           : 1/0; use 0 (default) to define the full set of covariates to be used in your analyses; use 1 to define an additional set of covariates (to be added to any already-existing covariates in your project) [0]
   
     subjects
       effect_names  : subjects.effect_names{neffect} char array of second-level effect name
       effects       : subjects.effects{neffect} vector of size [nsubjects,1] defining second-level effects
   
     subjects
       group_names  : subjects.group_names{ngroup} char array of second-level group name
       groups       : subjects.group vector of size [nsubjects,1] (with values from 1 to ngroup) defining second-level groups
   
     analyses        : Vector of index to analysis types (1: ROI-to-ROI; 2: Seed-to-voxel; 3: Voxel-to-voxel; 4: Dynamic FC) Defaults to vector [1,2,3,4] (all analyses)
     voxelmask       : Analysis mask (voxel-level analyses): 1: Explicit mask (brainmask.nii); 2: Implicit mask (subject-specific) [1] 
     voxelmaskfile   : Explicit mask file (only when voxelmask=1) [fullfile(fileparts(which('spm')),'apriori','brainmask.nii')] 
     voxelresolution : Analysis space (voxel-level analyses): 1: Volume-based template (SPM; default 2mm isotropic or same as explicit mask if specified); 2: Same as structurals; 3: Same as functionals; 4: Surface-based template (Freesurfer) [1] 
     surfacesmoothing: (for voxelresolution=4) Smoothing level for surface-based analyses (number of discrete diffusion steps) [10]
     analysisunits   : BOLD signal units: 1: PSC units (percent signal change); 2: raw units [1] 
     outputfiles     : Optional output files (outputfiles(1): 1/0 creates confound beta-maps; outputfiles(2): 1/0 creates confound-corrected timeseries; outputfiles(3): 1/0 creates seed-to-voxel r-maps) ;outputfiles(4): 1/0 creates seed-to-voxel p-maps) ;outputfiles(5): 1/0 creates seed-to-voxel FDR-p-maps); outputfiles(6): 1/0 creates ROI-extraction REX files; [0,0,0,0,0,0] 
     spmfiles        : Optionally, spmfiles{nsub} is a char array pointing to the 'SPM.mat' source file to extract Setup information from for each subject (use alternatively spmfiles{nsub}{nses} for session-specific SPM.mat files) 
     spmfiles_options: (for Setup.spmfiles procedure) Cell array containing additional options to pass to conn_importspm when importing experiment info from spmfiles (see help conn_importspm)
     unwarp_functionals: (for Setup.preprocessing.steps=='realign&unwarp&phasemap') unwarp_functionals{nsub}{nses} char array of Phase Map volumes (vdm* file) 
     cwthreshold     : erosion options for WhiteMatter&CSF ROIs: cwthreshold(1): WhiteMatter threshold for noise aCompCor region; cwthreshold(2): WhiteMatter number of mask erosion steps; cwthreshold(3): CSF threshold for noise aCompCor region; cwthreshold(4): CSF number of mask erosion steps  ([.5 1 .5 1])

  BATCH.Setup.preprocessing PERFORMS DATA PREPROCESSING STEPS (realignment/slicetiming/coregistration/segmentation/normalization/smoothing) %!
     preprocessing     
       steps         : List of data preprocessing steps (cell array containing a subset of the following steps, in the desired order):
                       steps={'default_mni','default_mniphase','default_ss','default_ssphase',...    % (default pipelines: default_mni (direct normalization for volume-based analyses, to MNI space); default_mniphase (indirect normalization for volume-based analyses, to MNI space, when phase-maps are available); default_ss (for surface-based analyses, in subject-space); default_ssphase (for surface-based analyses, in subject-space, when phase-maps are available)  
                           'structural_manualorient','structural_segment','structural_normalize',... % (individual steps) 
                           'structural_segment&normalize','functional_removescans','functional_manualorient',...
                           'functional_slicetime','functional_realign','functional_realign&unwarp',...
                           'functional_realign&unwarp&phasemap','functional_art','functional_coregister',...
                           'functional_segment','functional_normalize','functional_segment&normalize','functional_smooth'};
                       If steps is left empty or unset a gui will prompt the user to specify the desired preprocessing pipeline 
                       note: 'default_mni' contains the steps: {'functional_realign&unwarp','functional_center','functional_slicetime','structural_center','structural_segment&normalize','functional_normalize','functional_art','functional_smooth'}
    
       voxelsize       : (normalization) target voxel size for resliced volumes (mm) [2]
       boundingbox     : (normalization) target bounding box for resliced volumes (mm) [-90,-126,-72;90,90,108] 
       fwhm            : (functional_smooth) Smoothing factor (mm) [8]
       coregtomean     : (functional_coregister/segment/normalize) 1: use mean volume (computed during realignment); 0: use first volume  
       applytofunctional: (structural_normalize) 1/0: apply structural-normalization transformation to functional volumes as well 
       sliceorder      : (functional_slicetime) acquisition order (vector of indexes; 1=first slice in image; note: use cell array for subject-specific vectors)
                        alternatively sliceorder may also be defined as one of the following strings: 'ascending','descending','interleaved (middle-top)','interleaved (bottom-up)','interleaved (top-down)','interleaved (Siemens)'  
                        alternatively sliceorder may also be defined as a vector containing the acquisition time in milliseconds for each slice (e.g. for multi-band sequences) 
       ta              : (functional_slicetime) acquisition time (TA) in seconds (used to determine slice times when sliceorder is defined by a vector of slice indexes; note: use vector for subject-specific values). Defaults to (1-1/nslices)*TR where nslices is the number of slices
       art_thresholds  : (functional_art) ART thresholds for identifying outlier scans 
                                             art_thresholds(1): threshold value for global-signal (z-value; default 5) 
                                             art_thresholds(2): threshold value for subject-motion (mm; default .9) 
                         additional options: art_thresholds(3): 1/0 global-signal threshold based on scan-to-scan changes in global-BOLD measure (default 1) 
                                             art_thresholds(4): 1/0 subject-motion threshold based on scan-to-scan changes in subject-motion measure (default 1) 
                                             art_thresholds(5): 1/0 subject-motion threhsold based on composite-movement measure (default 1) 
                                             art_thresholds(6): 1/0 force interactive mode (ART gui) (default 0) 
                                             art_thresholds(7): [only when art_threshold(5)=0] subject-motion threshold based on rotation measure 
                                             art_thresholds(8): N number of initial scans to be flagged for removal (default 0)
                             note: when art_threshold(5)=0, art_threshold(2) defines the threshold based on the translation measure, and art_threhsold(7) defines the threshold based on the rotation measure; otherwise art_threshold(2) defines the (single) threshold based on the composite-motion measure 
                             note: the default art_thresholds(1:2) [5 .9] values correspond to the "intermediate" (97th percentile) settings, to use the "conservative" (95th percentile) settings use [3 .5], to use the "liberal" (99th percentile) settings use [9 2] values instead
                             note: art needs subject-motion files to estimate possible outliers. If a 'realignment' first-level covariate exists it will load the subject-motion parameters from that first-level covariate; otherwise it will look for a rp_*.txt file (SPM format) in the same folder as the functional data
                                   subject-motion files can be in any of the following formats: a) *.txt file (SPM format; three translation parameters in mm followed by pitch/roll/yaw in radians); b) *.par (FSL format; three Euler angles in radians followed by translation parameters in mm); c) *.siemens.txt (Siemens MotionDetectionParameter.txt format); d) *.deg.txt (same as SPM format but rotations in degrees instead of radians)
       removescans     : (functional_removescans) number of initial scans to remove
       reorient        : (functional/structural_manualorient) 3x3 transformation matrix
       template_structural: (structural_normalize SPM8 only) anatomical template file for approximate coregistration [spm/template/T1.nii]
       template_functional: (functional_normalize SPM8 only) functional template file for normalization [spm/template/EPI.nii]
       tpm_template    : (structural_segment, structural_segment&normalize in SPM8, and any segment/normalize option in SPM12) tissue probability map [spm/tpm/TPM.nii]
       tpm_ngaus       : (structural_segment, structural_segment&normalize in SPM8&SPM12) number of gaussians for each tissue probability map

  BATCH.Denoising PERFORMS DENOISING STEPS (confound removal & filtering) %!
   Denoising       
  
     done            : 1/0: 0 defines fields only; 1 runs DENOISING processing steps [0]
     overwrite       : (for done=1) 1/0: overwrites target files if they exist [1]
     filter          : vector with two elements specifying band pass filter: low-frequency & high-frequency cutoffs (Hz)
     detrending      : 0/1/2/3: BOLD times-series polynomial detrending order (0: no detrending; 1: linear detrending; ... 3: cubic detrending) 
     despiking       : 0/1/2: temporal despiking with a hyperbolic tangent squashing function (1:before regression; 2:after regression) [0] 
     regbp           : 1/2: order of band-pass filtering step (1 = RegBP: regression followed by band-pass; 2 = Simult: simultaneous regression&band-pass) [1] 
     confounds       : Cell array of confound names (alternatively see 'confounds.names' below)
  
     confounds       : alternatively confounds can be a structure with fields
       names         : confounds.names{nconfound} char array of confound name (confound names can be: 'Grey Matter','White Matter','CSF',any ROI name, any covariate name, or 'Effect of *' where * represents any condition name])
       dimensions    : confounds.dimensions{nconfound} number of confound dimensions [defaults to using all dimensions available for each confound variable]
       deriv         : confounds.deriv{nconfound} include temporal derivatives up to n-th order of each effect (0 for raw timeseries, 1 for raw+firstderivative timeseries, etc.) [0]
       power         : confounds.power{nconfound} include powers up to n-th order of each effect (1 for linear effects, 2 for linear+quadratic effect, etc.) [1]
       filter        : (for regbp==1) confounds.filter{nconfound} band-pass filter confound regressors before entering in regression equation [0]

  BATCH.Analysis PERFORMS FIRST-LEVEL ANALYSES (ROI-to-ROI and seed-to-voxel) %!
   Analysis            
  
     done            : 1/0: 0 defines fields only; 1 runs ANALYSIS processing steps [0]
     overwrite       : (for done=1) 1/0: overwrites target files if they exist [1]
     analysis_number : sequential index identifying each set of independent analyses [1] 
                       (alternative a string identifying the analysis name)
     measure         : connectivity measure used, 1 = 'correlation (bivariate)', 2 = 'correlation (semipartial)', 3 = 'regression (bivariate)', 4 = 'regression (multivariate)'; [1] 
     weight          : within-condition weight, 1 = 'none', 2 = 'hrf', 3 = 'hanning'; [2] 
     modulation      : temporal modulation, 0 = standard weighted GLM analyses; 1 = gPPI analyses of condition-specific temporal modulation factor, or a string for PPI analyses of other temporal modulation factor (same for all conditions; valid strings are ROI names and 1st-level covariate names)'; [0] 
     conditions      : (for modulation==1 only) list of task condition names to be simultaneously entered in gPPI model (leave empty for default 'all existing conditions') [] 
     type            : analysis type, 1 = 'ROI-to-ROI', 2 = 'Seed-to-Voxel', 3 = 'all'; [3] 
     sources         : Cell array of sources names (seeds) (source names can be: any ROI name) (if this variable does not exist the toolbox will perform the analyses for all of the existing ROIs which are not defined as confounds in the Denoising step) 
  
     sources         : alternatively sources can be a structure with fields
       names         : sources.names{nsource} char array of source names (seeds)
       dimensions    : sources.dimensions{nsource} number of source dimensions [1]
       deriv         : sources.deriv{nsource} number of derivatives for each dimension [0]
       fbands        : sources.fbands{nsource} number of frequency bands for each dimension [1]

  BATCH.vvAnalysis PERFORMS FIRST-LEVEL ANALYSES (voxel-to-voxel) %!
   vvAnalysis            
 
     done            : 1/0: 0 defines fields only; 1 runs ANALYSIS processing steps [0]
     overwrite       : (for done=1) 1/0: overwrites target files if they exist [1]
     analysis_number : sequential index identifying each set of independent analyses [1] 
                       (alternative a string identifying the analysis name)
   
     measures        : voxel-to-voxel measure name (type 'conn_v2v measurenames' for a list of default measures) (if this variable does not exist the toolbox will perform the analyses for all of the default voxel-to-voxel measures) 
                            'group-PCA'             : Principal Component Analysis of BOLD timeseries
                            'group-ICA'             : Independent Component Analysis of BOLD timeseries
                            'IntrinsicConnectivity' : Intrinsic Connectivity Contrast (pICC0)
                            'LocalCorrelation'      : Integrated Local Correlation (ILC)     
                            'GlobalCorrelation'     : Integrated Global Correlation (IGC)   
                            'RadialCorrelation'     : Radial Correlation Contrast (RCC)
                            'RadialSimilarity       : Radial Similarity Contrast (RSC)
 
     measures        : alternatively voxel-to-voxel measures can be a structure with fields
       names         : measures.names voxel-to-voxel measure name (see 'conn_v2v measurenames' for a list of valid measure names)
       factors       : (for group-PCA, group-ICA, group-MVPA) number of group-level components to estimate
       kernelsupport : (for ILC, RCC) local support (FWHM mm) of smoothing kernel [8]
       norm          : (for ILC,ICC,RCC,RSC) 0/1 normalize values to z-scores [1]
       mask          : (for group-PCA, group-ICA, group-MVPA) optional mask for group-level component estimation (e.g. masked ICA)
       dimensions    : number of subject-level dimensions to retain (subject-level dimensionality reduction) [64]

  BATCH.dynAnalysis PERFORMS FIRST-LEVEL ANALYSES (dynamic connectivity) %!
   dynAnalysis            
 
     done            : 1/0: 0 defines fields only; 1 runs ANALYSIS processing steps [0]
     overwrite       : (for done=1) 1/0: overwrites target files if they exist [1]
     analysis_number : sequential index identifying each set of independent analyses [1] 
                       (alternative a string identifying the analysis name)
   
     sources         : Cell array of sources names (seeds) (source names can be: any ROI name) (if this variable does not exist the toolbox will perform the analyses for all of the existing ROIs which are not defined as confounds in the Denoising step) 
     factors         : Number of group-level dynamic components to estimate [20]
     window          : Length of temporal windows (FWHM in seconds) [30]

  BATCH.Results PERFORMS SECOND-LEVEL ANALYSES (ROI-to-ROI and Seed-to-Voxel analyses) %!
   Results             
  
     done            : 1/0: 0 defines fields only; 1 runs processing steps [0]
     overwrite       : (for done=1) 1/0: overwrites target files if they exist [1]
     analysis_number : sequential indexes identifying each set of independent analysis [1]
                       (alternative a string identifying the analysis name)
     foldername      : folder to store the results
     display         : 1/0 display results [1]
  
     between_subjects
       effect_names  : cell array of second-level effect names
       contrast      : contrast vector (same size as effect_names)
   
     between_conditions [defaults to multiple analyses, one per condition]
       effect_names  : cell array of condition names (as in Setup.conditions.names)
       contrast      : contrast vector (same size as effect_names)
   
     between_sources    [defaults to multiple analyses, one per source]
       effect_names  : cell array of source names (as in Analysis.regressors, typically appended with _1_1; generally they are appended with _N_M -where N is an index ranging from 1 to 1+derivative order, and M is an index ranging from 1 to the number of dimensions specified for each ROI; for example ROINAME_2_3 corresponds to the first derivative of the third PCA component extracted from the roi ROINAME) 
       contrast      : contrast vector (same size as effect_names)

  BATCH.vvResults PERFORMS SECOND-LEVEL ANALYSES (Voxel-to-Voxel analyses) %!
   vvResults             
  
     done            : 1/0: 0 defines fields only; 1 performs processing steps [0]
     overwrite       : (for done=1) 1/0: overwrites target files if they exist [1]
     analysis_number : sequential indexes identifying each set of independent analysis [1]
                       (alternative a string identifying the analysis name)
     foldername      : folder to store the results
     display         : 1/0 display results [1]
   
     between_subjects
       effect_names  : cell array of second-level effect names
       contrast      : contrast vector (same size as effect_names)
   
     between_conditions [defaults to multiple analyses, one per condition]
       effect_names  : cell array of condition names (as in Setup.conditions.names)
       contrast      : contrast vector (same size as effect_names)
   
     between_measures [defaults to multiple analyses, one per measure]
       effect_names  : cell array of measure names (as in Analysis.measures) 
       contrast      : contrast vector (same size as effect_names)
   
 _________________________________________________________________________________________________________________________________________________
  
  See 
    conn_batch_workshop_nyu.m 
    conn_batch_workshop_nyu_parallel.m 
    conn_batch_humanconnectomeproject.m 
  for additional information and examples of use.