[
  
  
    
  
    
  
    
    {
      "title"   : "Page not found",
      "excerpt" : "The page you were looking for doesn't exist.",
      "category": "",
      "tags"    : "",
      "url"     : "/404.html",
      "content" : "The page you tried to reach doesn’t exist on this site. A few things you can try: Use the search page — type a keyword from the URL or topic. Browse the walkthroughs index. Start over at the home page.If you arrived here from a link inside this site, please open an issue so we can fix it."
    },
    
  
    
    {
      "title"   : "About",
      "excerpt" : "",
      "category": "",
      "tags"    : "",
      "url"     : "/about/",
      "content" : "This is the base Jekyll theme. You can find out more info about customizing your Jekyll theme, as well as basic Jekyll usage documentation at jekyllrb.comYou can find the source code for Minima at GitHub:jekyll /minimaYou can find the source code for Jekyll at GitHub:jekyll /jekyll"
    },
    
  
    
    {
      "title"   : "CANlab neuroimaging analysis tools",
      "excerpt" : "The CANlab imaging analysis tools consist of a set of linked Github repositories. This site serves as the point of entry for using these tools.",
      "category": "",
      "tags"    : "",
      "url"     : "/",
      "content" : "The CANlab imaging analysis tools consist of a set of linked Github repositories.They enable interactive data analysis for fMRI and other types of neuroimaging data using objects with simple methods (or commands) customized for neuroimaging data analysis. New here? Start with the Setup page and the Quick-start walkthrough. Looking for something specific? Try the search page.Interactive analysis: Philosophy and principlesMuch of neuroimaging analysis, like other areas of science, has moved towards pipelines: Standardized processing streams that produce reliable results with optimized procedures. This is an essential part of any technology, and an important effort. At same time, however, there is a need for creativity and exploration of data and techniques in order to discover new ways of doing things. And there is a need to understand data — its characteristics, its quirks and outliers, and its behavior under different conditions — in order to avoid spurious results and understand what is true. Exploration and discovery require the ability to visualize data in a variety of ways, interact with it, and create analyses that fit the questions at hand.There are many established pipelines for neuroimaging analysis, but relatively few tools that provide flexibility and the ability to interact with data. The CANlab toolboxes were designed with interactive analysis in mind. The tools provide a high-level language for interacting with neuroimaging data. The idea is to take preprocessed data or even the results of single-subject analyses—the output of established preprocessing pipelines—and import them into lightweight, flexible data objects specialized for neuroimaging visualization and analysis. These objects allow for interactive analysis with simple commands, like “plot”, “predict”, and “montage”.There are several advantages to this type of framework. We’re not saying the code is perfect — it’s necessarily a work in progress — but here are some of the values we aspire to: Interactivity: Complex operations can be done with simple commands. For example, single commands perform (a) stratified, cross validated multivariate prediction (b) rendering imaging results on brain slices or surfaces, and many other functions. This operations can thus be done interactively, allowing analysts to explore the distribution of data and the consequences of altering analysis choices. Transparency: Scripts that use these commands become simple to read, write, and interpret, increasing transparency and reducing coding errors. A basic group fMRI analysis, including generating publication-quality figures and tables of results, can be performed in only a few (about 5) lines of code. Organization of the toolbox around a few core objects makes it easier to discover what they can do (their methods). A series of executable walkthroughs—and HTML reports with expected output—demonstrate some of the core functionality. Reproducibility: The use of simple, transparent commands makes it easy to share the code needed to reproduce an analysis in a format that others can understand and use. Minimization of errors: Core object functions are re-used and vetted across analyses and users, reducing coding errors. The walkthroughs serve as a basic unit test for many core functions, providing a test that analyses are running and producing expected results whatever platform and software versions are being used. (A full unit test would be desirable, and is planned.) Efficiency: A batch system built on simple object commands runs a variety of standard quality control checks and analyses, and saves date-stamped HTML reports with figures and statistics. This provides a base set of analyses that reduces coding time and reduces coding errors. This is good for archiving and reproducibility, and good for efficiently writing papers. Shareability: The data objects are designed to be space efficient, and store imaging data in a fraction of the disk space it takes to store full images. In the batch system, standardized variable names make it easy to understand the structure of the folders and files, which promotes meaningful sharing. Date-stamped HTML reports provide a record of analyses, figures and statistics that can be archived and shared. Extensibility: The object-oriented framework is extensible, allowing developers and data scientists to add new methods or object types.New analytic techniques can be easily “plugged in”. The objects store images in a flat 2-D matrix (voxels x images) that is very familiar to data scientists from all fields, and can be subjected to custom analyses. Core object code handles the rendering of these results back into brain space, including visualization and anatomical labeling. This makes neuroimaging accessible to a variety of data scientists developing sophisticated new analyses.Walkthroughs and batch scriptsA series of step-by-step analysis walkthroughs are in the CANlab_help_examples repository, in the example_help_files folder.These are executable Matlab files (.m files) that can be run. They can also be published to HTML files (see canlab_help_publish.m). A set of HTML files with figures and printouts of these help examples is in the published_html folder.A system of batch scripts is in the CANlab_help_examples repository, in the Second_level_analysis_template_scripts folder.types of objectsSee the Interactive fMRI analysis page Object Description fmri_data Stores neuroimaging datasets; operate on datasets by calling object methods statistic_image Stores statistic images with stats and P-values atlas Stores atlas data with probability maps and integers for unique regions region Stores data grouped by region/network, treating region as a unit of analysis fmridisplay Container for handles for brain slices and surfaces, allowing visualization Issues and bugsPlease raise issues or document errors by posting issues on the CAN Lab Github page."
    },
    
  
    
    {
      "title"   : "Archive Layout with Content",
      "excerpt" : "",
      "category": "",
      "tags"    : "",
      "url"     : "/archive-layout-with-content/",
      "content" : "A variety of common markup showing how the theme styles them.Header oneHeader twoHeader threeHeader fourHeader fiveHeader sixBlockquotesSingle line blockquote: Quotes are cool.Tables Entry Item   John Doe 2016 Description of the item in the list Jane Doe 2019 Description of the item in the list Doe Doe 2022 Description of the item in the list Header1 Header2 Header3 cell1 cell2 cell3 cell4 cell5 cell6 cell1 cell2 cell3 cell4 cell5 cell6 Foot1 Foot2 Foot3 Definition Lists Definition List Title Definition list division. Startup A startup company or startup is a company or temporary organization designed to search for a repeatable and scalable business model. #dowork Coined by Rob Dyrdek and his personal body guard Christopher “Big Black” Boykins, “Do Work” works as a self motivator, to motivating your friends. Do It Live I’ll let Bill O’Reilly explain this one.Unordered Lists (Nested) List item one List item one List item one List item two List item three List item four List item two List item three List item four List item two List item three List item fourOrdered List (Nested) List item one List item one List item one List item two List item three List item four List item two List item three List item four List item two List item three List item fourButtonsMake any link standout more when applying the .btn class.NoticesWatch out! You can also add notices by appending {: .notice} to a paragraph.HTML TagsAddress Tag 1 Infinite Loop Cupertino, CA 95014 United StatesAnchor Tag (aka. Link)This is an example of a link.Abbreviation TagThe abbreviation CSS stands for “Cascading Style Sheets”.Cite Tag“Code is poetry.” —AutomatticCode TagYou will learn later on in these tests that word-wrap: break-word; will be your best friend.Strike TagThis tag will let you strikeout text.Emphasize TagThe emphasize tag should italicize text.Insert TagThis tag should denote inserted text.Keyboard TagThis scarcely known tag emulates keyboard text, which is usually styled like the &lt;code&gt; tag.Preformatted TagThis tag styles large blocks of code..post-title { margin: 0 0 5px; font-weight: bold; font-size: 38px; line-height: 1.2; and here's a line of some really, really, really, really long text, just to see how the PRE tag handles it and to find out how it overflows;}Quote TagDevelopers, developers, developers… –Steve BallmerStrong TagThis tag shows bold text.Subscript TagGetting our science styling on with H2O, which should push the “2” down.Superscript TagStill sticking with science and Isaac Newton’s E = MC2, which should lift the 2 up.Variable TagThis allows you to denote variables. Welcome to Jekyll! Published: October 09, 2017 Page not found The page you were looking for doesn’t exist. About CANlab neuroimaging analysis tools The CANlab imaging analysis tools consist of a set of linked Github repositories. This site serves as the point of entry for using these tools. Archive Layout with Content CANlab Second-level analysis batch system The CANlab imaging analysis tools consist of a set of linked Github repositories. This site serves as the point of entry for using these tools. Posts by Category Posts by Collection CV fMRI tutorials with Matlab Live Scripts Code to run each walkthrough is included in the CANlab Core toolbox, and datasets are included or downloaded from Neurovault. Markdown Page not in menu This is a page not in th emain menu Object-oriented analysis Interactive fMRI analysis using a small set of CANlab data objects and their methods. Page Archive Portfolio Publications CANlab toolbox repositories The CANlab imaging analysis tools consist of a set of linked Github repositories. Here is a list Search Search the CANlab documentation, walkthroughs, and tutorials. Constructing a Second-Level fMRI Analysis Pipeline Initial Setup and Requirements Sitemap Posts by Tags Talk map Talks and presentations Teaching Terms and Privacy Policy Object-oriented analysis walkthroughs Code to run each walkthrough is included in the CANlab core toolbox or on Neurovault. Blog posts Jupyter notebook markdown generator"
    },
    
  
    
    {
      "title"   : "CANlab Second-level analysis batch system",
      "excerpt" : "The CANlab imaging analysis tools consist of a set of linked Github repositories. This site serves as the point of entry for using these tools.",
      "category": "",
      "tags"    : "",
      "url"     : "/batch/",
      "content" : "The batch system, specialized for second-level neuroimaging data analysis, is in CANlab_help_examples repository.See batch workflow for a walkthough of the batch scripts. The walkthrough is also presented below. Sections on this page Philosophy WHAT THESE TEMPLATE SCRIPTS ARE AND WHAT THEY DO DEPENDENCIES FEATURES QUICK START: SETTING UP A NEW ANALYSIS FOR A NEW DATASET RUNNING ANALYSES AND GENERATING REPORTS OVERVIEW OF SCRIPTS IN THE FOLDER AND WORKFLOW Step 1: Create a folder and run the setup script Step 2: Edit files in you local analysis folder and save Step 3: Load and prepare contrast images and analyses Step 4: Run scripts to generate on-demand results Step 5: Run batch scripts to publish date-stamped HTML reports MORE INFO ABOUT HOW FILES AND VARIABLES ARE STORED Batch scripts: PhilosophyThis page describes a system of batch scripts located in the CANlab_help_examples repository, in the Second_level_analysis_template_scripts folder. The batch system is designed to facilitate second-level analysis across a series of activation estimate or contrast images from a group of participants.This provides a lightweight dataset with a set of standard analyses that can be used in publication, shared, and archived. The scripts are designed with the following values in mind: Transparency: Scripts are simple to read, write, and interpret, re-using the same variable names. This increases readability and reduces coding errors. Efficiency: A batch system built on simple object commands runs a variety of standard quality control checks and analyses. &#8220;Prep_&#8221; scripts are run once and do most of the heavy lifting, saving files with standard file and variable names. These can be loaded and re-run on-demand to generate results reports. Reproducibility: The scripts are designed to be easily re-run to reproduce all the analyses, figures, and statistics, including HTML reports. Minimization of errors: Scripts that do standard analyses are re-used and vetted across analyses and users, reducing coding errors. Provenance and history &#8220;Publish&#8221; scripts save date-stamped HTML reports with figures and statistics. This provides a base set of analyses that reduces coding time and reduces coding errors. This is good for archiving and reproducibility, and good for efficiently writing papers. Shareability: Standardized variable names make it easy to understand the structure of the folders and files, which promotes meaningful sharing. Date-stamped HTML reports provide a record of analyses, figures and statistics that can be archived and shared. Flexibility: The batch scripts provide a series of modules that can be &#8220;mixed and matched&#8221;, and customized, depending on the needs for a particular study. Extensibility: The batch scripts are extensible, and serve as a kind of template to create and &#8220;plug in&#8221; new analyses. Other walkthroughsInteractive analysis walkthroughs: Another series of help files is a series of step-by-step analysis walkthroughs are in the CANlab_help_examples repository, in the example_help_files folder.Simple (alternative) batch system: Also, there is a very simple set of batch scripts suitable for other analytic purposes in the CANlab_help_examples repository, in the Canlab_simple_image_load_prep folder. This uses the same philosophy of defining a clear path to re-load saved files with standardized variable names, but is simpler and much more bare-bones than the full batch system. It can be useful when prototyping new analyses that do not fit into the batch system.CANlab second-level batch scriptshttps://www.github.com/Canlabhttps://github.com/canlab/CANlab_help_examplesWHAT THESE TEMPLATE SCRIPTS ARE AND WHAT THEY DOThis is a set of scripts that is designed to facilitate second-level analysisacross beta (COPE), or contrast images from a group of participants.It&#8217;s particularly helpful for signature-basedanalysis of group data, usually starting with beta images (one image persubject per condition) produced by first-level GLM analyses. It assumesthat you are starting with Analyze (.img) or NIFTI (.nii) files from afirst-level analysis, and that these images are in MNI space.Think of it as a framework that standardizes variable names and fileformats, and makes it easy to run analyses and save HTML reports withoutwriting a bunch of custom code.There are four kinds of files in the batch system.prep_[1 2 3 etc.] scripts set up data structures and files and need only be run during initial setup (once)Scripts named a_ b_ c_ etc. run analyses and print reports using the prepped files.*z_batch** scripts run sets of other scripts. Those with &#8220;publish&#8221; in the filename generate HTML reports.*plugin_** scripts are for internal use and keep the code clean. Youshould not need to edit these or run them directly.The philosophy is to have scripts with standardized variable names andminimal editing required to adapt them to a new dataset.Also, these scripts include &#8216;batch&#8217; scripts that run analyses and saveHTML files with results and images, storing a time-stamped record of youranalysis.In principle, you should only need to edit two scripts to customize theanalysis for a new dataset:a_set_up_paths_always_run_first.m prep_1_set_conditions_contrasts_colors.mThen the rest should run correctly, for most datasets.The master scripts to edit are in the folder Second_level_analysis_template_scripts.You do not have to copy over all the scripts from the master scripts folderto use them. You can run the master scripts directly from the master copy. the standard versions of most of the master scripts will run without editing. If you want to customize a script or create new scripts, do not edit themaster scripts. Instead, can copy any of them to your local projectscripts folder and customize them. Those customized versions will be runinstead of the standard versions.DEPENDENCIESThe scripts require several other toolboxes:Seehttps://github.com/canlab/CANlab_help_examples/blob/master/README.mdFEATURES Time-stamped HTML printouts of all figures and results for archival/reference purposes Short, modular scripts are easy to customize and extend Common naming and data storage conventions across all analyses increase readability and organization Separate process for loading/preparing datasets/contrasts and running analyses, to make it easier to re-run analyses quickly Loading and visualization of all image sets in fmri_data for quality checks Extraction of global gray, white, and CSF components Quality plots and warning messages based on CSF components&#8217; relationship with gray matter and other measures Regression-based rescaling of data to remove CSF components Easily customizable specification of contrasts and colors Voxel-wise maps for each contrast SVM classifier maps for each contrast Between-person contrasts and between-condition contrasts if different conditions include different subjects Extraction of the NPS and subregions Plots and stats on NPS responses by condition and for each contrast Extraction, plots, and stats on other signatures (these require access to the private CANlab masks repository):Vicarious pain (VPS), Negative emotion (PINES), Rejection, autonomic signatures, fibromyalgia, cerebral contributions to pain (SIIPS1) Extraction, plots, and stats on Buckner Lab resting-state component maps Polar plots and &#8216;river plots&#8217; for relationships between image sets/contrasts and resting-state maps/signatures You can load and integrate text summaries and interpretation into yourHTML report file.QUICK START: SETTING UP A NEW ANALYSIS FOR A NEW DATASETThis section describes how to set up and prep an analysis, in 12 steps.First, make sure you have the CANlab_help_examples and CANLab_Core_Toolsrepositories on your matlab path: Download the CANlab Core Tools repository for neuroimaging data analysis https://github.com/canlab/CanlabCore Open Matlab and change to the directory where you want to install the toolboxes (i.e., drag folder into Matlab cmd window) Run canlab_toolbox_setup.m (in Canlab_Core) by dragging the file from Finder/Explorer into MatlabOnce you have the tools installed, you are ready to set up a new analysis. Make sure you have a master study analysis folder, MASTER_FOLDER_NAME Make a &#8216;data&#8217; subdirectory Add MNI-space .nii/.img+.hdr files to be analyzed there. Change to MASTER_FOLDER_NAME in Matlab Type a_set_up_new_analysis_folder_and_scripts to make subfolders and copy in key files Edit your local copies of a_set_up_paths_always_run_first.m and prep_1_set_conditions_contrasts_colors.m Now that the analysis is set up, you&#8217;ll run a &#8220;prep&#8221; script sequence toload data into fmri_data objects, create and run contrasts, and prep Matlab .mat data files. Youonly need to run this once:a_set_up_paths_always_run_first.m prep_1_set_conditions_contrasts_colors.m prep_2_load_image_data_and_save.m prep_3_calc_univariate_contrast_maps_and_save.m prep_4_apply_signatures_and_saveThis saves files that are re-loaded later and used in analyses.Other &#8220;prep_*&#8221; scripts can be run, too, including a script that loads behavioral data.After you have run these, you are ready to reload your saved files andgenerate results, tables, and HTML reports. Once you have your &#8220;prep_&#8221; running right with no errors, run the batch scriptz_batch_publish_image_prep_and_qcThis runs the data-prep process and saves a date-stamped record, withplots, in &#8216;MASTER_FOLDER_NAME/results/published_output&#8217; For more help, see the help documents/walkthrough in the canlab_help_examples repository. They are called:0_CANLab-Help2ndlevelExampleWalkthrough.pdf0_begin_here_readme.m0_debugging_common_errors.rtfSee: https://github.com/canlab/CANlab_help_examples/blob/master/README.mdRUNNING ANALYSES AND GENERATING REPORTS First, always run a_set_up_paths_always_run_first.m, so that yourpaths and folder names will be set. Then, run b_reload_saved_matfiles.m, which will load the data files. After that, you can run any of the analysis scripts below. You can also run z_batch_publish_analyses.m, which runs a whole listof analysis scripts and saves the results in an html file (as well asindividual figures) in the &#8216;results&#8217; subfolder.OVERVIEW OF SCRIPTS IN THE FOLDER AND WORKFLOWThis section contains a more detailed overview of the workflow, and the various scripts you will run to prep the analysis and generate results.Step 1: Create a main analysis folder MASTER_FOLDER_NAME and navigate thereRun: Script Function a_set_up_new_analysis_folder_and_scripts Creates local folders and copies in relevant scripts Step 2: Edit these files in you local analysis folder and save: Script Function study_info.json File with study/author meta-data, for reports and archive a_set_up_paths_always_run_first.m Modify to specify your local analysis folder name a2_set_default_options.m Options used in various other scripts; change if desired, or not prep_1b_prep_behavioral_data.m / prep_1b_example2.m Optional: Modify one of these to load and attach behavioral data from files, e.g., from Excel &#160; &#160; prep_1_set_conditions_contrasts_colors.m Modify: Specify image file subdirs, wildcards to locate images, condition names and contrasts across conditions prep_1c_normalize_to_MNI.m Optional script to modify and use only if data are not yet in MNI space; otherwise ignore &#160; &#160; prep_0_batch_run_once.m Batch script to run a whole sequence of prep_* files. Step 3: Load and prepare contrast images and analyses:You only need to run this once if it runs correctly. Relevant infois extracted from images and saved in standard variable names forreloading and results-on-demand later. Script Function a_set_up_paths_always_run_first.m Always run this first before you run other scripts. Runs: a2_set_default_options prep_1b_prep_behavioral_data.m / prep_1b_example2.m Optional: Run these load and attach behavioral data from files, e.g., from Excel prep_1_set_conditions_contrasts_colors.m Modify to specify image file subdirectories, wildcards to locate images, condition names prep_2_load_image_data_and_save.m Load image data into fmri_data objects and save prep_3_calc_univariate_contrast_maps_and_save.m Apply contrasts to fmri_data objects prep_3a_run_second_level_regression_and_save.m [Optional] if you have entered continuous regressors in prep_1b, run regression prep_3b_run_SVMs_on_contrasts_and_save.m [Optional] run cross-val SVMs on within-person contrasts prep_3c_run_SVMs_on_contrasts_masked.m [Optional] run cross-val SVMs on within-person contrasts, within a mask prep_3d_run_SVM_betweenperson_contrasts.m [Optional] run cross-val SVMs across conditions, assuming subjects nested within conditions (e.g., if diff conditions are diff subjects) prep_4_apply_signatures_and_save.m Apply CANlab signature patterns and attach output (values) to saved DAT structure prep_5_apply_shen_parcellation_and_save.m [Optional] Extract data from each condition or contrast averaged over each parcel, save file with values prep_5b_apply_spmanatomy_parcellation_and_save.m [Optional] Extract data from each condition/contrast averaged over each parcel, save file with values prep_6_apply_kragel_emotion_signatures_and_save.m [Optional] Apply Kragel emotion signature patterns and attach output (values) to DAT An alternative, once you feel comfortable with the setup, is to run abatch script with this sequence.All scripts with &#8216;publish&#8217; in the name print date-stamped HTML reports.z_batch_publish_image_prep_and_qc.mStep 4: Run scripts to generate on-demand results:Always &#8216;set up paths&#8217; and &#8216;reload&#8217; before you do anything else. Afterthat, these scripts should (theoretically) be runnable in any order togenerate figures and tables of results. The scripts use simple commandsand are designed to be guides for you to add your own custom scripts ifyou want to, and to pick and choose for your study.Think of them as a menu of items that you may want to run. Batch scripts(below) run collections of these scripts and group them into publishedHTML reports. Script Function a_set_up_paths_always_run_first.m Always run this first before you run other scripts. b_reload_saved_matfiles.m Run this to reload saved and prepped files [Do not modify] &#160; &#160; b1_behavioral_analysis.m Optional: Modify/customize for your study. The default script is an example only. For all the scripts below, you can run them &#8216;out of the box&#8217; withoutcustomizing them for your study, as long as your prep_* scripts have runcorrectly and you have reloaded data with a_set_up_paths_always_run_first + b_reload_saved_matfiles Script Function b2_show_data_vs_underlay.m Show first condition image over canonical brain to check registration and coverage. Contrasts: &#160; c_univariate_contrast_maps.m Show voxel-wise maps for all contrasts, FDR-corrected and uncorrected; tables c3_univariate_contrast_maps_scaleddata.m Show voxel-wise contrast maps for scaled/cleaned data c4_univ_contrast_wedge_plot_and_lateralization_test.m Test contrasts and lateralization across 16 large-scale rsFMRI networks with L/R divisions c5_univ_contrast_wedge_plot_and_lateralization_test_scaled_data.m Test contrasts and lateralization with scaled data Support Vector Machines: &#160; c2_SVM_contrasts.m Show SVM results (from prep_3b_run_SVMs_on_contrasts_and_save) c2_SVM_contrasts_masked.m Show SVM results (from prep_3b_run_SVMs_on_contrasts_masked) c2b_SVM_betweenperson_contrasts.m Show SVM results (from prep_3d_run_SVM_betweenperson_contrasts) c2c_SVM_between_condition_contrasts.m Show SVM results (run-on-demand, no prep script yet) Multivariate regression: &#160; c2a_second_level_regression.m Show regression results (from prep_3a_run_second_level_regression_and_save) c2d_lassoPCR_contrasts.m Multivariate cross-validated regression results (for, e.g., linear contrasts across multiple conditions) Pre-defined signatures: &#160; d1_pain_signature_responses_dotproduct.m Test and report extracted &#8216;signature&#8217; responses (from prep_4_apply_signatures_and_save) d2_pain_signature_responses.m Test and report extracted &#8216;signature&#8217; responses with cosine_similarity metric (from prep_4_apply_signatures_and_save) d3_plot_nps_subregions.m Test and report Neurologic Pain Signature subregions (from prep_4_apply_signatures_and_save) d3_plot_nps_subregions_bars.m &#160; d4_compare_NPS_SIIPS_scaling_similarity_metrics.m Test and report extracted &#8216;signature&#8217; responses with multiple similarity metrics (from prep_4_apply_signatures_and_save) d5_emotion_signature_responses.m &#160; d6_empathy_signature_responses.m &#160; d7_autonomic_signature_responses.m &#160; d8_fibromyalgia_signature_responses.m &#160; d9_nps_correlations_with_global_signal.m Test and report NPS correlations with extracted global gray/white/CSF averages d10_signature_riverplots.m &#8216;River plots&#8217; show relationships between each condition (and contrast) and a set of &#8216;signatures&#8217; d11_signature_similarity_barplots.m Bar plots showing relationships between each condition (and contrast) and a set of &#8216;signatures&#8217; d12_kragel_emotion_signature_responses.m &#160; d13_kragel_emotion_riverplots.m &#160; d14_kragel_emotion_signature_similarity_barplots.m &#160; Pre-defined networks: &#160; f2_bucknerlab_network_barplots.m Contrasts analyzed according to 7 Buckner Lab cortical networks from Yeo et al. 2011 f2_bucknerlab_network_wedgeplots.m &#160; g2_bucknerlab_network_riverplots.m &#160; Group differences: &#160; h2_group_differences_emosignatures.m Group differences in signatures, using &#8216;Group&#8217; variable in DAT. See prep_1b_prep_behavioral_data.m h3_kragel_patterns_group_differences.m &#160; h_group_differences.m &#160; Parcels and meta-analysis patterns: &#160; j1_display_parcels.m &#160; k2_neurosynth_cogcontrol_pattern_and_region_analyses.m &#160; k_emotionmeta_pattern_and_region_analyses.m For contrasts, pattern of interest and region-of-interest analyses defined based on Silvers, Buhle et al. emotion regulation meta-analysis Step 5: Run batch scripts that publish date-stamped HTML reportsThese run and save reports in the &#8216;published_output&#8217; subfolder in your analysis directoryThis allows for archiving and records of the analysis history.This batch script allows you to run a menu of different sets of results(contrasts, svm analyses, signature analyses, etc.) in any order:z_batch_publish_analyses.mThis batch script runs both the data load batch and all results:z_batch_publish_everything.mThese batch scripts are run in &#8216;publish&#8217; scripts. You can run them ontheir own, too, but &#8216;set up paths&#8217; and &#8216;reload&#8217; first.`z_batch_load_and_prep.mz_batch_coverage_and_contrasts.mz_batch_svm_analysis.mz_batch_signature_analyses.mz_batch_bucknerlab_network_analyses.mz_batch_meta_analysis_mask_analyses.m`(See the canlab_batch_flowchart image above.)MORE INFO ABOUT HOW FILES AND VARIABLES ARE STORED in &#8216;prep_&#8217; scripts:image names, conditions, contrasts, colors, global gray/white/CSFvalues are saved automatically in a DAT structure Extracted fmri_data objects are saved in DATA_OBJ variables Contrasts are estimated and saved in DATA_OBJ_CON variables Files with these variables are saved automatically when yourun the prep scripts. meta-data are saved in image_names_and_setup.matimage data are saved in data_objects.mat They are loaded automatically when you runb_reload_saved_matfiles.m"
    },
    
  
    
    {
      "title"   : "Posts by Category",
      "excerpt" : "",
      "category": "",
      "tags"    : "",
      "url"     : "/categories/",
      "content" : ""
    },
    
  
    
    {
      "title"   : "Posts by Collection",
      "excerpt" : "",
      "category": "",
      "tags"    : "",
      "url"     : "/collection-archive/",
      "content" : "portfolio Portfolio item number 1 Published: May 07, 2026 Short description of portfolio item number 1 Portfolio item number 2 Published: May 07, 2026 Short description of portfolio item number 2 publications Paper Title Number 1 Published in Journal 1, 2009 This paper is about the number 1. The number 2 is left for future work. Recommended citation: Your Name, You. (2009). &quot;Paper Title Number 1.&quot; Journal 1. 1(1). http://academicpages.github.io/files/paper1.pdf Paper Title Number 2 Published in Journal 1, 2010 This paper is about the number 2. The number 3 is left for future work. Recommended citation: Your Name, You. (2010). &quot;Paper Title Number 2.&quot; Journal 1. 1(2). http://academicpages.github.io/files/paper2.pdf Paper Title Number 3 Published in Journal 1, 2015 This paper is about the number 3. The number 4 is left for future work. Recommended citation: Your Name, You. (2015). &quot;Paper Title Number 3.&quot; Journal 1. 1(3). http://academicpages.github.io/files/paper3.pdf talks Talk 1 on Relevant Topic in Your Field Published: March 01, 2012 This is a description of your talk, which is a markdown files that can be all markdown-ified like any other post. Yay markdown! Tutorial 1 on Relevant Topic in Your Field Published: March 01, 2013 More information here Talk 2 on Relevant Topic in Your Field Published: February 01, 2014 More information here Conference Proceeding talk 3 on Relevant Topic in Your Field Published: March 01, 2014 This is a description of your conference proceedings talk, note the different field in type. You can put anything in this field. teaching Teaching experience 1 Undergraduate course, University 1, Department, 2014 This is a description of a teaching experience. You can use markdown like any other post. Teaching experience 2 Workshop, University 1, Department, 2015 This is a description of a teaching experience. You can use markdown like any other post."
    },
    
  
    
    {
      "title"   : "CV",
      "excerpt" : "",
      "category": "",
      "tags"    : "",
      "url"     : "/cv/",
      "content" : "Education BA in Health, Behavior, and Society, University of Rochester, 2013 MPH in Healthcare Informatics, University of California, Davis, 2015Work experienceEtc EtcSkillsskillzPublicationspubzTalkstalksTeachingteachingService and leadership Currently signed in to 43 different slack teams"
    },
    
  
    
    {
      "title"   : "fMRI tutorials with Matlab Live Scripts",
      "excerpt" : "Code to run each walkthrough is included in the CANlab Core toolbox, and datasets are included or downloaded from Neurovault.",
      "category": "",
      "tags"    : "",
      "url"     : "/tutorials/",
      "content" : "This series of walkthroughs is designed to illustrate the principles of fMRI acquisition, design, and analysis. They use the CANlab Core interactive analysis tools.Code to run each walkthrough is included in the CANlab Core toolbox, and datasets are included or downloaded from Neurovault. See the main CANlab intro page for more on the philosophy behind the interactive analysis approach.This is not a comprehensive introduction to Matlab. It&#8217;s assumed that you will use other resources to supplement your basic understanding how to work with Matlab, including: Matlab&#8217;s comprehensive built-in examples (type &#8220;doc&#8221; within Matlab) Function help (type &#8220;help my_fun&#8221;, where my_fun is the name of a function) Matlab Academy (free!), including the &#8220;Matlab Onramp&#8221; module and others) Other great resources, e.g., Michael X. Cohen&#8217;s YouTube lectures and Matlab book, Kendrick Kay&#8217;s Matlab-based stats courseThese are didactic tutorials using Matlab live scripts. There is also a complementary set of code walkthroughs on using the CANlab object-oriented tools, with some overlap but unique information and code examples. Basic signal processing &#160; 1.1. T1 decay and basic Matlab orientation Download Matlab Live Script 1.2. Sine waves, aliasing, and the Fourier Transform Download Matlab Live Script The General Linear Model and fMRI designs &#160; 2.1. fMRI Design Matrices and inference Download Matlab Live Script 2.2. fMRI Design Matrices: Multiple regressors Download Matlab Live Script 2.3. Efficiency, colinearity, and variance inflation Download Matlab Live Script 2.4. High-pass Filtering Download Matlab Live Script 2.5. Nuisance Covariates Download Matlab Live Script First-level models with whole-brain data &#160; 3.1. Setting SPM defaults Download Matlab Live Script Get the Pinel localizer dataset used here or on Dropbox here (Neurospin version) or here (BIDS) &#160; 3.2. Preprocessing basics using SPM Download Matlab Live Script 3.3. First-level model using the SPM GUI Download Matlab Live Script 3.4. First-level model using CANlab regress() Download Matlab Live Script 3.5. Parametric modulators with variable event durations Download Matlab Live Script Second-level models with CANlab tools &#160; 4.1. Second-level model using CANlab robust regression toolbox Download Matlab Live Script See also walkthroughs &#160; Multivariate predictive models &#160; Datasets (On Dropbox; See also links in tutorials) Paper links Kragel270 fmri_data object Paper BMRK3 pain dataset fmri_data object Paper Rejection vs Pain dataset Paper and this Tutorials &#160; 3.1. SVM on unpaired data using predict() Download Matlab Live Script 3.2. multivariate prediction with continuous outcomes &#160; Other tutorialsCANlab code walkthroughs"
    },
    
  
    
  
    
  
    
    {
      "title"   : "Markdown",
      "excerpt" : "",
      "category": "",
      "tags"    : "",
      "url"     : "/markdown/",
      "content" : "Locations of key files/directories Basic config options: _config.yml Top navigation bar config: _data/navigation.yml Single pages: _pages/ Collections of pages are .md or .html files in: _publications/ _portfolio/ _posts/ _teaching/ _talks/ Footer: _includes/footer.html Static files (like PDFs): /files/ Profile image (can set in _config.yml): images/profile.pngTips and hints Name a file “.md” to have it render in markdown, name it “.html” to render in HTML. Go to the commit list (on your repo) to find the last version Github built with Jekyll. Green check: successful build Orange circle: building Red X: error No icon: not built Resources Liquid syntax guideMarkdown guideHeader threeHeader fourHeader fiveHeader sixBlockquotesSingle line blockquote: Quotes are cool.TablesTable 1 Entry Item   John Doe 2016 Description of the item in the list Jane Doe 2019 Description of the item in the list Doe Doe 2022 Description of the item in the list Table 2 Header1 Header2 Header3 cell1 cell2 cell3 cell4 cell5 cell6 cell1 cell2 cell3 cell4 cell5 cell6 Foot1 Foot2 Foot3 Definition Lists Definition List Title Definition list division. Startup A startup company or startup is a company or temporary organization designed to search for a repeatable and scalable business model. #dowork Coined by Rob Dyrdek and his personal body guard Christopher “Big Black” Boykins, “Do Work” works as a self motivator, to motivating your friends. Do It Live I’ll let Bill O’Reilly explain this one.Unordered Lists (Nested) List item one List item one List item one List item two List item three List item four List item two List item three List item four List item two List item three List item fourOrdered List (Nested) List item one List item one List item one List item two List item three List item four List item two List item three List item four List item two List item three List item fourButtonsMake any link standout more when applying the .btn class.NoticesWatch out! You can also add notices by appending {: .notice} to a paragraph.HTML TagsAddress Tag 1 Infinite Loop Cupertino, CA 95014 United StatesAnchor Tag (aka. Link)This is an example of a link.Abbreviation TagThe abbreviation CSS stands for “Cascading Style Sheets”.Cite Tag“Code is poetry.” —AutomatticCode TagYou will learn later on in these tests that word-wrap: break-word; will be your best friend.Strike TagThis tag will let you strikeout text.Emphasize TagThe emphasize tag should italicize text.Insert TagThis tag should denote inserted text.Keyboard TagThis scarcely known tag emulates keyboard text, which is usually styled like the &lt;code&gt; tag.Preformatted TagThis tag styles large blocks of code..post-title { margin: 0 0 5px; font-weight: bold; font-size: 38px; line-height: 1.2; and here's a line of some really, really, really, really long text, just to see how the PRE tag handles it and to find out how it overflows;}Quote TagDevelopers, developers, developers… –Steve BallmerStrong TagThis tag shows bold text.Subscript TagGetting our science styling on with H2O, which should push the “2” down.Superscript TagStill sticking with science and Isaac Newton’s E = MC2, which should lift the 2 up.Variable TagThis allows you to denote variables."
    },
    
  
    
    {
      "title"   : "Page not in menu",
      "excerpt" : "This is a page not in th emain menu",
      "category": "",
      "tags"    : "",
      "url"     : "/non-menu-page/",
      "content" : "This is a page not in the menu. You can use markdown in this page.Heading 1Heading 2"
    },
    
  
    
    {
      "title"   : "Object-oriented analysis",
      "excerpt" : "Interactive fMRI analysis using a small set of CANlab data objects and their methods.",
      "category": "",
      "tags"    : "",
      "url"     : "/objectoriented/",
      "content" : "The CANlab tools enable interactive analysis of fMRI and other neuroimaging data through a small set of objects with simple, high-level methods (commands) tailored to neuroimaging. The toolboxes are distributed across linked GitHub repositories.For the broader rationale behind interactive analysis, see the home page and the philosophy section.Where to find walkthroughs and batch scripts Walkthroughs: the walkthroughs index is the main entry point. Source .m files are in the CANlab_help_examples repository under example_help_files; the rendered HTML reports are under published_html. Batch scripts: the second-level analysis batch system lives in the same repository under Second_level_analysis_template_scripts. See the batch system page for an overview.Types of objects Object Description fmri_data Stores neuroimaging datasets; you operate on a dataset by calling object methods statistic_image Stores statistic images with stats and P-values atlas Stores atlas data with probability maps and integers for unique regions region Stores data grouped by region/network, treating each region as a unit of analysis fmridisplay Container for handles to brain slices and surfaces, used for visualization fmri_data object: features and philosophy Flat format. Image data lives in a 2-D voxels × images matrix that’s space-efficient and easy to feed into any other analysis package. Compact storage. Out-of-image and empty voxels are removed, and data are kept in single precision. Reversible. Metadata is retained so you can reconstruct the 3-D image volume at any time. Built-in resampling makes it easy to combine datasets with different voxel sizes and bounding boxes. Multi-image. A single object can hold many images. Short, intuitive method names specialized for neuroimaging: Visualization — plot, orthviews, surface, montage, histogram, isosurface Image manipulation — apply_mask, get_wh_image, resample_space, compare_space, flip, threshold Data extraction — apply_atlas, apply_parcellation, extract_gray_white_csf, extract_roi_averages Analysis — ica, mahal, image_math, and many more in the fmri_data subclass Provenance. History of changes to an object is tracked and updated. Documentation. In Matlab, doc &lt;class_name&gt; (e.g. doc fmri_data) shows properties, methods, and examples.A simple analysis flowThe diagram below shows a flowchart for a simple group analysis: load a set of images (.nii or .img, one per subject) into an fmri_data object, then a few commands perform a t-test (or other analysis), threshold the resulting statistic map (a statistic_image object), and display interactive views, slice montages, region tables with automatic anatomical labels, and more."
    },
    
  
    
    {
      "title"   : "Page Archive",
      "excerpt" : "",
      "category": "",
      "tags"    : "",
      "url"     : "/page-archive/",
      "content" : "Welcome to Jekyll! Published: October 09, 2017 Page not found The page you were looking for doesn’t exist. About CANlab neuroimaging analysis tools The CANlab imaging analysis tools consist of a set of linked Github repositories. This site serves as the point of entry for using these tools. Archive Layout with Content CANlab Second-level analysis batch system The CANlab imaging analysis tools consist of a set of linked Github repositories. This site serves as the point of entry for using these tools. Posts by Category Posts by Collection CV fMRI tutorials with Matlab Live Scripts Code to run each walkthrough is included in the CANlab Core toolbox, and datasets are included or downloaded from Neurovault. Markdown Page not in menu This is a page not in th emain menu Object-oriented analysis Interactive fMRI analysis using a small set of CANlab data objects and their methods. Page Archive Portfolio Publications CANlab toolbox repositories The CANlab imaging analysis tools consist of a set of linked Github repositories. Here is a list Search Search the CANlab documentation, walkthroughs, and tutorials. Constructing a Second-Level fMRI Analysis Pipeline Initial Setup and Requirements Sitemap Posts by Tags Talk map Talks and presentations Teaching Terms and Privacy Policy Object-oriented analysis walkthroughs Code to run each walkthrough is included in the CANlab core toolbox or on Neurovault. Blog posts Jupyter notebook markdown generator"
    },
    
  
    
    {
      "title"   : "Portfolio",
      "excerpt" : "",
      "category": "",
      "tags"    : "",
      "url"     : "/portfolio/",
      "content" : "Portfolio item number 1 Published: May 07, 2026 Short description of portfolio item number 1 Portfolio item number 2 Published: May 07, 2026 Short description of portfolio item number 2"
    },
    
  
    
    {
      "title"   : "Publications",
      "excerpt" : "",
      "category": "",
      "tags"    : "",
      "url"     : "/publications/",
      "content" : "Paper Title Number 3 Published in Journal 1, 2015 This paper is about the number 3. The number 4 is left for future work. Recommended citation: Your Name, You. (2015). &quot;Paper Title Number 3.&quot; Journal 1. 1(3). http://academicpages.github.io/files/paper3.pdf Paper Title Number 2 Published in Journal 1, 2010 This paper is about the number 2. The number 3 is left for future work. Recommended citation: Your Name, You. (2010). &quot;Paper Title Number 2.&quot; Journal 1. 1(2). http://academicpages.github.io/files/paper2.pdf Paper Title Number 1 Published in Journal 1, 2009 This paper is about the number 1. The number 2 is left for future work. Recommended citation: Your Name, You. (2009). &quot;Paper Title Number 1.&quot; Journal 1. 1(1). http://academicpages.github.io/files/paper1.pdf"
    },
    
  
    
    {
      "title"   : "CANlab toolbox repositories",
      "excerpt" : "The CANlab imaging analysis tools consist of a set of linked Github repositories. Here is a list",
      "category": "",
      "tags"    : "",
      "url"     : "/repositories/",
      "content" : "The CANlab imaging analysis tools consist of a set of linked Github repositories. Repository Description CanlabCore Object-oriented fMRI analysis tools, used in other toolboxes CANlab_help_examples Walkthroughs and batch script system for 2nd-level analysis Neuroimaging_Pattern_Masks Masks, predictive signature patterns, and meta-analysis maps M3 Multilevel mediation toolbox Single- and multi-level mediation for any data type, and for brain images CANlab robust regression toolbox Robust regression for 2nd-level (group) analysis MKDA coordinate-based meta-analysis toolbox Coordinate-based analysis of neuroimaging data and multivariate tools Several of these are needed for interactive data analysis using our object-oriented framework, including CanlabCore, CANlab_help_examples, and Neuroimaging_Pattern_Masks.Other toolboxes are semi-stand-alone but require CanlabCore.Other CANlab repositories contain code and data for experiments and procedures: Repository Description 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&#8217;s dynamic correlation toolbox https://github.com/canlab/Lindquist_Dynamic_Correlation CanlabScripts - in-lab Matlab/python/bash https://github.com/canlab/CanlabScripts"
    },
    
  
    
  
    
    {
      "title"   : "Search",
      "excerpt" : "Search the CANlab documentation, walkthroughs, and tutorials.",
      "category": "",
      "tags"    : "",
      "url"     : "/search/",
      "content" : "{% include base_path %}Search across the CANlab documentation, walkthroughs, and tutorials. Type at least two characters; results update as you type."
    },
    
  
    
    {
      "title"   : "Constructing a Second-Level fMRI Analysis Pipeline",
      "excerpt" : "",
      "category": "",
      "tags"    : "",
      "url"     : "/second/",
      "content" : "{% include base_path %}This page contains a walk-through for creating a second-level analysis including code, results, and figuresCAN Lab Second-Level Analysis Scripts: What They are and What They Do======This is a set of scripts that is designed to facilitate second-level analysis across beta (COPE), or contrast images from a group of participants. The idea is to have a standardized set of scripts that extract and process data in the same way across studies, which (a) increases readability and understanding of the data structure, (b) decreases the need to re-write custom code to perform the same analyses over and over, and (c) facilitates analysis of defined measures across studies. The CANlab scripts are also designed to be easily customizable, so you can add study-specific analysesto your workflow by adding short, modular scripts with few lines of code.The workflow does several things, saving data and output in standardized formats, and creating time-stamped HTML reports with plots, tables, images, and stats in one document so you have an archival record of the whole analysis. This also facilitates writing papers and sharing data and results with others. The two main stages are:Data Preparation: - Load data from image files and meta-data spreadsheet(s), create and save data structures- Image data outlier analysis and scaling (use is optional in analyses)- Extraction of global gray, white, and CSF components (assumes MNI space)- Image data quality control metrics; HTML report- Extract pre-defined “signatures”, data from standard pre-defined networks and brain parcels- Bootstrapping of support vector machine analyses for contrasts (optional)- Save all results in standardized data structuresAnalysis Workflows:- Load saved data structures, run sequences of short, customizable modular scripts- “Coverage and contrasts”: Voxel-wise brain maps for all contrasts, whole-brain support vector machine classifiers- “Signature analyses”: Expression of CANlab pre-defined signatures, e.g., NPS (requires private repository with signatures)- Create your own: Network polar plots, meta-analysis masks, parcels, etc.(1.) Install the [CANlab_help_examples](https://github.com/canlab/CANlab_help_examples) folder from Github. ======This Youtube video can help:[![image of video](/images/youtubehelp1.png)](https://www.youtube.com/watch?v=B1CVdykSNyc)(2.) Add all the folders to PATH ====== In MATLABgenpath(addpath(‘/CANLab_help_examples/’))genpath(addpath(‘/YOUR_ANALYSIS_FOLDER/’))Check and make sure you have all the paths and dependencies before you get started by running this script (found in CANLab_help_examples):run('/CANlab_help_examples/Second_level_analysis_template_scripts/a2_second_level_toolbox_check_dependencies.m')(3.) Set up Your Data Analysis Folder======Are your data set up so that the folders represent conditions and inside those folders are subject data? If not, maybe this bash reorganization script will help you. Alternatively you can change the way the 2nd Level Scripts look at your folders. However, I recommend you keep their inherent structure the same and just conform. Path of least resistance. Do not apply this advice to your social life.Set Up New Folders:There is a script you can use which will auto set up your folders to play well with the 2nd level analysis pipeline. Go to your new Analysis folder and run this from within it:a_set_up_new_analysis_folder_and_script.mIf you want to do this by hand you can go to your Analysis folder set up these subfolders:- data- extras- results- scripts- Copy in a series of scripts from CANLab_help_examples as shown here:![file system image](/images/scripts_sc.png)Set Up the Study Info Document:Copy over to your Analysis folder ‘study_info.json’(4.) Modify the Template Scripts======1. In a text editor, edit the study_info.json file to fit your data For example:```{\"Primary_publication\": \"Fill in this JSON-format file and call it study_info.json, in your mainstudy folder. This field would contain the primary publication associatedwith the study, if any, or null if none.\",\"Associated_publications\": \"Other publications here. e.g., Sylvester, C. Y., Wager, T. D., Lacey, S. C., Hernandez, L., Nochols, T. E., Smith E. E., Jonides, J.. (2003). Switching attention and resolving interference: fMRI measures of executive functions. Neuropsychologia, 41, 357-70.\",\"Notes\":\"This dataset was shared by Guido Frank's lab for the purpose of collaborativeSVM analyses and consulting on eating disorders.\",\"Publication_URLs\": \"http://www.sciencedirect.com/science/article/pii/S1053811905000418http://www.sciencedirect.com/science/article/pii/S0028393202001677\",\"Publication_DOIs\": null,\"Paradigm_files_links\": null,\"Data_files_links\": null,\"IRB_number\": null,\"Scanner_site\": \"University of Michigan\",\"Field_strength\": \"3.0T\",\"Citing_this_work\": \"If you use this dataset in a publication, please include as authors or acknowledge individuals as specified below. Please also see information on publications and grants to cite.\",\"Authors_to_include_on_reuse\": null,\"Authors_to_acknowledge_on_reuse\": \"Tor Wager, John Jonides\",\"Grant_numbers_to_cite\": null}```"
    },
    
  
    
    {
      "title"   : "Initial Setup and Requirements",
      "excerpt" : "",
      "category": "",
      "tags"    : "",
      "url"     : "/setup/",
      "content" : "{% include base_path %}This page walks through Matlab and GitHub setup and gives a fast on-ramp to the CANlab object-oriented tools.If you just want to start, jump to the [Quick-start walkthrough](/_pages/canlab_help_1_installing_tools/canlab_help_1_installing_tools.html). The sections below explain the underlying requirements.## Requirements at a glance| Component | What you need | Notes ||-----------|---------------|-------|| Matlab | A recent release (R2019a or newer recommended) | Older releases may work but are not actively tested. || Matlab toolboxes | Statistics and Machine Learning, Signal Processing | Required by core CANlab functions. || SPM | SPM12 (free) | Used for image I/O and `spm_orthviews`. || Git | Any recent version | Optional but strongly recommended for updates. || Disk space | ~1–2 GB for the toolbox set, more for example datasets | Datasets in the walkthroughs may add several GB. |## Install MatlabInstall Matlab from the [Mathworks website](https://www.mathworks.com/). Free trial versions are available. The CANlab tools require two add-on toolboxes:- **Statistics and Machine Learning Toolbox**- **Signal Processing Toolbox**Some advanced walkthroughs (e.g. mixed-effects models) work better with the **Optimization Toolbox** as well, but it's not required for the core walkthroughs.## Install Statistical Parametric Mapping (SPM)The CANlab toolboxes use SPM's image reading/writing functions and the `spm_orthviews` viewer. SPM is a [free download](https://www.fil.ion.ucl.ac.uk/spm/). After unzipping, add the SPM folder to your Matlab path (`addpath`).## Install git and GitHubVersion control is optional here, but strongly recommended — it lets you pull updates with one command and contribute back. The fastest path:1. [Install git](https://git-scm.com/).2. (Optional, friendlier UI) [Install GitHub Desktop](https://docs.github.com/en/desktop/installing-and-configuring-github-desktop/installing-and-authenticating-to-github-desktop/installing-github-desktop).3. New to git? Try the [hello-world tutorial](https://docs.github.com/en/get-started/start-your-journey/hello-world). For day-to-day flow see the [GitHub flow guide](https://docs.github.com/en/get-started/using-github/github-flow) and the [git CLI essentials](https://dev.to/dhruv/essential-git-commands-every-developer-should-know-2fl).## Install the CANlab core toolsTwo options:1. **Download a .zip file** from each repository's GitHub page (simplest, but you won't get updates).2. **Clone with git** (recommended) — keeps you in sync with `git pull`.Start at [github.com/canlab/CanlabCore](https://github.com/canlab/CanlabCore):![canlabcore repo view](/images/canlabcore.png)Use the green **Code** button to either download a zip or copy a clone URL. You can repeat this for the other repositories, or use the quick-start walkthrough below to grab everything at once.## Quick-start walkthroughThere is a Matlab script in the [CanlabCore repository](https://github.com/canlab/CanlabCore) that downloads the repositories you need and adds them to your Matlab path. The walkthrough shows you how to use it:[Setup walkthrough →](/_pages/canlab_help_1_installing_tools/canlab_help_1_installing_tools.html)## RepositoriesThe CANlab imaging analysis tools are a set of linked repositories. Links and descriptions are on the [repositories page](/repositories/).## Troubleshooting| Symptom | First thing to check ||---------|----------------------|| `Undefined function or variable 'fmri_data'` | CanlabCore not on path. Run `which fmri_data` — if empty, re-run the install walkthrough. || `spm_vol` or `spm_read_vols` missing | SPM12 not on path. `addpath(genpath('path/to/spm12'))` and re-try. || Mac: \"developer cannot be verified\" on a SPM mex file | macOS quarantined the binary. From a terminal: `xattr -dr com.apple.quarantine /path/to/spm12`. || Path conflicts between SPM and other toolboxes | Run `which -all ` to see which copy Matlab finds first; reorder with `addpath`. || Walkthroughs fail to download example datasets | Check network/proxy, then try `load_image_set` from a fresh Matlab session. |If you get stuck, please open an issue on the relevant repository's GitHub page (most users will want [CanlabCore issues](https://github.com/canlab/CanlabCore/issues)). Include your Matlab version, OS, and the exact error text."
    },
    
  
    
    {
      "title"   : "Sitemap",
      "excerpt" : "",
      "category": "",
      "tags"    : "",
      "url"     : "/sitemap/",
      "content" : "{% include base_path %}A list of all the posts and pages found on the site. For you robots out there is an [XML version]({{ base_path }}/sitemap.xml) available for digesting as well.Pages{% for post in site.pages %} {% include archive-single.html %}{% endfor %}Posts{% for post in site.posts %} {% include archive-single.html %}{% endfor %}{% capture written_label %}'None'{% endcapture %}{% for collection in site.collections %}{% unless collection.output == false or collection.label == \"posts\" %} {% capture label %}{{ collection.label }}{% endcapture %} {% if label != written_label %} {{ label }} {% capture written_label %}{{ label }}{% endcapture %} {% endif %}{% endunless %}{% for post in collection.docs %} {% unless collection.output == false or collection.label == \"posts\" %} {% include archive-single.html %} {% endunless %}{% endfor %}{% endfor %}"
    },
    
  
    
    {
      "title"   : "Posts by Tags",
      "excerpt" : "",
      "category": "",
      "tags"    : "",
      "url"     : "/tags/",
      "content" : "{% include base_path %}{% include group-by-array collection=site.posts field=\"tags\" %}{% for tag in group_names %} {% assign posts = group_items[forloop.index0] %} {{ tag }} {% for post in posts %} {% include archive-single.html %} {% endfor %}{% endfor %}"
    },
    
  
    
    {
      "title"   : "Talk map",
      "excerpt" : "",
      "category": "",
      "tags"    : "",
      "url"     : "/talkmap.html",
      "content" : "This map is generated from a Jupyter Notebook file in /_talks/talkmap.ipynb, which mines the location fields in the .md files in _talks/."
    },
    
  
    
    {
      "title"   : "Talks and presentations",
      "excerpt" : "",
      "category": "",
      "tags"    : "",
      "url"     : "/talks/",
      "content" : "See a map of all the places I've given a talk!{% for post in site.talks reversed %} {% include archive-single-talk.html %}{% endfor %}"
    },
    
  
    
    {
      "title"   : "Teaching",
      "excerpt" : "",
      "category": "",
      "tags"    : "",
      "url"     : "/teaching/",
      "content" : "{% include base_path %}{% for post in site.teaching reversed %} {% include archive-single.html %}{% endfor %}"
    },
    
  
    
    {
      "title"   : "Terms and Privacy Policy",
      "excerpt" : "",
      "category": "",
      "tags"    : "",
      "url"     : "/terms/",
      "content" : "{% include base_path %}{% include toc %}## Privacy PolicyThe privacy of my visitors is extremely important. This Privacy Policy outlines the types of personal information that is received and collected and how it is used.First and foremost, I will never share your email address or any other personal information to anyone without your direct consent.### Log FilesLike many other websites, this site uses log files to help learn about when, from where, and how often traffic flows to this site. The information in these log files include:* Internet Protocol addresses (IP)* Types of browser* Internet Service Provider (ISP)* Date and time stamp* Referring and exit pages* Number of clicksAll of this information is not linked to anything that is personally identifiable.### Cookies and Web BeaconsWhen you visit this site \"convenience\" cookies are stored on your computer when you submit a comment to help you log in faster to [Disqus](http://disqus.com) the next time you leave a comment.Third-party advertisers may also place and read cookies on your browser and/or use web beacons to collect information. This site has no access or control over these cookies. You should review the respective privacy policies on any and all third-party ad servers for more information regarding their practices and how to opt-out.If you wish to disable cookies, you may do so through your web browser options. Instructions for doing so can be found on the specific web browsers' websites.#### Google AnalyticsGoogle Analytics is a web analytics tool I use to help understand how visitors engage with this website. It reports website trends using cookies and web beacons without identifying individual visitors. You can read [Google Analytics Privacy Policy](http://www.google.com/analytics/learn/privacy.html)."
    },
    
  
    
    {
      "title"   : "Object-oriented analysis walkthroughs",
      "excerpt" : "Code to run each walkthrough is included in the CANlab core toolbox or on Neurovault.",
      "category": "",
      "tags"    : "",
      "url"     : "/walkthroughs/",
      "content" : "{% include base_path %}This series of walkthroughs is designed to illustrate the CANlab interactive analysis tools, and some analysis principles as well. Code to run each walkthrough is included in the CANlab core toolbox or on Neurovault. See the main [CANlab intro page](/) for the philosophy behind the interactive analysis approach.These walkthroughs focus on **using CANlab code** and are not didactic. For more extensive explanation of fMRI concepts, see the [didactic tutorials](/tutorials) using Matlab live scripts.**Tip:** Use the [search page]({{ \"/search/\" | relative_url }}) to find a walkthrough by topic.## 1. Getting startedInstall the toolboxes, load a sample dataset, and learn the basic visualization and reporting commands.| # | Walkthrough | Live script ||---|-------------|-------------|| 1.1 | [Installing tools](/_pages/canlab_help_1_installing_tools/canlab_help_1_installing_tools.html) | || 1.2 | [Getting help](/_pages/canlab_help_1b_getting_help/canlab_help_1b_getting_help.html) | [.mlx](/_pages/canlab_help_1b_getting_help/canlab_help_1b_getting_help.mlx) || 1.3 | [Load a sample dataset](/_pages/canlab_help_2_load_a_sample_dataset/canlab_help_2_load_a_sample_dataset.html) | || 1.4 | [Basic image visualization](/_pages/canlab_help_2b_basic_image_visualization/canlab_help_2b_basic_image_visualization.html) | || 1.5 | [Loading datasets used in tutorials](/_pages/canlab_help_2c_loading_datasets/canlab_help_2c_loading_datasets.html) | || 1.6 | [Publishing results reports](/_pages/canlab_help_2d_publish_a_report/canlab_help_2d_publish_a_report.html) | || 1.7 | Basic Matlab debugging | [.mlx](/_pages/tutorials/matlab/basic_matlab_debugging.mlx) || 1.8 | [Voxel and image spaces in fmri_data objects](/_pages/Voxel_and_image_spaces_in_CANlab_fmri_data_objects.html) | [.mlx](/_pages/Voxel_and_image_spaces_in_CANlab_fmri_data_objects.mlx) |## 2. Basic analysesGroup statistics, ROI analysis, masking, surface rendering, and design matrices.| # | Walkthrough | Live script ||---|-------------|-------------|| 2.1 | [Group t-test](/_pages/canlab_help_3_voxelwise_t_test_walkthrough/canlab_help_3_voxelwise_t_test_walkthrough.html) | || 2.2 | [Atlases and ROI analysis](/_pages/canlab_help_3b_atlases_and_ROI_analysis/canlab_help_3b_atlases_and_ROI_analysis.html) | || 2.3 | [Masking and writing NIfTI image files](/_pages/canlab_help_4_masking_and_writing_nifti_files/canlab_help_4_masking_and_writing_nifti_files.html) | || 2.4 | [3-D visualization on brain surfaces](/_pages/canlab_help_4b_3D_visualization/canlab_help_4b_3D_visualization.html) | || 2.5 | [Create and explore 1st-level design matrices](/_pages/first_level_design_matrix_exploration/first_level_design_matrix_exploration.html) | || 2.6 | [Regression — interactive analysis](/_pages/canlab_help_5_regression_walkthrough/canlab_help_5_regression_walkthrough.html) | || 2.7 | [Interpreting maps with Neurosynth topic similarity and wedge plots](/_pages/neurosynth_topic_similarity_and_wedge_plot/neurosynth_topic_similarity_and_wedge_plot.html) | || 2.8 | [Annotating a results map (gradients, neurochemical maps, networks, Neurosynth topics)](/_pages/canlab_help_annotate_thresholded_results_map/canlab_help_annotate_thresholded_results_map.html) | |## 3. Multivariate predictive modelsCross-validated multivariate prediction, applying signature patterns, and Bayesian results.| # | Walkthrough | Live script ||---|-------------|-------------|| 3.1 | [Multivariate prediction with continuous outcomes](/_pages/canlab_help_7_multivariate_prediction_basics/canlab_help_7_multivariate_prediction_basics.html) | || 3.2 | Effect sizes with SVMs *(in progress)* | || 3.3 | [Apply a multivariate pattern of interest](/_pages/canlab_help_9_apply_a_multivariate_pattern_of_interest/canlab_help_9_apply_a_multivariate_pattern_of_interest.html) | || 3.4 | [Bayes Factor maps](/_pages/EmoReg_BayesFactor_walkthrough/EmoReg_BayesFactor_walkthrough.html) | || 3.5 | [Interpreting maps with riverplots](/_pages/canlab_help_8_riverplot_cerebellar_atlas_example.m/canlab_help_8_riverplot_cerebellar_atlas_example.html) | |## 4. Mediation analysisSingle- and multi-level mediation effect parametric mapping (the M3 toolbox).| # | Walkthrough | Live script ||---|-------------|-------------|| 4.1 | [Mediation and M3 Toolbox basics](/_pages/tutorials/html/mediation_1_basics.html) | [.mlx](/_pages/tutorials/matlab/mediation_1_basics.mlx) || 4.2 | [Single-level Mediation Effect Parametric Mapping (fMRI)](/_pages/tutorials/html/mediation_brain_single_level_walkthrough1.html) | [.mlx](/_pages/tutorials/matlab/mediation_brain_single_level_walkthrough1.mlx) || 4.2b | [Sample MEPM report from publish_mediation_report.m](/_pages/mediation_brain_sample_report/mediation_brain_results_report.html) | || 4.3 | [Multilevel Mediation Effect Mapping (fMRI)](/_pages/tutorials/html/mediation_brain_multilevel_walkthrough1.html) | [.mlx](/_pages/tutorials/matlab/mediation_brain_multilevel_walkthrough1.mlx) |## 5. Coordinate-based meta-analysisMKDA-style meta-analysis of published activation coordinates.| # | Walkthrough | Live script ||---|-------------|-------------|| 5.1 | [MKDA meta-analysis 1](/_pages/canlab_meta_analysis_walkthrough1.m/canlab_meta_analysis_walkthrough1.html) | |## 6. Multivariate Pathway Identification (MPathI) and connectivityPrepare time-series data and run multivariate pathway identification.| # | Walkthrough | Live script ||---|-------------|-------------|| 6.1 | [Prep time-series data for connectivity](/_pages/tutorials/html/canlab_help_prep_for_connectivity.html) | [.mlx](/_pages/tutorials/matlab/canlab_help_prep_for_connectivity.mlx) || 6.2 | [MPathI pathway dissociation](/_pages/tutorials/html/canlab_help_MPathI_multivariate_pathway.html) | [.mlx](/_pages/tutorials/matlab/canlab_help_MPathI_multivariate_pathway.mlx) |## 7. Visualization extrasAdditional brain-rendering and surface-projection examples.| # | Walkthrough | Live script ||---|-------------|-------------|| 7.1 | [More visualization](/_pages/visualize_neuroimaging_data/visualize_neuroimaging_data.html) | || 7.2 | [Surface rendering](/_pages/canlab_help_surface_projection/mnisurf_projection_tutorial.html) | || 7.3 | [CANlab single-trials demo](/_pages/canlab_single_trials_demo/demo_norming_comparison.html) | |## 8. Behavioral data and plotsWorking with the canlab_dataset object and generating publication plots.| # | Walkthrough | Live script ||---|-------------|-------------|| 8.1 | [The canlab_dataset object](/_pages/canlab_dataset_basic_usage/canlab_dataset_basic_usage.html) | || 8.2 | [Time series and bar plots](/_pages/atlas_2012_behavioral_plot_example_figure/atlas_2012_behavioral_plot_example_figure.html) | || 8.3 | [Mixed-effects models with glmfit_multilevel](/_pages/canlab_mixed_model_example/canlab_mixed_model_example.html) | |## 9. In progress (advanced)These tutorials are works in progress and of primary interest to advanced users.| # | Walkthrough | Live script ||---|-------------|-------------|| 9.1 | [Within- and between-subject components of PCR models](/_pages/mlpcr_demo/mlpcr_demo.html) | || 9.2 | [Building ML pipelines with CANlab tools](/_pages/canlab_pipelines_walkthrough/estimateBestRegionPerformance.html) | || 9.3 | [Understanding the CANlab atlases object](/_pages/using_canlab_atlases/using_canlab_atlases.html) | |"
    },
    
  
    
    {
      "title"   : "Blog posts",
      "excerpt" : "",
      "category": "",
      "tags"    : "",
      "url"     : "/year-archive/",
      "content" : "{% include base_path %}{% capture written_year %}'None'{% endcapture %}{% for post in site.posts %} {% capture year %}{{ post.date | date: '%Y' }}{% endcapture %} {% if year != written_year %} {{ year }} {% capture written_year %}{{ year }}{% endcapture %} {% endif %} {% include archive-single.html %}{% endfor %}"
    },
    
  
    
  
    
  
    
  
    
  
    
  
    
  
    
  
    
  
    
    {
      "title"   : "Jupyter notebook markdown generator",
      "excerpt" : "",
      "category": "",
      "tags"    : "",
      "url"     : "/markdown_generator/",
      "content" : "# Jupyter notebook markdown generatorThese .ipynb files are Jupyter notebook files that convert a TSV containing structured data about talks (`talks.tsv`) or presentations (`presentations.tsv`) into individual markdown files that will be properly formatted for the academicpages template. The notebooks contain a lot of documentation about the process. The .py files are pure python that do the same things if they are executed in a terminal, they just don't have pretty documentation."
    },
    
  
    
  
    
  
    
  
    
    {
      "title"   : "Blog Post number 4",
      "excerpt" : "This is a sample blog post. Lorem ipsum I can’t remember the rest of lorem ipsum and don’t have an internet connection right now. Testing testing testing this blog post. Blog posts are cool.",
      "category": "",
      "tags"    : "cool posts, category1, category2",
      "url"     : "/posts/2012/08/blog-post-4/",
      "content" : "This is a sample blog post. Lorem ipsum I can’t remember the rest of lorem ipsum and don’t have an internet connection right now. Testing testing testing this blog post. Blog posts are cool.Headings are coolYou can have many headingsAren’t headings cool?"
    },
    
  
    
    {
      "title"   : "Blog Post number 3",
      "excerpt" : "This is a sample blog post. Lorem ipsum I can’t remember the rest of lorem ipsum and don’t have an internet connection right now. Testing testing testing this blog post. Blog posts are cool.",
      "category": "",
      "tags"    : "cool posts, category1, category2",
      "url"     : "/posts/2014/08/blog-post-3/",
      "content" : "This is a sample blog post. Lorem ipsum I can’t remember the rest of lorem ipsum and don’t have an internet connection right now. Testing testing testing this blog post. Blog posts are cool.Headings are coolYou can have many headingsAren’t headings cool?"
    },
    
  
    
    {
      "title"   : "Blog Post number 2",
      "excerpt" : "This is a sample blog post. Lorem ipsum I can’t remember the rest of lorem ipsum and don’t have an internet connection right now. Testing testing testing this blog post. Blog posts are cool.",
      "category": "",
      "tags"    : "cool posts, category1, category2",
      "url"     : "/posts/2013/08/blog-post-2/",
      "content" : "This is a sample blog post. Lorem ipsum I can’t remember the rest of lorem ipsum and don’t have an internet connection right now. Testing testing testing this blog post. Blog posts are cool.Headings are coolYou can have many headingsAren’t headings cool?"
    },
    
  
    
    {
      "title"   : "Blog Post number 1",
      "excerpt" : "This is a sample blog post. Lorem ipsum I can’t remember the rest of lorem ipsum and don’t have an internet connection right now. Testing testing testing this blog post. Blog posts are cool.",
      "category": "",
      "tags"    : "cool posts, category1, category2",
      "url"     : "/posts/2012/08/blog-post-1/",
      "content" : "This is a sample blog post. Lorem ipsum I can’t remember the rest of lorem ipsum and don’t have an internet connection right now. Testing testing testing this blog post. Blog posts are cool.Headings are coolYou can have many headingsAren’t headings cool?"
    },
    
  
    
    {
      "title"   : "Teaching experience 1",
      "excerpt" : "This is a description of a teaching experience. You can use markdown like any other post.",
      "category": "",
      "tags"    : "",
      "url"     : "/teaching/2014-spring-teaching-1",
      "content" : "This is a description of a teaching experience. You can use markdown like any other post.Heading 1Heading 2Heading 3"
    },
    
  
    
    {
      "title"   : "Teaching experience 2",
      "excerpt" : "This is a description of a teaching experience. You can use markdown like any other post.",
      "category": "",
      "tags"    : "",
      "url"     : "/teaching/2015-spring-teaching-1",
      "content" : "This is a description of a teaching experience. You can use markdown like any other post.Heading 1Heading 2Heading 3"
    },
    
  
    
    {
      "title"   : "Paper Title Number 1",
      "excerpt" : "This paper is about the number 1. The number 2 is left for future work.",
      "category": "",
      "tags"    : "",
      "url"     : "/publication/2009-10-01-paper-title-number-1",
      "content" : "This paper is about the number 1. The number 2 is left for future work.Download paper hereRecommended citation: Your Name, You. (2009). “Paper Title Number 1.” Journal 1. 1(1)."
    },
    
  
    
    {
      "title"   : "Paper Title Number 2",
      "excerpt" : "This paper is about the number 2. The number 3 is left for future work.",
      "category": "",
      "tags"    : "",
      "url"     : "/publication/2010-10-01-paper-title-number-2",
      "content" : "This paper is about the number 2. The number 3 is left for future work.Download paper hereRecommended citation: Your Name, You. (2010). “Paper Title Number 2.” Journal 1. 1(2)."
    },
    
  
    
    {
      "title"   : "Paper Title Number 3",
      "excerpt" : "This paper is about the number 3. The number 4 is left for future work.",
      "category": "",
      "tags"    : "",
      "url"     : "/publication/2015-10-01-paper-title-number-3",
      "content" : "This paper is about the number 3. The number 4 is left for future work.Download paper hereRecommended citation: Your Name, You. (2015). “Paper Title Number 3.” Journal 1. 1(3)."
    },
    
  
    
  
    
  
    
    {
      "title"   : "Talk 1 on Relevant Topic in Your Field",
      "excerpt" : "This is a description of your talk, which is a markdown files that can be all markdown-ified like any other post. Yay markdown!",
      "category": "",
      "tags"    : "",
      "url"     : "/talks/2012-03-01-talk-1",
      "content" : "This is a description of your talk, which is a markdown files that can be all markdown-ified like any other post. Yay markdown!"
    },
    
  
    
    {
      "title"   : "Tutorial 1 on Relevant Topic in Your Field",
      "excerpt" : "More information here",
      "category": "",
      "tags"    : "",
      "url"     : "/talks/2013-03-01-tutorial-1",
      "content" : "More information hereThis is a description of your tutorial, note the different field in type. This is a markdown files that can be all markdown-ified like any other post. Yay markdown!"
    },
    
  
    
    {
      "title"   : "Talk 2 on Relevant Topic in Your Field",
      "excerpt" : "More information here",
      "category": "",
      "tags"    : "",
      "url"     : "/talks/2014-02-01-talk-2",
      "content" : "More information hereThis is a description of your talk, which is a markdown files that can be all markdown-ified like any other post. Yay markdown!"
    },
    
  
    
    {
      "title"   : "Conference Proceeding talk 3 on Relevant Topic in Your Field",
      "excerpt" : "This is a description of your conference proceedings talk, note the different field in type. You can put anything in this field.",
      "category": "",
      "tags"    : "",
      "url"     : "/talks/2014-03-01-talk-3",
      "content" : "This is a description of your conference proceedings talk, note the different field in type. You can put anything in this field."
    }
    
  
]
