Contents

About the CANlab Core Tools repository and CANlab toolboxes

% The CANlab Core Tools repository is on https://github.com/canlab/CanlabCore
% It contains core tools for MRI/fMRI/PET analysis from the Cognitive and
% Affective Neuorscience Lab (Tor Wager, PI) and our collaborators. Many of
% these functions are needed to run other toolboxes, e.g., the CAN lab?s
% multilevel mediation and Martin Lindquist?s hemodynamic response estimation
% toolboxes.

% The tools include object-oriented tools for doing neuroimaging analysis with
% simple commands and scripts that provide high-level functionality for
% neuroimaging analysis. For example, there is an "fmri_data" object type
% that contains neuroimaging datasets (both PET and fMRI data are ok, despite
% the name). If you have created and object called my_fmri_data_obj, then
% plot(my_fmri_data_obj) will generate a series of plots specific to neuroimaging
% data, including an interactive brain viewer (courtesy of SPM software).
% predict(my_fmri_data_obj) will perform cross-validated multivariate prediction
% of outcomes based on brain data. ica(my_fmri_data_obj) will perform independent
% components analysis on the data, and so forth.

Dependencies:

% Matlab statistics toolbox
% Matlab signal processing toolbox
% Statistical Parametric Mapping (SPM) software https://www.fil.ion.ucl.ac.uk/spm/

% For full functionality, the other toolboxes below are recommended:

Available Toolboxes:

% CANlab Core Tools                             https://github.com/canlab/CanlabCore
% CANlab Neuroimaging_Pattern_Masks repository  https://github.com/canlab/Neuroimaging_Pattern_Masks
% CANlab_help_examples                          https://github.com/canlab/CANlab_help_examples
% M3 Multilevel mediation toolbox               https://github.com/canlab/MediationToolbox
% CANlab robust regression toolbox              https://github.com/canlab/RobustToolbox
% MKDA coordinate-based meta-analysis toolbox   https://github.com/canlab/Canlab_MKDA_MetaAnalysis

% and also:
% Paradigms_Public - experimental paradigms     https://github.com/canlab/Paradigms_Public
% FMRI_simulations - brain movies, effect size/power https://github.com/canlab/FMRI_simulations
% CANlab_data_public - Published datasets       https://github.com/canlab/CANlab_data_public
% DCC - Martin Lindquist's dynamic correlation tbx  https://github.com/canlab/Lindquist_Dynamic_Correlation
% CanlabScripts - in-lab Matlab/python/bash     https://github.com/canlab/CanlabScripts

Quick start instructions

% Before you start, the CANlab_Core_Tools must be added to your path with
% subfolders. Otherwise, you will get errors.
%
% The script canlab_toolbox_setup can help download and install the
% toolboxes you need.

% First, go to a folder where you want to install
% toolboxes/repositories on your hard drive. Mine are in "Github" and I've
% already installed CanlabCore, so let's find it and go there:

% Locate the CanlabCore Github files on your local computer:
% ------------------------------------------------------------------------

mypath = what(fullfile('CanlabCore', 'CanlabCore'));

% Check if we've got it
if isempty(mypath)
    disp('Download CanlabCore from Github, and go to that folder in Matlab')
    disp('by dragging and dropping it from Finder or Explorer into the Matlab Command Window')
    return
end

mypath = mypath(1).path;

% Set the folder in which the repositories will be installed
% ------------------------------------------------------------------------

% This is the location (folder) in which the repositories will be installed:
base_dir_for_repositories = fileparts(fileparts(mypath));

cd(base_dir_for_repositories)
fprintf('\nInstalling repositories in %s\n', base_dir_for_repositories);

% Find the setup file, canlab_toolbox_setup.m
% ------------------------------------------------------------------------

% This is the file
setupfile = fullfile(mypath, 'canlab_toolbox_setup.m');

% Make sure we've got it
if ~exist(setupfile, 'file')
    disp('Something went wrong.  I can''t find canlab_toolbox_setup.m');
    disp('This file should be included in the CanlabCore Github repository.')
end

% Run the setup script:
% ------------------------------------------------------------------------

canlab_toolbox_setup

% This will attempt to locate toolboxes, add them to your path, and give
% you the option to download them from Github if it can't find them.

% It looks for and installs toolboxes in the current directory,
% which (thanks to the code above) is the path name in base_dir_for_repositories
Installing repositories in /Users/torwager/Documents/GitHub

-----------------------------------------
Checking and/or installing CANlab tools in:
/Users/torwager/Documents/GitHub
-----------------------------------------
Looking for CANlab repositories and adding to Matlab path:
 
CANlab core tools - Object-oriented interactive analysis and tools used in other functions	CanlabCore
CANlab help examples - Example scripts and html output, second-level analysis batch scripts	CANlab_help_examples
MKDA meta-analysis toolbox - Coordinate-based meta-analysis of neuroimaging data	Canlab_MKDA_MetaAnalysis
FMRI_simulations - Misc tools for simulating and testing power and image data	FMRI_simulations
Private masks and signatures - Selected models shared on request	MasksPrivate
M3 Mediation toolbox - Single and Multi-level mediation tools	MediationToolbox
Neuroimaging_Pattern_Masks - meta-analysis masks, signatures, parcellations	Neuroimaging_Pattern_Masks
Robust regression toolbox - Voxel-wise robust regression for neuroimaging data	RobustToolbox
CanlabPrivate - Private repository for lab members and collaborators	CanlabPrivate

-----------------------------------------

-----------------------------------------

Repository: CANlab core tools - Object-oriented interactive analysis and tools used in other functions
Site:CanlabCore
Finding repo: Running command:
find /Users/torwager/Documents/GitHub/CanlabCore -name "fmri_data.m"
Found and added to path with subfolders: /Users/torwager/Documents/GitHub/CanlabCore

-----------------------------------------

Repository: CANlab help examples - Example scripts and html output, second-level analysis batch scripts
Site:CANlab_help_examples
Finding repo: Running command:
find /Users/torwager/Documents/GitHub/CANlab_help_examples -name "a2_second_level_toolbox_check_dependencies.m"
Found and added to path with subfolders: /Users/torwager/Documents/GitHub/CANlab_help_examples

-----------------------------------------

Repository: MKDA meta-analysis toolbox - Coordinate-based meta-analysis of neuroimaging data
Site:Canlab_MKDA_MetaAnalysis
Finding repo: Running command:
find /Users/torwager/Documents/GitHub/Canlab_MKDA_MetaAnalysis -name "i_density.m"
Found and added to path with subfolders: /Users/torwager/Documents/GitHub/Canlab_MKDA_MetaAnalysis

-----------------------------------------

Repository: FMRI_simulations - Misc tools for simulating and testing power and image data
Site:FMRI_simulations
Finding repo: Running command:
find /Users/torwager/Documents/GitHub/FMRI_simulations -name "power_figure3_num_comparisons.m"
Found and added to path with subfolders: /Users/torwager/Documents/GitHub/FMRI_simulations

-----------------------------------------

Repository: Private masks and signatures - Selected models shared on request
Site:MasksPrivate
Finding repo: Running command:
find /Users/torwager/Documents/GitHub/MasksPrivate -name "apply_nps.m"
Found and added to path with subfolders: /Users/torwager/Documents/GitHub/MasksPrivate

-----------------------------------------

Repository: M3 Mediation toolbox - Single and Multi-level mediation tools
Site:MediationToolbox
Finding repo: Running command:
find /Users/torwager/Documents/GitHub/MediationToolbox -name "mediation_brain.m"
Warning: Function vecnorm has the same name as a MATLAB builtin. We
suggest you rename the function to avoid a potential name conflict. 
Found and added to path with subfolders: /Users/torwager/Documents/GitHub/MediationToolbox

-----------------------------------------

Repository: Neuroimaging_Pattern_Masks - meta-analysis masks, signatures, parcellations
Site:Neuroimaging_Pattern_Masks
Finding repo: Running command:
find /Users/torwager/Documents/GitHub/Neuroimaging_Pattern_Masks -name "apply_all_signatures.m"
Found and added to path with subfolders: /Users/torwager/Documents/GitHub/Neuroimaging_Pattern_Masks

-----------------------------------------

Repository: Robust regression toolbox - Voxel-wise robust regression for neuroimaging data
Site:RobustToolbox
Finding repo: Running command:
find /Users/torwager/Documents/GitHub/RobustToolbox -name "robust_results_batch.m"
Found and added to path with subfolders: /Users/torwager/Documents/GitHub/RobustToolbox

-----------------------------------------

Repository: CanlabPrivate - Private repository for lab members and collaborators
Site:CanlabPrivate
Finding repo: Running command:
find /Users/torwager/Documents/GitHub/CanlabPrivate -name "power_calc.m"
Found and added to path with subfolders: /Users/torwager/Documents/GitHub/CanlabPrivate

-----------------------------------------

All CANlab repositories previously installed. Saving path