My Emotion Regulation Analysis

By Tor
This Live Script follows the CANlab walkthrough demo found here.
For more examples and code walkthroughs, see
https://canlab.github.io/walkthroughs/
Table of Contents

Set up the CANlab tools and your Matlab path

If you are starting with a fresh copy of CANlab tools and/or Matlab and don't have the CANlab functions on your path, you'll need to get them from Github here.
For more details, see https://canlab.github.io/setup/
You'll want the CanlabCore and Neuroimaging_Pattern_Masks repositories for this.
I used the code below to add them to my Matlab path with subfolders. You'll have to customize the file location for your local computer:
cd('/Users/f003vz1/Documents/GitHub/CanlabCore')
g = genpath(pwd);
addpath(g);
 
cd('/Users/f003vz1/Documents/GitHub/Neuroimaging_Pattern_Masks')
g = genpath(pwd);
addpath(g);
savepath

Load the data

img_obj = load_image_set('emotionreg'); % Load a dataset
Loaded images: /Users/f003vz1/Documents/GitHub/CanlabCore/CanlabCore/Sample_datasets/Wager_et_al_2008_Neuron_EmotionReg/Wager_2008_emo_reg_vs_look_neg_contrast_images.nii /Users/f003vz1/Documents/GitHub/CanlabCore/CanlabCore/Sample_datasets/Wager_et_al_2008_Neuron_EmotionReg/Wager_2008_emo_reg_vs_look_neg_contrast_images.nii /Users/f003vz1/Documents/GitHub/CanlabCore/CanlabCore/Sample_datasets/Wager_et_al_2008_Neuron_EmotionReg/Wager_2008_emo_reg_vs_look_neg_contrast_images.nii /Users/f003vz1/Documents/GitHub/CanlabCore/CanlabCore/Sample_datasets/Wager_et_al_2008_Neuron_EmotionReg/Wager_2008_emo_reg_vs_look_neg_contrast_images.nii /Users/f003vz1/Documents/GitHub/CanlabCore/CanlabCore/Sample_datasets/Wager_et_al_2008_Neuron_EmotionReg/Wager_2008_emo_reg_vs_look_neg_contrast_images.nii /Users/f003vz1/Documents/GitHub/CanlabCore/CanlabCore/Sample_datasets/Wager_et_al_2008_Neuron_EmotionReg/Wager_2008_emo_reg_vs_look_neg_contrast_images.nii /Users/f003vz1/Documents/GitHub/CanlabCore/CanlabCore/Sample_datasets/Wager_et_al_2008_Neuron_EmotionReg/Wager_2008_emo_reg_vs_look_neg_contrast_images.nii /Users/f003vz1/Documents/GitHub/CanlabCore/CanlabCore/Sample_datasets/Wager_et_al_2008_Neuron_EmotionReg/Wager_2008_emo_reg_vs_look_neg_contrast_images.nii /Users/f003vz1/Documents/GitHub/CanlabCore/CanlabCore/Sample_datasets/Wager_et_al_2008_Neuron_EmotionReg/Wager_2008_emo_reg_vs_look_neg_contrast_images.nii /Users/f003vz1/Documents/GitHub/CanlabCore/CanlabCore/Sample_datasets/Wager_et_al_2008_Neuron_EmotionReg/Wager_2008_emo_reg_vs_look_neg_contrast_images.nii /Users/f003vz1/Documents/GitHub/CanlabCore/CanlabCore/Sample_datasets/Wager_et_al_2008_Neuron_EmotionReg/Wager_2008_emo_reg_vs_look_neg_contrast_images.nii /Users/f003vz1/Documents/GitHub/CanlabCore/CanlabCore/Sample_datasets/Wager_et_al_2008_Neuron_EmotionReg/Wager_2008_emo_reg_vs_look_neg_contrast_images.nii /Users/f003vz1/Documents/GitHub/CanlabCore/CanlabCore/Sample_datasets/Wager_et_al_2008_Neuron_EmotionReg/Wager_2008_emo_reg_vs_look_neg_contrast_images.nii /Users/f003vz1/Documents/GitHub/CanlabCore/CanlabCore/Sample_datasets/Wager_et_al_2008_Neuron_EmotionReg/Wager_2008_emo_reg_vs_look_neg_contrast_images.nii /Users/f003vz1/Documents/GitHub/CanlabCore/CanlabCore/Sample_datasets/Wager_et_al_2008_Neuron_EmotionReg/Wager_2008_emo_reg_vs_look_neg_contrast_images.nii /Users/f003vz1/Documents/GitHub/CanlabCore/CanlabCore/Sample_datasets/Wager_et_al_2008_Neuron_EmotionReg/Wager_2008_emo_reg_vs_look_neg_contrast_images.nii /Users/f003vz1/Documents/GitHub/CanlabCore/CanlabCore/Sample_datasets/Wager_et_al_2008_Neuron_EmotionReg/Wager_2008_emo_reg_vs_look_neg_contrast_images.nii /Users/f003vz1/Documents/GitHub/CanlabCore/CanlabCore/Sample_datasets/Wager_et_al_2008_Neuron_EmotionReg/Wager_2008_emo_reg_vs_look_neg_contrast_images.nii /Users/f003vz1/Documents/GitHub/CanlabCore/CanlabCore/Sample_datasets/Wager_et_al_2008_Neuron_EmotionReg/Wager_2008_emo_reg_vs_look_neg_contrast_images.nii /Users/f003vz1/Documents/GitHub/CanlabCore/CanlabCore/Sample_datasets/Wager_et_al_2008_Neuron_EmotionReg/Wager_2008_emo_reg_vs_look_neg_contrast_images.nii /Users/f003vz1/Documents/GitHub/CanlabCore/CanlabCore/Sample_datasets/Wager_et_al_2008_Neuron_EmotionReg/Wager_2008_emo_reg_vs_look_neg_contrast_images.nii /Users/f003vz1/Documents/GitHub/CanlabCore/CanlabCore/Sample_datasets/Wager_et_al_2008_Neuron_EmotionReg/Wager_2008_emo_reg_vs_look_neg_contrast_images.nii /Users/f003vz1/Documents/GitHub/CanlabCore/CanlabCore/Sample_datasets/Wager_et_al_2008_Neuron_EmotionReg/Wager_2008_emo_reg_vs_look_neg_contrast_images.nii /Users/f003vz1/Documents/GitHub/CanlabCore/CanlabCore/Sample_datasets/Wager_et_al_2008_Neuron_EmotionReg/Wager_2008_emo_reg_vs_look_neg_contrast_images.nii /Users/f003vz1/Documents/GitHub/CanlabCore/CanlabCore/Sample_datasets/Wager_et_al_2008_Neuron_EmotionReg/Wager_2008_emo_reg_vs_look_neg_contrast_images.nii /Users/f003vz1/Documents/GitHub/CanlabCore/CanlabCore/Sample_datasets/Wager_et_al_2008_Neuron_EmotionReg/Wager_2008_emo_reg_vs_look_neg_contrast_images.nii /Users/f003vz1/Documents/GitHub/CanlabCore/CanlabCore/Sample_datasets/Wager_et_al_2008_Neuron_EmotionReg/Wager_2008_emo_reg_vs_look_neg_contrast_images.nii /Users/f003vz1/Documents/GitHub/CanlabCore/CanlabCore/Sample_datasets/Wager_et_al_2008_Neuron_EmotionReg/Wager_2008_emo_reg_vs_look_neg_contrast_images.nii /Users/f003vz1/Documents/GitHub/CanlabCore/CanlabCore/Sample_datasets/Wager_et_al_2008_Neuron_EmotionReg/Wager_2008_emo_reg_vs_look_neg_contrast_images.nii /Users/f003vz1/Documents/GitHub/CanlabCore/CanlabCore/Sample_datasets/Wager_et_al_2008_Neuron_EmotionReg/Wager_2008_emo_reg_vs_look_neg_contrast_images.nii
 
plot(img_obj)
______________________________________________________________ Outlier analysis ______________________________________________________________ global mean | global mean to var | spatial MAD | Missing values | 0 images Retained 3 components for mahalanobis distance Expected 50% of points within 50% normal ellipsoid, found 23.33% Expected 1.50 outside 95% ellipsoid, found 3 Potential outliers based on mahalanobis distance: Bonferroni corrected: 1 images Cases 12 Uncorrected: 3 images Cases 11 12 16 Retained 10 components for mahalanobis distance Expected 50% of points within 50% normal ellipsoid, found 43.33% Expected 1.50 outside 95% ellipsoid, found 1 Potential outliers based on mahalanobis distance: Bonferroni corrected: 0 images Cases Uncorrected: 1 images Cases 27 Mahalanobis (cov and corr, q<0.05 corrected): 1 images Outlier_count Percentage _____________ __________ global_mean 2 6.6667 global_mean_to_variance 1 3.3333 missing_values 0 0 rmssd_dvars 0 0 spatial_variability 0 0 mahal_cov_uncor 3 10 mahal_cov_corrected 1 3.3333 mahal_corr_uncor 1 3.3333 mahal_corr_corrected 0 0 Overall_uncorrected 4 13.333 Overall_corrected 1 3.3333
SPM12: spm_check_registration (v7759) 18:25:48 - 03/08/2022 ======================================================================== Display /Users/f003vz1/Documents/GitHub/CanlabCore/CanlabCore/canlab_canonical_brains/Canonical_brains_surfaces/keuken_2014_enhanced_for_underlay.img,1 (all) /Users/f003vz1/Documents/GitHub/CanlabCore/CanlabCore/canlab_canonical_brains/Canonical_brains_surfaces/keuken_2014_enhanced_for_underlay.img,1 /Users/f003vz1/Documents/GitHub/CanlabCore/CanlabCore/canlab_canonical_brains/Canonical_brains_surfaces/keuken_2014_enhanced_for_underlay.img,1 Grouping contiguous voxels: 1 regions Grouping contiguous voxels: 1 regions Grouping contiguous voxels: 1 regions
ans = 30×1 logical array
0 0 0 0 0 0 0 0 0 0

Run the t-test and threshold

t = ttest(img_obj); % Do a group t-test
One-sample t-test Calculating t-statistics and p-values
t = threshold(t, .05, 'fdr', 'k', 10); % Threshold with FDR q < .05 and extent threshold of 10 contiguous voxels
Image 1 FDR q < 0.050 threshold is 0.003063 Image 1 9 contig. clusters, sizes 12 to 1397 Positive effect: 2128 voxels, min p-value: 0.00000000 Negative effect: 32 voxels, min p-value: 0.00022793

Show the results

% Show regions and print a table with labeled regions:
figure; axis off
montage(t); drawnow, snapnow; % Show results on a slice display
Setting up fmridisplay objects sagittal montage: 27 voxels displayed, 2133 not displayed on these slices sagittal montage: 97 voxels displayed, 2063 not displayed on these slices sagittal montage: 76 voxels displayed, 2084 not displayed on these slices axial montage: 694 voxels displayed, 1466 not displayed on these slices axial montage: 786 voxels displayed, 1374 not displayed on these slices
 
Make a table in which each region is auto-labeled according to a set of published atlases. References for atlases are included in the table output, but can be suppressed.
r = region(t); % Turn t-map into a region object with one element per contig region
Grouping contiguous voxels: 9 regions
table(r); % Print a table of results using new region names
____________________________________________________________________________________________________________________________________________ Positive Effects Region Volume XYZ maxZ modal_label_descriptions Perc_covered_by_label Atlas_regions_covered region_index ____________________ __________ _________________ ______ ___________________________ _____________________ _____________________ ____________ {'Ctx_TE1a_R' } 10344 55 0 -27 4.6702 {'Cortex_Default_ModeA' } 29 2 1 {'Multiple regions'} 49016 52 -55 23 5.9923 {'Cortex_Default_ModeA' } 9 11 3 {'Ctx_TE1a_L' } 5824 -62 -7 -23 4.5214 {'Cortex_Default_ModeB' } 51 1 2 {'Multiple regions'} 1.3349e+05 28 24 36 7.0345 {'Cortex_Default_ModeB' } 4 39 4 {'Ctx_47l_L' } 2784 -55 31 -9 4.2363 {'Cortex_Default_ModeB' } 40 1 5 {'Ctx_9a_L' } 4416 -24 52 27 3.8657 {'Cortex_Default_ModeB' } 36 1 7 {'Multiple regions'} 17832 -48 21 27 4.9536 {'Cortex_Fronto_ParietalA'} 12 8 6 Negative Effects Region Volume XYZ maxZ modal_label_descriptions Perc_covered_by_label Atlas_regions_covered region_index ________________ ______ ________________ _______ ____________________________ _____________________ _____________________ ____________ {'Bstem_Pons_L'} 2160 0 -24 -50 -4.2063 {'Brainstem' } 20 0 8 {'Ctx_ProS_R' } 2832 28 -48 9 -3.7265 {'Cortex_Visual_Peripheral'} 12 0 9 ____________________________________________________________________________________________________________________________________________ Regions labeled by reference atlas CANlab_2018_combined Volume: Volume of contiguous region in cubic mm. MaxZ: Signed max over T Atlas_regions_covered: Number of reference atlas regions covered at least 25% by the region. This relates to whether the region covers multiple reference atlas regions Region: Best reference atlas label, defined as reference region with highest number of in-region voxels. Regions covering >25% of >5 regions labeled as "Multiple regions" Perc_covered_by_label: Percentage of the region covered by the label. Ref_region_perc: Percentage of the label region within the target region. modal_atlas_index: Index number of label region in reference atlas all_regions_covered: All regions covered >5% in descending order of importance For example, if a region is labeled 'TE1a' and Perc_covered_by_label = 8, Ref_region_perc = 38, and Atlas_regions_covered = 17, this means that 8% of the region's voxels are labeled TE1a, which is the highest percentage among reference label regions. 38% of the region TE1a is covered by the region. However, the region covers at least 25% of 17 distinct labeled reference regions. References for atlases: Beliveau, Vincent, Claus Svarer, Vibe G. Frokjaer, Gitte M. Knudsen, Douglas N. Greve, and Patrick M. Fisher. 2015. “Functional Connectivity of the Dorsal and Median Raphe Nuclei at Rest.” NeuroImage 116 (August): 187–95. Bär, Karl-Jürgen, Feliberto de la Cruz, Andy Schumann, Stefanie Koehler, Heinrich Sauer, Hugo Critchley, and Gerd Wagner. 2016. ?Functional Connectivity and Network Analysis of Midbrain and Brainstem Nuclei.? NeuroImage 134 (July):53?63. Diedrichsen, Jörn, Joshua H. Balsters, Jonathan Flavell, Emma Cussans, and Narender Ramnani. 2009. A Probabilistic MR Atlas of the Human Cerebellum. NeuroImage 46 (1): 39?46. Fairhurst, Merle, Katja Wiech, Paul Dunckley, and Irene Tracey. 2007. ?Anticipatory Brainstem Activity Predicts Neural Processing of Pain in Humans.? Pain 128 (1-2):101?10. Fan 2016 Cerebral Cortex; doi:10.1093/cercor/bhw157 Glasser, Matthew F., Timothy S. Coalson, Emma C. Robinson, Carl D. Hacker, John Harwell, Essa Yacoub, Kamil Ugurbil, et al. 2016. A Multi-Modal Parcellation of Human Cerebral Cortex. Nature 536 (7615): 171?78. Keren, Noam I., Carl T. Lozar, Kelly C. Harris, Paul S. Morgan, and Mark A. Eckert. 2009. “In Vivo Mapping of the Human Locus Coeruleus.” NeuroImage 47 (4): 1261–67. Keuken, M. C., P-L Bazin, L. Crown, J. Hootsmans, A. Laufer, C. Müller-Axt, R. Sier, et al. 2014. “Quantifying Inter-Individual Anatomical Variability in the Subcortex Using 7 T Structural MRI.” NeuroImage 94 (July): 40–46. Krauth A, Blanc R, Poveda A, Jeanmonod D, Morel A, Székely G. (2010) A mean three-dimensional atlas of the human thalamus: generation from multiple histological data. Neuroimage. 2010 Feb 1;49(3):2053-62. Jakab A, Blanc R, Berényi EL, Székely G. (2012) Generation of Individualized Thalamus Target Maps by Using Statistical Shape Models and Thalamocortical Tractography. AJNR Am J Neuroradiol. 33: 2110-2116, doi: 10.3174/ajnr.A3140 Nash, Paul G., Vaughan G. Macefield, Iven J. Klineberg, Greg M. Murray, and Luke A. Henderson. 2009. ?Differential Activation of the Human Trigeminal Nuclear Complex by Noxious and Non-Noxious Orofacial Stimulation.? Human Brain Mapping 30 (11):3772?82. Pauli 2018 Bioarxiv: CIT168 from Human Connectome Project data Pauli, Wolfgang M., Amanda N. Nili, and J. Michael Tyszka. 2018. ?A High-Resolution Probabilistic in Vivo Atlas of Human Subcortical Brain Nuclei.? Scientific Data 5 (April): 180063. Pauli, Wolfgang M., Randall C. O?Reilly, Tal Yarkoni, and Tor D. Wager. 2016. ?Regional Specialization within the Human Striatum for Diverse Psychological Functions.? Proceedings of the National Academy of Sciences of the United States of America 113 (7): 1907?12. Sclocco, Roberta, Florian Beissner, Gaelle Desbordes, Jonathan R. Polimeni, Lawrence L. Wald, Norman W. Kettner, Jieun Kim, et al. 2016. ?Neuroimaging Brainstem Circuitry Supporting Cardiovagal Response to Pain: A Combined Heart Rate Variability/ultrahigh-Field (7 T) Functional Magnetic Resonance Imaging Study.? Philosophical Transactions. Series A, Mathematical, Physical, and Engineering Sciences 374 (2067). rsta.royalsocietypublishing.org. https://doi.org/10.1098/rsta.2015.0189. Shen, X., F. Tokoglu, X. Papademetris, and R. T. Constable. 2013. “Groupwise Whole-Brain Parcellation from Resting-State fMRI Data for Network Node Identification.” NeuroImage 82 (November): 403–15. Zambreanu, L., R. G. Wise, J. C. W. Brooks, G. D. Iannetti, and I. Tracey. 2005. ?A Role for the Brainstem in Central Sensitisation in Humans. Evidence from Functional Magnetic Resonance Imaging.? Pain 114 (3):397?407. Note: Region object r(i).title contains full list of reference atlas regions covered by each cluster. ____________________________________________________________________________________________________________________________________________
Notes:
Look at that DMPFC region! Reminds me of the Kalisch et al. meta-analysis
There is one likely outlier with whole-brain deactivation that we might want to check

Extended surface plots

Let's look at a couple of other surface plots.
surface(t);
ans =
Light with properties: Color: [1 1 1] Style: 'infinite' Position: [1.4142 -8.6596e-17 0] Visible: on Show all properties
Anatomical image: Adapted from the 7T high-resolution atlas of Keuken, Forstmann et al. Keuken et al. (2014). Quantifying inter-individual anatomical variability in the subcortex using 7T structural MRI. Forstmann, Birte U., Max C. Keuken, Andreas Schafer, Pierre-Louis Bazin, Anneke Alkemade, and Robert Turner. 2014. ?Multi-Modal Ultra-High Resolution Structural 7-Tesla MRI Data Repository.? Scientific Data 1 (December): 140050.
figure; axis off
surface(t, 'foursurfaces');
lightRestoreSingle;
 
figure; axis off
surface(t, 'coronal_slabs');
Anatomical image: Adapted from the 7T high-resolution atlas of Keuken, Forstmann et al. Keuken et al. (2014). Quantifying inter-individual anatomical variability in the subcortex using 7T structural MRI. Forstmann, Birte U., Max C. Keuken, Andreas Schafer, Pierre-Louis Bazin, Anneke Alkemade, and Robert Turner. 2014. ?Multi-Modal Ultra-High Resolution Structural 7-Tesla MRI Data Repository.? Scientific Data 1 (December): 140050.
 
Final note:
There are many other views and types of interactive surfaces. The idea is that it's a flexible toolkit that you can customize for your needs.
For example, addbrain( ) is a function that lets you plot many surfaces, and render blobs in color on those surfaces.
I recommend you run the code below line-by-line to get a sense of what each is doing. This is a pointer to doing more flexible things with the tools and Matlab's "handle graphics" system.
figure;
handles = addbrain('midbrain_group');
set(handles(1), 'FaceColor', [1 .5 .7], 'FaceAlpha', 1);
set(handles, 'FaceColor', [1 .5 .7], 'FaceAlpha', 1);
 
handles = [handles addbrain('hires left')];
set(handles, 'FaceColor', [1 .5 .7], 'FaceAlpha', 1);
 
help t.surface % shows options
surface(t, 'surface_handles', handles);