Skip to main content

METHODS article

Front. Hum. Neurosci., 07 July 2022
Sec. Brain Imaging and Stimulation
This article is part of the Research Topic Advanced Neuroimaging Methods in Brain Disorders: Volume II View all 7 articles

SPAMRI: A MATLAB Toolbox for Surface-Based Processing and Analysis of Magnetic Resonance Imaging

  • Sleep and NeuroImaging Center, Faculty of Psychology, Southwest University, Chongqing, China

Structural magnetic resonance imaging (MRI) has elicited increasing attention in morphological surface studies due to its stability and sensitivity to neurodegenerative processes, particularly in exploring brain aging and psychiatric disease. However, a user-friendly toolbox for the surface-based analysis of structural MRI is still lacking. On the basis of certain software functions in FreeSurfer, CAT and ANTs, a MATLAB toolbox called “surface-based processing and analysis of MRI” (SPAMRI) has been developed, which can be performed in Windows, Linux and Mac-OS. SPAMRI contains several features as follows: (1) open-source MATLAB-based package with a graphical user interface (GUI); (2) a set of images that can be generated for quality checking, such as Talairach transform, skull strip, and surface reconstruction; (3) user-friendly GUI with capabilities on statistical analysis, multiple comparison corrections, reporting of results, and surface measurement extraction; and (4) provision of a conversion tool between surface files (e.g., mesh files) and volume files (e.g., NIFTI files). SPAMRI is applied to a publicly released structural MRI dataset of 44 healthy young adults and 39 old adults. Findings showed that old people have decreased cortical thickness, especially in prefrontal cortex, relative to those of young adults, thereby suggesting a cognitive decline in the former. SPAMRI is anticipated to substantially simplify surface-based image processing and MRI dataset analyses and subsequently open new opportunities to investigate structural morphologies.

Introduction

Structural magnetic resonance imaging (MRI) is a non-invasive technique and has been widely used because of its high-contrast sensitivity and spatial resolution and allowance for the accurate measurement of brain structures. MRI is considered a powerful tool for investigating the anatomy and pathology of the brain (He et al., 2007; Hibar et al., 2016; Tessitore et al., 2016; Magon et al., 2018; Matsuo et al., 2019). Currently, volume and surface measurements are widely used in brain morphometric studies.

Volume-based morphometric measurement is an important aspect of voxel-based morphology (VBM) (Ashburner and Friston, 2000, 2001; Mechelli et al., 2005). VBM analysis calculates the gray/white matter concentration or absolute volumes of a voxel according to unmodulated or modulated methods, respectively. It has wide application in exploring aging and brain diseases (Good et al., 2001; Matsuda, 2013; Hibar et al., 2016; Gennatas et al., 2017; Matsuo et al., 2019). However, the interpretation of VBM results is somewhat ambiguous. At the basic level, group differences in gray matter volume are not only caused by independent changes in surface area and cortical thickness but also by the degree and pattern changes of folding. Therefore, changes in gray matter volume do not specifically correspond to any single morphological change.

Surface-based morphometric measurements, including those for cortical thickness, surface area, and folding, are computed on the basis of the cerebral cortex (Fischl and Dale, 2000). Each of these measurements is governed by different developmental processes (Wierenga et al., 2014). For example, surface area expansion can be associated with increased number of cortical columns (i.e., referring to a group of neurons that encode similar features, and these columns are oriented perpendicularly to the cortical surface), whereas increased cortical thickness can be assumed to be related to changes in the neuronal microcircuitry within a column (Fjell et al., 2015). Furthermore, thickness and surface area are heritable than folding (Panizzon et al., 2009). Thus, changes in cortical thickness can be regarded a useful surrogate of patterns of microstructural differences. Studies on aging and brain diseases have used surface measurements to characterize the trajectory of brain microstructural changes and pathology of brain disturbances, respectively (Good et al., 2001; Shaw et al., 2008; Matsuda, 2013; Hong et al., 2014).

Several algorithms were developed to determine these surface measurements e.g., the cortical thickness. A surfaced-based method that modeled the cerebral cortex as a surface mesh was proposed to compute cortical thickness, which was available in the popular FreeSurfer software (Dale et al., 1999; Fischl et al., 1999; Fischl, 2012) (https://surfer.nmr.mgh.harvard.edu/fswiki). Alternative methods such as the Laplace's Equations (Jones et al., 2000) or registration-based solution (Das et al., 2009) have also been developed for cortical thickness computation, which were employed in ANTs software (Avants et al., 2014). However, processing and analyses employed by these packages are conducted by subject-by-subject command lines. Furthermore, several manual procedures were needed, which may be time consuming. This can increase the probability of inadvertent mistakes. Thus, a user-friendly graphical user interface (GUI) for surface-based imaging processing and analysis is necessary, especially for clinicians and MRI beginners.

In the current study, we have developed a MATLAB toolbox called “surface-based processing and analysis of MRI” (SPAMRI) based on certain software functions of FreeSurfer, CAT, and ANTs. This toolbox provides processing steps in parallel, and generates a number of images for quality checking. It also provides GUI for statistical analysis, multiple comparison correction, reporting of results, and extraction of surface measurements. In addition, SPAMRI can be used to perform data-type conversion between surface mesh files and volume-based files.

Materials and Methods

SPAMRI, which has been developed by using MATLAB (R2014b) with Windows (which needs windows subsystem installed), Linux and Mac-OS, calls several processing functions in FreeSurfer, CAT, and ANTs. In this paper, the processing in SPAMRI is initially described, and then an introduction to realize each aforementioned procedure is presented.

Figure 1A presents the main GUI of SPAMRI that includes four panels: (1) pipelines involved in cortical reconstruction and surface measurement calculation; (2) statistical analysis; (3) multiple comparison correction and result reporting; and (4) extraction of surface measurements. Four parameters, namely, FREESURFER_HOME, ANTSPATH, CATPATH and SUBJECTS_DIR, are needed before running SPAMRI. The first three parameters indicate the location where the FreeSurfer, ANTs and CAT are installed, and the last denotes the location where output files are saved (Figure 1B). As indicated by the flow chart of SPAMRI (Figure 2), these panels are introduced in detail in subsequent sections.

FIGURE 1
www.frontiersin.org

Figure 1. Graphical user interfaces of SPAMRI (A) and environment configuration (B). The main window of SPAMRI includes four panels: Pipeline, Statistics, View and Utilities.

FIGURE 2
www.frontiersin.org

Figure 2. The flow chart of SPAMRI.

Pipeline

Figure 3A shows the GUI of pipeline. The Freesurfer-based pipeline in current toolbox was a little different from the processing steps in FreeSurfer software (https://surfer.nmr.mgh.harvard.edu/). The constructed white matter surface and gray matte surface in FreeSurfer were highly depended on the brain image without skull, especially for the structural image with low resolution. Thus, in SPAMRI, a segmentation procedure was employed firstly to obtain gray matter, white matter and cerebrospinal fluid, which were then combined to generate a brain mask. The resulted brain mask was used to mask the structural image, resulting in a cleanly brain image without skull. This brain image with no skull was used as the input of “recon-all” pipeline in FreeSurfer. The following steps mainly included volumetric labeling, white matter segmentation, white matter/pial cortical reconstruction, spherical registration, cortical parcellation, cortical thickness estimation, resampling cortical measurement maps into standard (fsaverage) space and smooth.

FIGURE 3
www.frontiersin.org

Figure 3. Graphical user interface of Pipeline (A) including FreeSurfer-based pipeline, ANTs-based pipeline and CAT-based pipeline, statistics (B) and view (C).

The ANTs-based pipeline (http://stnava.github.io/ANTs/) included template construction, image registration, bias correction, tissue segmentation and cortical thickness estimation based on the diffeomorphic registration. Additionally, a CAT-based cortical thickness computation pipeline (Gaser and Dahnke, 2016) was included, in order to perform comparative studies.

There are two kinds of data import for all the three pipelines: (1) just import the T1 images of all subjects; (2) import the folder (e.g., named T1Raw) that contains subject folders (e.g., sub001, sub002, …). The T1 image of each subject is in the corresponding subject folder.

The GUI can also perform parallel computation, and thus, several subjects can be processed simultaneously. The description on how to install the parallel computation function can be found in this toolbox. The procedures can be conducted in parallel by using the “-openmp” function within a subject process.

Quality Control

Quality control is a necessary step to make sure that the results are not biased and interpretable. The Freesurfer-based pipeline in SPAMRI will generate one picture for each subject, in order to check the quality of data processing. The quality control includes (1) skull stripping (Figure 4B). Removal of skull is critical for surface construction. The skull stripping in SPAMRI is based on image segmentation. Thus, segmentation failure would result in removing the skull incorrectly. If in this case, choosing another segmentation algorithm or using “bet” in FSL would help; (2) talairach registration (Figure 4A). This is the talairach transform that maps the image from subject native space to standard space. Manual edition is needed if the talairach transform fails; (3) surface construction (Figures 4C,D). Manual fixation is also needed if the white matter surface and gray matter surface are constructed incorrectly. For example, voxels of white matter or cerebrospinal fluid are identified as gray matter voxels. The details of manual fixation can be seen in the FreeSurfer website (https://surfer.nmr.mgh.harvard.edu/). The illustration of “bad” data processing quality can be seen in Figure 4E.

FIGURE 4
www.frontiersin.org

Figure 4. A set of pictures for checking the quality of talairach transform (A), skull strip (B), surface reconstruction (C,D). The illustration of “bad” quality (E) includes skull strip failure (donated by black circles), talairach transform failure and surface construction failure (indicated by black circles).

Statistics

The procedure for statistical analysis involves the calling of general linear model (Figure 3B). In SPAMRI, users only need to import data (mgh files resulted from FreeSurfer-based pipeline or gii files from CAT-based pipeline) and select several parameters to generate the statistics. It doesn't work with ANTs-based pipeline currently, because the cortical thickness map resulted from ANTs-based pipeline was voxel-based instead of surface mesh-based. Statistics on these maps can be performed using other toolboxes such as SPM (https://www.fil.ion.ucl.ac.uk/spm/), FSL (https://fsl.fmrib.ox.ac.uk/fsl/fslwiki) and AFNI (https://afni.nimh.nih.gov/).

One-Sample t-Test

This test verifies the hypothesis by which the mean cortical measurement across the group is equal to a specific value. Measurements for thickness, area, area_pial, sulc, curv, pial_lgi, volume, jacobin_white, w-g.pct, white.H, and white.K (Fischl and Dale, 2000) are included in this test. The design matrix and contrast matrix were determined manually, just simply “telling” the toolbox which subjects belong to one group, which subjects belong to another group. The “Run” button is pressed to perform statistical analysis after viewing the design matrix of the general linear model fitting. A mask can be added to restrict the procedure within a limited brain cortical area. By default, statistical analysis is conducted for either the entire left cerebral cortex or the entire right cerebral cortex. A covariate can be added to regress out the effect of a variable of no-interest.

Two-Sample t-Test

This test verifies the difference in cortical measurements between two groups, such as patient vs. control.

Multiple Regression

This test verifies the linear relationship of cortical measurement with behavioral or clinical score in one group.

One-Way ANOVA

Currently, one-way ANOVA only tests the between-subject effects of cortical measurements across three or more groups.

Two-Way ANOVA

The results of between-subject two-way ANOVA, depict the main effect of each factor and the interaction effect between two factors.

Multiple Comparison Correction and Reporting of Results

The “View” GUI presents the statistical map, performs multiple comparison correction, and reports the statistical results (Figure 3C). Any type of mgh or gii file is allowable. However, statistical analysis should be conducted for the left or right hemisphere.

SPAMRI provides four methods of multiple comparison correction: (1) Bonferroni. Assume that the corrected p is 0.05. If the statistical levels of vertices are <0.05/N, where the N is equal to 163,842 for the left and right hemispheres in standard space, then the vertices survive Bonferroni correction. (2) False positive rate (FDR). The FDR procedure was programmed at the vertex level based on the MATLAB function “lme_mass_FDR” (Genovese et al., 2002), which has been implemented in FreeSurfer. It controls the fraction of detected vertices that are false positives. (3) Monte Carlo simulation (Hagler et al., 2006). This method initially synthesizes a z map. This z map is subsequently smoothened and operated in threshold (with a primary p threshold) at the vertex level, as a consequence of spatial clusters generated. Then, the maximum cluster size is recorded. The procedure is repeatedly iterated by the thousands (usually >5,000), resulting in a distribution with maximum cluster size. The same threshold is applied to the original data, and data clusters are obtained. Then, the significant level of each cluster is determined according to the proportion of values that exceed the cluster size in the distribution. To apply this method, three parameters are needed: cluster-forming threshold (e.g., a threshold of three corresponds to a p value of 0.001), the sign (positive, negative, or absolute), and the estimated FWHM. The procedure was coded based on the function of “mri_surfcluster” in FreeSurfer.

These correction methods can be also conducted in Qdec or Freeview (https://surfer.nmr.mgh.harvard.edu/fswiki/FreeviewGuide) in the FreeSurfer software. However, unlike Qdec/Freeview, the current toolbox provides another correction method that is based on random field theory (RFT). RFT (Hayasaka et al., 2004; Hagler et al., 2006) is programmed on the basis of functions obtained from the SurfStat toolbox (Worsley et al., 2009) (http://www.stat.uchicago.edu/faculty/InMemoriam/worsley/research/surfstat/). In functional MRI studies, Gaussian RFT is common for multiple comparison correction. However, a priori assumption that the noise component of the image data is isotropic is needed. This assumption is not reasonable for cortical surface data due to the different amounts of surface stretching. Thus, the data should be warped into a space where the data is regarded isotropic before applying RFT in the surface data (Worsley et al., 1999). The RFT method can be conducted at vertex or cluster levels, which suggest the significance of the vertices or clusters. Vertex- and cluster-wise RFTs have been coded in SPAMRI to handle T-statistics and F-statistics. Furthermore, SPAMRI can adjust the p values for the left and right hemispheres.

After conducting multiple comparison correction, the statistical results can be generated by simply selecting an appropriate cortical atlas (the default is ?h.aparc.annot) and pressing the “Report” button. The information of all clusters is included in the report: such as statistical value of peak vertex, index of peak vertex, cluster size, number of vertex, Montreal Neurological Institute (MNI) coordinates of peak vertex, location of peak vertex, and cluster locations.

The “View” GUI can also save clusters as masks for the measurement extraction of the region of interest (ROI) by performing the following steps: press the “Find clusters” button; select a cluster for the ROI; and press the “Save label” button to save the cluster information. The GUI can also map the ROI from fsaverage space back to subject native space by using the “Map label2subject” function.

Measurement Extraction and Calculator

This GUI is used to extract the cortical measurements of specific ROIs or cortical atlas (Figure 5C). Users can select whether the procedure will be conducted in subject native space or fsaverage space. If the procedure is conducted in native space, then the ROI/atlas file names need to be separated by comma. Otherwise, the ROI/atlas files in fsaverage space are selected for measurement extraction. The procedure of Calculator is used to perform mathematical operations on ROI files, e.g., the combination of a number of ROIs (Figure 5B).

FIGURE 5
www.frontiersin.org

Figure 5. Graphical user interfaces of convert (A), calculator (B), extractor (C) and structural covariance connectivity analysis (D).

Convert

This GUI involves the conversion of different data types (e.g., between surface and volume data) (Figure 5A). The source is the subject space where the input files are obtained (the default is fsaverage), whereas the target is the subject space where the input files are mapped. Several kinds of conversions are listed. The “annot2label” divides a cortical atlas into different ROIs. The “label2annot” is used to merge a number of ROIs into a cortical atlas. The “label2label”/“surf2surf” is used to map ROI/surface files from one subject space (source) to another (target). The “label2nifti” is used to convert a surface ROI file into NIFTI file (i.e., generally used in SPM or FSL). It's useful in the case that a surface cluster needs to be further analyzed for volume-based studies. The default target subject is ch2, which is obtainable by performing recon-all steps on ch2.nii file. The “nifti2label” is utilized to map a volumetric ROI to surface ROI. The “surf2nifti” is employed to map surface files into NIFTI files. The “nifti2surf” is applied to map NIFTI files into surface files. The “mgz2nifti” is used to convert volumetric data (postfix with mgz) into NIFTI data. The “fs2gii” and “gii2fs” are to convert surface data between different types such as gii and mgh files.

Structural Covariance Connectivity Analysis

Brain connectivity analysis has been widely applied in neuroscience and been programmed in many tools such as the rsHRF (Wu et al., 2021) and the conn (Whitfield-Gabrieli and Nieto-Castanon, 2012). The tool of SPAMRI (Figure 5D) also performs a seed-based covariance connectivity analysis with volumetric data (e.g., NIFTI file) or surface data (gii or mgh file) as input. The detailed procedures are as follows. For each group, the seed-to-whole brain covariance connectivity map is firstly constructed across participants. The statistics on the covariance connectivity maps are then performed by employing the SurfStat toolbox. Other kinds of structural covariance analysis such as ROI-to-ROI covariance connectivity analysis and causal analysis of structural covariance network can be seen in other tools, e.g., the BCCT (Xu et al., 2021).

Testing the Effect of Age on Cortical Thickness by Using SPAMRI

Data were obtained from the Stockholm Sleepy Brain study (https://openneuro.org/datasets/ds000201/versions/00004), which included 86 young and old adults. The subjects were scanned twice before and after partial sleep deprivation. We selected the data of 83 participants (39 old adults [65–75 years] and 44 young adults [20–30 years]) before sleep deprivation (the T1 data of three participants were missing). All are right-handed and had no history of neurological psychiatric disorders. The young and old groups did not differ statistically in terms of gender. Written informed consent was obtained from each participant. The study was approved by the Regional Ethics Review Board of Stockholm (2012/1870-32). The detailed information have been reported in other papers (Nilsonne et al., 2017; Tamm et al., 2017).

MRI data were acquired with General Electric Discovery 3 T MRI scanner. T1-weighted structural images with whole-head coverage were obtained by using sagittal BRAVO sequence, TR = 6.4 s, TE = 2.8 s, voxel size=1 × 0.47 × 0.47 mm3, and flip angle = 11°.

Data Processing

The data were processed by using the current toolbox. Briefly, non-brain tissues were extracted from individual T1 images via hybrid watershed/surface deformation following intensity normalization (Segonne et al., 2004). The gray and white matters were segmented and subsequently used for cortical reconstruction. Then, the white (defined as gray/white boundary) and pial surfaces (defined as gray/CSF boundary) were identified. Cortical thickness was calculated as the closest distance from the gray/white boundary to the gray/CSF boundary at each vertex. Several images were generated to evaluate the quality of Talairach transform, brain image without skull, and surface reconstruction. The individual cortical thickness maps cannot be compared because they have different numbers of vertex. Thus, those maps were warped and registered as average spherical space (fsaverage) to optimally align sulcus and gyrus patterns, which then enabled the matching of cortical locations across entire surfaces and among individuals. The registered cortical thickness maps in fsaverage space were obtained for each hemisphere and smoothened by using 10-mm FWHM for statistical analysis.

ROI Analysis

We first validated the “Extractor” GUI by performing ROI analysis to investigate whether the mean cortical thickness across the entire cortical surface differed between young adults and old adults. Then, the mean cortical thickness values of the groups were extracted and compared by conducting two-tailed two-sample t-test.

Vertex-Wise Statistical Analysis

To test the age effect on cortical thickness at the vertex level, two-tailed two-sample t-test was conducted to determine the cortical thickness of the young adult group and the old adult group by using the “Statistics” GUI in the current toolbox. Multiple comparison correction was performed by using the “View” GUI. The no-threshold statistical map and corrected statistical maps were presented on the basis of the four aforementioned correction methods. The corrected p value of the vertex-level correction (including Bonferroni, FDR, and vertex-wise RFT) was set to p < 0.05. The cluster-forming threshold of the cluster-wise correction (including Monte Carlo simulation and cluster-wise RFT) was set to p < 0.001. The corrected p value of the clusters was set to p < 0.05. All methods were subjected to two-tailed test. The RFT procedure was also performed by using SurfStat toolbox (seen in Supplementary material).

Results

The computer used for data-processing has 16G memory with eight-core CPU. The running time of T1 image processing of one subject was about 0.34, 12 h and over 24 ho in CAT, FREESURFER, and ANTs, respectively.

The mean cortical thickness across whole cortex in old adults was significantly decreased compared with young adults (mean of old adults: 2.44 mm, mean of young adults: 2.59, p < 0.001, Figure 6). The difference was also significant when the total intracranial volume was included as a covariate. Vertex-wise statistics showed that old adults had decreased cortical thickness mainly in prefrontal cortex, anterior cingulate cortex, posterior cingulate cortex and several temporal regions, compared with young adults (Figure 7). It was worth noting that statistics using SurfStat detected more brain areas showing decreased cortical thickness in old adults (Figure 8).

FIGURE 6
www.frontiersin.org

Figure 6. Region of interest analysis revealed significant decrease in mean cortical thickness across whole cerebral cortex in old adults compared to young adults.

FIGURE 7
www.frontiersin.org

Figure 7. Unthresholed statistical map and thresholded maps using bonferroni, FDR, Monto Carlo simulation, cluster-wise/vertex-wise random field theory. The corrected statistical level was p < 0.05. The cluster-forming threshold was p < 0.001. Regions with blue/red color indicate deceased/increased thickness in old adults, respectively. FDR, false positive rate.

FIGURE 8
www.frontiersin.org

Figure 8. Thresholded statistical map using random field theory implemented in Surfstat. It tests the effect of “Old > Young” (A) and “Old < Young” (B) separately. Brain areas with warm/cool color survived vertex/cluster-level random field theory correction. The default cluster-forming threshold was p < 0.001.

Discussion

The current work provides a MATLAB toolbox for surface-based processing of MRI. The toolbox can integrate data preprocessing, statistical analysis, and multiple comparison correction functions, and it offers convenient utilities, such as surface measurement extraction.

SPAMRI, which provides parallel functions for data preprocessing and simultaneous analysis of many subjects, has the potential to reduce the time-consumption. Removing brain skull is a crucial step in cortical construction and thickness estimation. In current toolbox, the skull was removed by performing segmentation on the structural image, which might improve the cortical construction. In addition, the quality of Talairach transform, skull strip, and cortical construction can be easily checked, and time can be saved by generating a set of images by using the current toolbox.

SPAMRI also provides the GUIs for statistical analysis and multiple comparison correction. The correction methods of Bonferroni, FDR, and Monte Carlo simulation can be validated by using FreeSurfer tools, such as Qdec or command lines. In addition, this toolbox provides a correction method for RFT. Although the RFT procedure in SPAMRI has been programmed on the basis of the SurfStat toolbox, they eventually differ in terms of testing and analysis. The RFT correction for T-statistic in SurfStat is performed by using one-tailed statistics (which may increase the false positive rate), whereas that in SPAMRI is conducted by using two-tailed statistics. As we can see from Figure 8, unlike the two-tailed vertex-wise RFT procedure in SPAMRI, the procedure in SurfStat detected more brain areas. For example, the middle temporal cortex shows increased cortical thickness in the old adult group (Figure 8A).

Specifically, the current toolbox revealed that older adults have significantly thinner mean cortical thickness than young adults, which accords with previous findings (Fjell et al., 2009; Hogstrom et al., 2013). The cortical thickness in the prefrontal cortex (including superior frontal cortex, rostral middle frontal cortex, laterior/medial orbitofrontal cortex, and rostral anterior cingulate cortex) of old adults is significantly thin. The patterns of regional cortical thinning due to aging have also been demonstrated by previous reports (Fjell et al., 2009; Thambisetty et al., 2010). Cortical thinning in the frontal cortex may indicate a decline in the cognitive ability of old people, and this observation is consistent with those in many morphological studies (Staff et al., 2006; Karama et al., 2014; Gennatas et al., 2017). Old people perform poorly in terms of executing processing tasks, such as memory tasks, which is presumed to be associated with the prefrontal cortex (Salat et al., 2002).

Currently, the structural covariance analysis between distributed brain regions becomes more and more popular (Alexander-Bloch et al., 2013). The structural covariance characterizes the co-variation of morphological changes between brain areas. For example, individuals with higher cortical thickness of Broca's area have also higher cortical thickness of Wernicke's area (Lerch et al., 2006). Usually, the structural covariance connectivity was constructed across participants at group level (Alexander-Bloch et al., 2013). However, it can't correlate the structural covariance with behavior or clinical scores. Thus, some authors developed individual structural covariance analysis (Tijms et al., 2012; Liu et al., 2021). More recently, the structural similarity analysis was proposed at individual level by combining multi-modal neuroimages (Seidlitz et al., 2018) and has been applied in many psychiatric disorders (Morgan et al., 2019; Li et al., 2021). The surface measurements computed from the current toolbox can be further used to conduct the structural covariance analysis by employing either the SPAMRI or other toolboxes, e.g., the BCCT (Xu et al., 2021).

In conclusion, SPAMRI is a user-friendly toolbox for the surface-based analysis of structural MRIs. It can help researchers save time to process large datasets, reduce errors in the cumbersome setting of parameters, and provide convenient tools for statistical analysis and reporting of results. However, the current toolbox only works on cross-sectional datasets. The analysis of longitudinal datasets will be programmed in future version. SPAMRI is made freely available on the NITRC website (https://www.nitrc.org/projects/longzhiliangmri/).

Data Availability Statement

The datasets presented in this study can be found in online repositories (https://openneuro.org/datasets/ds000201).

Ethics Statement

The study involving human participants was reviewed and approved by the Regional Ethics Review Board of Stockholm (2012/1870-32). The patients/participants provided their written informed consent to participate in this study.

Author Contributions

ZL designed this research, programmed the SPAMRI toolbox, validated this toolbox, and drafted the manuscript.

Funding

This work was supported by the National Natural Science Foundation of China (81901725).

Conflict of Interest

The author declares that the research was conducted in the absence of any commercial or financial relationships that could be construed as a potential conflict of interest.

Publisher's Note

All claims expressed in this article are solely those of the authors and do not necessarily represent those of their affiliated organizations, or those of the publisher, the editors and the reviewers. Any product that may be evaluated in this article, or claim that may be made by its manufacturer, is not guaranteed or endorsed by the publisher.

Acknowledgments

The author thanks the Stockholm Sleepy Brain study for providing the online datasets.

Supplementary Material

The Supplementary Material for this article can be found online at: https://www.frontiersin.org/articles/10.3389/fnhum.2022.946156/full#supplementary-material

References

Alexander-Bloch, A., Giedd, J. N., and Bullmore, E. (2013). Imaging structural co-variance between human brain regions. Nat. Rev. Neurosci. 14, 322–336. doi: 10.1038/nrn3465

PubMed Abstract | CrossRef Full Text | Google Scholar

Ashburner, J., and Friston, K. J. (2000). Voxel-based morphometry–the methods. NeuroImage 11, 805–821. doi: 10.1006/nimg.2000.0582

PubMed Abstract | CrossRef Full Text | Google Scholar

Ashburner, J., and Friston, K. J. (2001). Why voxel-based morphometry should be used. NeuroImage 14, 1238–1243. doi: 10.1006/nimg.2001.0961

PubMed Abstract | CrossRef Full Text | Google Scholar

Avants, B. B., Tustison, N. J., Stauffer, M., Song, G., Wu, B., and Gee, J. C. (2014). The Insight ToolKit image registration framework. Front. Neuroinform. 8, 44. doi: 10.3389/fninf.2014.00044

PubMed Abstract | CrossRef Full Text | Google Scholar

Dale, A. M., Fischl, B., and Sereno, M. I. (1999). Cortical surface-based analysis. I. Segmentation and surface reconstruction. NeuroImage 9, 179–194. doi: 10.1006/nimg.1998.0395

PubMed Abstract | CrossRef Full Text | Google Scholar

Das, S. R., Avants, B. B., Grossman, M., and Gee, J. C. (2009). Registration based cortical thickness measurement. NeuroImage 45, 867–879. doi: 10.1016/j.neuroimage.2008.12.016

PubMed Abstract | CrossRef Full Text | Google Scholar

Fischl, B. (2012). FreeSurfer. NeuroImage 62, 774–781. doi: 10.1016/j.neuroimage.2012.01.021

PubMed Abstract | CrossRef Full Text | Google Scholar

Fischl, B., and Dale, A. M. (2000). Measuring the thickness of the human cerebral cortex from magnetic resonance images. Proc. Natl. Acad. Sci. U. S. A. 97, 11050–11055. doi: 10.1073/pnas.200033797

PubMed Abstract | CrossRef Full Text | Google Scholar

Fischl, B., Sereno, M. I., and Dale, A. M. (1999). Cortical surface-based analysis. II: inflation, flattening, and a surface-based coordinate system. NeuroImage 9, 195–207. doi: 10.1006/nimg.1998.0396

PubMed Abstract | CrossRef Full Text | Google Scholar

Fjell, A. M., Westlye, L. T., Amlien, I., Espeseth, T., Reinvang, I., Raz, N., et al. (2009). High consistency of regional cortical thinning in aging across multiple samples. Cereb. Cortex 19, 2001–2012. doi: 10.1093/cercor/bhn232

PubMed Abstract | CrossRef Full Text | Google Scholar

Fjell, A. M., Westlye, L. T., Amlien, I., Tamnes, C. K., Grydeland, H., Engvig, A., et al. (2015). High-expanding cortical regions in human development and evolution are related to higher intellectual abilities. Cereb. Cortex 25, 26–34. doi: 10.1093/cercor/bht201

PubMed Abstract | CrossRef Full Text | Google Scholar

Gaser, C., and Dahnke, R. (2016). CAT-a computational anatomy toolbox for the analysis of structural MRI data. Hum. Brain Mapp. 336–348. doi: 10.1101/2022.06.11.495736

CrossRef Full Text | Google Scholar

Gennatas, E. D., Avants, B. B., Wolf, D. H., Satterthwaite, T. D., Ruparel, K., Ciric, R., et al. (2017). Age-related effects and sex differences in gray matter density, volume, mass, and cortical thickness from childhood to young adulthood. J. Neurosci. 37, 5065–5073. doi: 10.1523/JNEUROSCI.3550-16.2017

PubMed Abstract | CrossRef Full Text | Google Scholar

Genovese, C. R., Lazar, N. A., and Nichols, T. (2002). Thresholding of statistical maps in functional neuroimaging using the false discovery rate. NeuroImage 15, 870–878. doi: 10.1006/nimg.2001.1037

PubMed Abstract | CrossRef Full Text | Google Scholar

Good, C. D., Johnsrude, I. S., Ashburner, J., Henson, R. N., Friston, K. J., and Frackowiak, R. S. (2001). A voxel-based morphometric study of ageing in 465 normal adult human brains. NeuroImage 14, 21–36. doi: 10.1006/nimg.2001.0786

PubMed Abstract | CrossRef Full Text | Google Scholar

Hagler, D. J. Jr., Saygin, A. P., and Sereno, M. I. (2006). Smoothing and cluster thresholding for cortical surface-based group analysis of fMRI data. NeuroImage 33, 1093–1103. doi: 10.1016/j.neuroimage.2006.07.036

PubMed Abstract | CrossRef Full Text | Google Scholar

Hayasaka, S., Phan, K. L., Liberzon, I., Worsley, K. J., and Nichols, T. E. (2004). Nonstationary cluster-size inference with random field and permutation methods. NeuroImage 22, 676–687. doi: 10.1016/j.neuroimage.2004.01.041

PubMed Abstract | CrossRef Full Text | Google Scholar

He, Y., Chen, Z. J., and Evans, A. C. (2007). Small-world anatomical networks in the human brain revealed by cortical thickness from MRI. Cereb. Cortex 17, 2407–2419. doi: 10.1093/cercor/bhl149

PubMed Abstract | CrossRef Full Text | Google Scholar

Hibar, D. P., Westlye, L. T., Van Erp, T. G., Rasmussen, J., Leonardo, C. D., Faskowitz, J., et al. (2016). Subcortical volumetric abnormalities in bipolar disorder. Mol. Psychiatry 21, 1710–1716. doi: 10.1038/mp.2015.227

PubMed Abstract | CrossRef Full Text | Google Scholar

Hogstrom, L. J., Westlye, L. T., Walhovd, K. B., and Fjell, A. M. (2013). The structure of the cerebral cortex across adult life: age-related patterns of surface area, thickness, and gyrification. Cereb. Cortex 23, 2521–2530. doi: 10.1093/cercor/bhs231

PubMed Abstract | CrossRef Full Text | Google Scholar

Hong, S. J., Kim, H., Schrader, D., Bernasconi, N., Bernhardt, B. C., and Bernasconi, A. (2014). Automated detection of cortical dysplasia type II in MRI-negative epilepsy. Neurology 83, 48–55. doi: 10.1212/WNL.0000000000000543

PubMed Abstract | CrossRef Full Text | Google Scholar

Jones, S. E., Buchbinder, B. R., and Aharon, I. (2000). Three-dimensional mapping of cortical thickness using Laplace's equation. Hum. Brain Mapp. 11, 12–32. doi: 10.1002/1097-0193(200009)11:1<12::aid-hbm20>3.0.co;2-k

PubMed Abstract | CrossRef Full Text | Google Scholar

Karama, S., Bastin, M. E., Murray, C., Royle, N. A., Penke, L., Munoz Maniega, S., et al. (2014). Childhood cognitive ability accounts for associations between cognitive ability and brain cortical thickness in old age. Mol. Psychiatry 19, 555–559. doi: 10.1038/mp.2013.64

PubMed Abstract | CrossRef Full Text | Google Scholar

Lerch, J. P., Worsley, K., Shaw, W. P., Greenstein, D. K., Lenroot, R. K., Giedd, J., et al. (2006). Mapping anatomical correlations across cerebral cortex (MACACC) using cortical thickness from MRI. NeuroImage 31, 993–1003. doi: 10.1016/j.neuroimage.2006.01.042

PubMed Abstract | CrossRef Full Text | Google Scholar

Li, J., Seidlitz, J., Suckling, J., Fan, F., Ji, G. J., Meng, Y., et al. (2021). Cortical structural differences in major depressive disorder correlate with cell type-specific transcriptional signatures. Nat. Commun. 12, 1647. doi: 10.1038/s41467-021-21943-5

PubMed Abstract | CrossRef Full Text | Google Scholar

Liu, Z., Palaniyappan, L., Wu, X., Zhang, K., Du, J., Zhao, Q., et al. (2021). Resolving heterogeneity in schizophrenia through a novel systems approach to brain structure: individualized structural covariance network analysis. Mol. Psychiatry 26, 7719–7731. doi: 10.1038/s41380-021-01229-4

PubMed Abstract | CrossRef Full Text | Google Scholar

Magon, S., Sprenger, T., Otti, A., Papadopoulou, A., Gundel, H., and Noll-Hussong, M. (2018). Cortical thickness alterations in chronic pain disorder – an exploratory MRI study. Psychosom. Med. 80, 592–598. doi: 10.1097/PSY.0000000000000605

PubMed Abstract | CrossRef Full Text | Google Scholar

Matsuda, H. (2013). Voxel-based morphometry of brain MRI in normal aging and Alzheimer's disease. Aging Dis. 4, 29–37. Available online at: http://www.aginganddisease.org/EN/Y2013/V4/I1/29

PubMed Abstract | Google Scholar

Matsuo, K., Harada, K., Fujita, Y., Okamoto, Y., Ota, M., Narita, H., et al. (2019). Distinctive neuroanatomical substrates for depression in bipolar disorder versus major depressive disorder. Cereb. Cortex. 29, 202–214. doi: 10.1093/cercor/bhx319

PubMed Abstract | CrossRef Full Text | Google Scholar

Mechelli, A., Price, C. J., Friston, K. J., and Ashburner, J. (2005). Voxel-based morphometry of the human brain: methods and applications. Curr. Med. Imaging Rev. 1, 105–113. doi: 10.2174/1573405054038726

CrossRef Full Text | Google Scholar

Morgan, S. E., Seidlitz, J., Whitaker, K. J., Romero-Garcia, R., Clifton, N. E., Scarpazza, C., et al. (2019). Cortical patterning of abnormal morphometric similarity in psychosis is associated with brain expression of schizophrenia-related genes. Proc. Natl. Acad. Sci. U. S. A. 116, 9604–9609. doi: 10.1073/pnas.1820754116

PubMed Abstract | CrossRef Full Text | Google Scholar

Nilsonne, G., Tamm, S., Schwarz, J., Almeida, R., Fischer, H., Kecklund, G., et al. (2017). Intrinsic brain connectivity after partial sleep deprivation in young and older adults: results from the Stockholm Sleepy Brain study. Sci. Rep. 7, 9422. doi: 10.1038/s41598-017-09744-7

PubMed Abstract | CrossRef Full Text | Google Scholar

Panizzon, M. S., Fennema-Notestine, C., Eyler, L. T., Jernigan, T. L., Prom-Wormley, E., Neale, M., et al. (2009). Distinct genetic influences on cortical surface area and cortical thickness. Cereb. Cortex 19, 2728–2735. doi: 10.1093/cercor/bhp026

PubMed Abstract | CrossRef Full Text | Google Scholar

Salat, D. H., Kaye, J. A., and Janowsky, J. S. (2002). Greater orbital prefrontal volume selectively predicts worse working memory performance in older adults. Cereb. Cortex 12, 494–505. doi: 10.1093/cercor/12.5.494

PubMed Abstract | CrossRef Full Text | Google Scholar

Segonne, F., Dale, A. M., Busa, E., Glessner, M., Salat, D., Hahn, H. K., et al. (2004). A hybrid approach to the skull stripping problem in MRI. NeuroImage 22, 1060–1075. doi: 10.1016/j.neuroimage.2004.03.032

PubMed Abstract | CrossRef Full Text | Google Scholar

Seidlitz, J., Vasa, F., Shinn, M., Romero-Garcia, R., Whitaker, K. J., Vertes, P. E., et al. (2018). Morphometric similarity networks detect microscale cortical organization and predict inter-individual cognitive variation. Neuron 97, 231–247 e237. doi: 10.1016/j.neuron.2017.11.039

PubMed Abstract | CrossRef Full Text | Google Scholar

Shaw, P., Kabani, N. J., Lerch, J. P., Eckstrand, K., Lenroot, R., Gogtay, N., et al. (2008). Neurodevelopmental trajectories of the human cerebral cortex. J. Neurosci. 28, 3586–3594. doi: 10.1523/JNEUROSCI.5309-07.2008

PubMed Abstract | CrossRef Full Text | Google Scholar

Staff, R. T., Murray, A. D., Deary, I. J., and Whalley, L. J. (2006). Generality and specificity in cognitive aging: a volumetric brain analysis. NeuroImage 30, 1433–1440. doi: 10.1016/j.neuroimage.2005.11.004

PubMed Abstract | CrossRef Full Text | Google Scholar

Tamm, S., Nilsonne, G., Schwarz, J., Lamm, C., Kecklund, G., Petrovic, P., et al. (2017). The effect of sleep restriction on empathy for pain: an fMRI study in younger and older adults. Sci. Rep. 7, 12236. doi: 10.1038/s41598-017-12098-9

PubMed Abstract | CrossRef Full Text | Google Scholar

Tessitore, A., Santangelo, G., De Micco, R., Vitale, C., Giordano, A., Raimo, S., et al. (2016). Cortical thickness changes in patients with Parkinson's disease and impulse control disorders. Parkinsonism Relat. Disord. 24, 119–125. doi: 10.1016/j.parkreldis.2015.10.013

PubMed Abstract | CrossRef Full Text | Google Scholar

Thambisetty, M., Wan, J., Carass, A., An, Y., Prince, J. L., and Resnick, S. M. (2010). Longitudinal changes in cortical thickness associated with normal aging. NeuroImage 52, 1215–1223. doi: 10.1016/j.neuroimage.2010.04.258

PubMed Abstract | CrossRef Full Text | Google Scholar

Tijms, B. M., Series, P., Willshaw, D. J., and Lawrie, S. M. (2012). Similarity-based extraction of individual networks from gray matter MRI scans. Cereb. Cortex 22, 1530–1541. doi: 10.1093/cercor/bhr221

PubMed Abstract | CrossRef Full Text | Google Scholar

Whitfield-Gabrieli, S., and Nieto-Castanon, A. (2012). Conn: a functional connectivity toolbox for correlated and anticorrelated brain networks. Brain Connect. 2, 125–141. doi: 10.1089/brain.2012.0073

PubMed Abstract | CrossRef Full Text | Google Scholar

Wierenga, L. M., Langen, M., Oranje, B., and Durston, S. (2014). Unique developmental trajectories of cortical thickness and surface area. NeuroImage 87, 120–126. doi: 10.1016/j.neuroimage.2013.11.010

PubMed Abstract | CrossRef Full Text | Google Scholar

Worsley, K. J., Taylor, J. E., Carbonell, F., Chung, M. K., Duerden, E., Bernhardt, B., et al. (2009). SurfStat: a Matlab toolbox for the statistical analysis of univariate and multivariate surface and volumetric data using linear mixed effects models and random field theory. NeuroImage 47, S102. doi: 10.1016/S1053-8119(09)70882-1

CrossRef Full Text | Google Scholar

Worsley, K. J., Andermann, M., Koulis, T., Macdonald, D., and Evans, A.C. (1999). Detecting changes in non-isotropic images. Hum. Brain Mapp. 8, 98–101. doi: 10.1002/(SICI)1097-0193(1999)8:2/3<98::AID-HBM5>3.0.CO;2-F

CrossRef Full Text | Google Scholar

Wu, G. R., Colenbier, N., Van Den Bossche, S., Clauw, K., Johri, A., Tandon, M., et al. (2021). rsHRF: a toolbox for resting-state HRF estimation and deconvolution. NeuroImage 244, 118591. doi: 10.1016/j.neuroimage.2021.118591

PubMed Abstract | CrossRef Full Text | Google Scholar

Xu, Q., Zhang, Q., Liu, G., Dai, X. J., Xie, X., Hao, J., et al. (2021). BCCT: a GUI toolkit for brain structural covariance connectivity analysis on MATLAB. Front. Hum. Neurosci. 15, 641961. doi: 10.3389/fnhum.2021.641961

PubMed Abstract | CrossRef Full Text | Google Scholar

Keywords: morphology, surface measurements, user-friendly GUI, SPAMRI, quality check

Citation: Long Z (2022) SPAMRI: A MATLAB Toolbox for Surface-Based Processing and Analysis of Magnetic Resonance Imaging. Front. Hum. Neurosci. 16:946156. doi: 10.3389/fnhum.2022.946156

Received: 17 May 2022; Accepted: 17 June 2022;
Published: 07 July 2022.

Edited by:

Jurong Ding, Sichuan University of Science and Engineering, China

Reviewed by:

Guorong Wu, Ghent University, Belgium
Qiang Xu, Nanjing General Hospital of Nanjing Military Command, China

Copyright © 2022 Long. This is an open-access article distributed under the terms of the Creative Commons Attribution License (CC BY). The use, distribution or reproduction in other forums is permitted, provided the original author(s) and the copyright owner(s) are credited and that the original publication in this journal is cited, in accordance with accepted academic practice. No use, distribution or reproduction is permitted which does not comply with these terms.

*Correspondence: Zhiliang Long, longzhiliangswu@gmail.com

Disclaimer: All claims expressed in this article are solely those of the authors and do not necessarily represent those of their affiliated organizations, or those of the publisher, the editors and the reviewers. Any product that may be evaluated in this article or claim that may be made by its manufacturer is not guaranteed or endorsed by the publisher.