Magnetic Resonance Brain Imaging: Modeling and Data Analysis Using R [1st ed. 2019] 978-3-030-29182-2, 978-3-030-29184-6

This book discusses the modeling and analysis of magnetic resonance imaging (MRI) data acquired from the human brain. Th

529 134 8MB

English Pages XVIII, 231 [242] Year 2019

Report DMCA / Copyright

DOWNLOAD FILE

Polecaj historie

Magnetic Resonance Brain Imaging: Modeling and Data Analysis Using R [1st ed. 2019]
 978-3-030-29182-2, 978-3-030-29184-6

Table of contents :
Front Matter ....Pages i-xviii
Introduction (Jörg Polzehl, Karsten Tabelow)....Pages 1-3
Magnetic Resonance Imaging in a Nutshell (Jörg Polzehl, Karsten Tabelow)....Pages 5-14
Medical Imaging Data Formats (Jörg Polzehl, Karsten Tabelow)....Pages 15-24
Functional Magnetic Resonance Imaging (Jörg Polzehl, Karsten Tabelow)....Pages 25-80
Diffusion-Weighted Imaging (Jörg Polzehl, Karsten Tabelow)....Pages 81-146
Multiparameter Mapping (Jörg Polzehl, Karsten Tabelow)....Pages 147-169
Back Matter ....Pages 171-231

Citation preview

Use R!

Jörg Polzehl Karsten Tabelow

Magnetic Resonance Brain Imaging Modeling and Data Analysis Using R

Use R! Series Editors Robert Gentleman, 23andMe Inc., South San Francisco, USA Kurt Hornik, Department of Finance, Accounting and Statistics, WU Wirtschaftsuniversität Wien, Vienna, Austria Giovanni Parmigiani, Dana-Farber Cancer Institute, Boston, USA

Use R! This series of inexpensive and focused books on R will publish shorter books aimed at practitioners. Books can discuss the use of R in a particular subject area (e.g., epidemiology, econometrics, psychometrics) or as it relates to statistical topics (e.g., missing data, longitudinal data). In most cases, books will combine LaTeX and R so that the code for figures and tables can be put on a website. Authors should assume a background as supplied by Dalgaard’s Introductory Statistics with R or other introductory books so that each book does not repeat basic material.

More information about this series at http://www.springer.com/series/6991

Jörg Polzehl Karsten Tabelow •

Magnetic Resonance Brain Imaging Modeling and Data Analysis Using R

123

Jörg Polzehl WIAS Berlin Berlin, Germany

Karsten Tabelow WIAS Berlin Berlin, Germany

ISSN 2197-5736 ISSN 2197-5744 (electronic) Use R! ISBN 978-3-030-29182-2 ISBN 978-3-030-29184-6 (eBook) https://doi.org/10.1007/978-3-030-29184-6 Mathematics Subject Classification (2010): 62-0792-C55 © Springer Nature Switzerland AG 2019 This work is subject to copyright. All rights are reserved by the Publisher, whether the whole or part of the material is concerned, specifically the rights of translation, reprinting, reuse of illustrations, recitation, broadcasting, reproduction on microfilms or in any other physical way, and transmission or information storage and retrieval, electronic adaptation, computer software, or by similar or dissimilar methodology now known or hereafter developed. The use of general descriptive names, registered names, trademarks, service marks, etc. in this publication does not imply, even in the absence of a specific statement, that such names are exempt from the relevant protective laws and regulations and therefore free for general use. The publisher, the authors and the editors are safe to assume that the advice and information in this book are believed to be true and accurate at the date of publication. Neither the publisher nor the authors or the editors give a warranty, expressed or implied, with respect to the material contained herein or for any errors or omissions that may have been made. The publisher remains neutral with regard to jurisdictional claims in published maps and institutional affiliations. This Springer imprint is published by the registered company Springer Nature Switzerland AG The registered company address is: Gewerbestrasse 11, 6330 Cham, Switzerland

Für Louis Pascal, Maurice und Jean-Loup Frederic —Karsten Tabelow To my friends and family —Jörg Polzehl

Preface

Our interest in neuroimaging started some 20 years ago, initiated by talks given by Fred Godtliebsen (UiT, Tromsø, Norway) and by Fridhjof Kruggel (Max-Planck-Institute of Cognitive Neuroscience, Leipzig) on functional magnetic resonance imaging in the colloquium of the Weierstrass Institute for Applied Analysis and Stochastics (WIAS). At that time, Vladimir Spokoiny and one of the authors of this book, Jörg Polzehl, were interested in imaging problems starting from pure theoretic developments in nonparametric statistics, particularly in adaptive smoothing for regression problems. This has lead to interesting algorithms for image denoising that rely on qualitative assumptions on the image structure, adapt to this structure, and preserve essential spatial information (Polzehl and Spokoiny 2000). fMRI seemed to be a perfect application for the methodology. It resulted in a paper, Polzehl and Spokoiny (2001), and a successful grant proposal within the DFG Research Center MATHEON. This approach was presented as a poster at the Organization of Human Brain Mapping (OHBM) Meeting at San Antonio in 2000, which led to a first contact with a group of statisticians working on neuroimaging problems and resulted in an invitation by Keith Worsley to participate in a statistics in neuroimaging workshop in Montreal in December 2000. In 2005, the other author of this book, Karsten Tabelow, joints the project. We met Henning U. Voss from Weill Cornell Medical College, New York, USA. This collaboration was very important, as Henning is a physicist and acquires MRI data himself with clinical questions in the background. We always felt that the combination of mathematical development along a specific scientific question is key to the success of the project. The first paper of this collaboration (Tabelow et al. 2006) was a complete elaboration of a structural adaptive smoothing procedure for fMRI but it also included the statistical inference on the fMRI activation areas.1 It was important to show the usefulness of such an approach in clinical context (Tabelow et al. 2008b), specifically for better alignment of activation regions in presurgical planning.

As Keith Worsley nicely stated in one of his reviews on the accompanying R package fmri.

1

vii

viii

Preface

Henning U. Voss also introduced us to diffusion magnetic resonance imaging and diffusion models, e.g., the diffusion tensor model, but also to the orientation distribution function. Thus, we started to develop a structural adaptive smoothing method for dMRI data in the context of the tensor model (Tabelow et al. 2008a). Presenting the results at the Annual Meeting of the OHBM 2007, we met Michael Deppe (University Hospital, Münster, Germany), Siawoosh Mohammadi and Alfred Anwander (Max-Planck-Institute of Cognitive Neuroscience, Leipzig), which stimulated our interest in dMRI analysis. The first author got the chance to participate in the 2nd International Summer School in Biomedical Engineering on Diffusionweighted Magnetic Resonance Imaging: Principles and Applications in 2007. Together with our Ph.D. student Saskia Becker, we developed the model-free structural adaptive smoothing method for dMRI data, which we called (multi-shell) position-orientation adaptive smoothing (msPOAS, Becker et al. 2012, 2014). The motivation for these approaches stems from a collaboration with Remco Duits (TU Eindhoven, Netherlands). At the same time, we also contributed to the modeling of diffusion data by providing a tensor mixture model with automatic selection of the number of tensor components (Tabelow et al. 2012). Meanwhile, Siawoosh Mohammadi moved to the Wellcome Trust Centre for Neuroimaging at UCL. There, we started discussions on another imaging modality based on multiparameter mapping with Nikolaus Weiskopf and Martina F. Callaghan. One of the results of this collaboration is the structural adaptive smoothing method for MPM data (Mohammadi et al. 2017). Accompanying with the methodological development, we always implemented the algorithms in packages for R, specifically aws, fmri, dti, and qMRI and released them on CRAN under a GNU license. However, much more people worked on methods for neuroimaging using R. Around 2011, we felt, together with Brandon Whitcher, that time was ripe to summarize those activities in a special volume of the Journal of Statistical Software on “Magnetic Resonance Imaging in R”, see also Tabelow et al. (2011). At CRAN, the “Medical Imaging Task View” was created by Brandon Whitcher. We used some of the material that finally went into this book for a lecture course on Statistics in Neuroimaging at the Humboldt University Berlin in winter 2010. The plan to write this book dates back to this time. With a workshop on Neuroimaging Data Analysis in 2013 and the Program on Challenges in Computational Neuroscience (CCNS)2 at SAMSI in 2015–2016, both initiated by Hongtu Zhu (University of Chapel Hill, US), the statistics and neuroscience communities tried to further link both disciplines and encourage young statisticians to work on emerging problems at this interface of disciplines.

2

Supported by the National Science Foundation under Grant DMS-1127914 to the Statistical and Applied Mathematical Sciences Institute.

Preface

ix

In 2017, the Neuroconductor project3 (Muschelli et al. 2019) went online collecting and adding many R packages related to neuroimaging and providing an easy-to-use access to them. This really enhanced the usage of R in neuroimaging, e.g., because John Muschelli contributed a huge number of missing implementations as packages. This allowed us to present complete analysis pipelines solely based on R packages in all chapters of this book. We have to thank a lot of people, not only those mentioned previously. Without the collaboration and support, our results and the writing of this book would not have been possible. The Weierstrass Institute for Applied Analysis and Stochastics (WIAS Berlin) provided the perfect environment. We want to specifically thank Jürgen Sprekels for his support of the whole imaging project at WIAS. We are thankful to many colleagues from neuroscience we closely collaborate with, especially André Brechmann and Reinhard König (LIN, Magdeburg), John-Dylan Haynes (Einstein Zentrum Berlin, Charité Berlin), with whom we organized a workshop on “Statistics and Neuroimaging” in 2011, and Christophe Lenglet (CMRR, University of Minnesota, US). They introduced us into real-world problems, explained the physics and neuroscientific background behind, and provided us with extensive data or even performed specific experiments to validate our modeling approaches. This book is about processing and modeling of images (in a general sense) from magnetic resonance imaging. For their implementation, we rely on R (R Development Core Team, 2019), the software environment for statistical computing and graphics. With this book, we want to bridge two often distinct communities. It is intended for statisticians, who are interested in neuroimaging and look for an introduction. On the other hand, we hope it will be suited for neuroimaging students, who want to learn about the statistical modeling and analysis of MRI data. By providing full worked-out examples, the book shall serve as a tutorial for MRI analysis with R. We would very much like to see further development in the field, as R is already capable of providing most of MRI analysis. In this book, we cover the theory underlying the modeling and data analysis or data description when we think it is necessary. For all imaging modalities, we outline complete analysis pipelines and illustrate them by worked-out examples. Still, the field of neuroimaging is huge, so the book remains incomplete. For example, we do not cover group fMRI analysis, but the second-level analysis can be performed using existing R functionality. We do not address clinical diagnostics based on multimodal structural MRI, see, e.g., Crainiceanu et al. (2017). Furthermore, we also dropped the use of machine learning techniques in multivariate pattern analysis, which still would require some implementation in R to become a feasible analysis tool. We also leave out important diffusion models like NODDI or g-ratio maps for the lack of implementations in R. We are, however, convinced that R provides a rich environment for further developments. 3

Neuroconductor and its maintainers have been partially supported by the R01 grant NS060910 from the National Institute of Neurological Disorders and Stroke at the National Institutes of Health (NINDS/NIH).

x

Preface

Somewhat parallel to the development and success of the imaging technologies in neurosciences, the reproducibility crisis in science reached the field with the general question on how many of the results are false. In fact, most are (Ioannidis 2005). The dispute raised important issues on the handling of the ever-growing amount of data, i.e., its organizations, description, and publication, as well as the reporting of the methods that have been used for the analysis of the data and lead to the scientific findings. It also met the discussion on the way of the publication of scientific data, analysis, and results promoting Open Access publication, Open Data, and more general Open Science. Specifically, data sharing repositories like OpenNeuro (Stanford Center for Reproducible Neuroscience, 2019; Poldrack and Gorgolewski 2017) or repositories providing access for scientific purposes, see Turner et al. (2016, 2017) and also Appendix B emerged. With the advance of new standards for data organization like the Brain Imaging Data Structure (BIDS) (Gorgolewski et al. 2016) for the organization of MRI data in NIfTI format, such repositories become an easy-to-use source for neuroimaging data to acquire new and initially unintended scientific results or, like the authors of this book, to develop new methodology. They also, together with a complete description of the corresponding metadata and preferably the analysis software, enable the reproduction of published results by other scientists than the original authors. Furthermore, for the neuroimaging community appropriate recommendations for reporting the path to the scientific results are developed, e.g., by the Committee on Best Practices in Data Analysis and Sharing (COBIDAS) of the Organization for Human Brain Mapping (OHBM) (Nichols et al. 2017). Within R a workflow is available that naturally supports the creation of scientific reports, e.g., based on LATEX, that are directly linked to the data and the code to produce the results. Originally, the approach was to use R function Sweave (Leisch 2002a, b), which by calling R Sweave on a LATEX document that includes R code executes the latter and includes the resulting numbers, statistics, or even figures together with the commands that create them within the document. Later, the knitr package (Xie 2019) was developed to solve some long-standing problems in Sweave and to serve as a transparent engine for dynamic report generation with R (Xie 2015). In principle, such a dynamic report is created from a LATEX document that includes so-called chunks of code in a ⋆.Rnw file. R with the knitr package then creates the actual ⋆.tex that contains highlighted code and the results of its execution. The system is flexible enough to work with other programming languages, like Python, Julia, or awk, and produce any output markup, like LATEX, HTML, or Markdown. In an attempt for full reproducibility, this book completely relies on such a dynamic report generation: It uses neuroimaging data publicly available on repositories; the PDF was created running the R code in the included chunks and then run LATEX on the ⋆.tex markup code. Thus, almost all figures, numbers, and results are generated while producing the PDF from the sources. The only exception we made to this principle was due to the fact that some neuroimage analysis runs for many hours or even days. The most extreme example is the call to xfibres for the ball-and-stick model in Sect. 5.2.5 which required almost 2 weeks of computation.

Preface

xi

In such cases, we saved the results in objects and reloaded them within the document for further processing. Apart from that, the book can be created from the data completely on the fly. With this book, we hope to make colleagues aware that already at its current stage, R offers substantial tools for modeling in neuroscience and that what’s available can be used as part of a more comprehensive analysis pipeline. We also hope to further encourage the statistics community to work on the many open problems neuroimaging currently offers and the neuroimaging community to consider using R as programming environment for their analysis. Berlin, Germany March 2019

Jörg Polzehl Karsten Tabelow

Contents

1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

1

2 Magnetic Resonance Imaging in a Nutshell . . . . . . . . . . . . 2.1 The Principles of Magnetic Resonance Imaging . . . . . . . 2.1.1 The Zeeman Effect for Atomic Nuclei . . . . . . . . 2.1.2 Macroscopic Magnetization Vector . . . . . . . . . . . 2.1.3 Spin Excitation and Relaxation . . . . . . . . . . . . . . 2.1.4 Spatial Localization and Pulse Sequences . . . . . . 2.1.5 MR Image Formation and Parallel Imaging . . . . . 2.2 Special MR Imaging Modalities . . . . . . . . . . . . . . . . . . 2.2.1 Functional Magnetic Resonance Imaging (fMRI) . 2.2.2 Diffusion-Weighted Magnetic Resonance Imaging (dMRI) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.2.3 Multiparameter Mapping (MPM) . . . . . . . . . . . .

. . . . . . . . .

5 5 5 6 7 9 10 11 11

....... .......

12 13

3 Medical Imaging Data Formats . . . . . . . . . . . . 3.1 DICOM Format . . . . . . . . . . . . . . . . . . . . . 3.2 ANALYZE and NIfTI Format . . . . . . . . . . . 3.3 The BIDS Standard for Neuroimaging Data .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

15 15 19 23

4 Functional Magnetic Resonance Imaging 4.1 Preprocessing fMRI Data . . . . . . . . . 4.1.1 Example Data . . . . . . . . . . . . 4.1.2 Slice Time Correction . . . . . . 4.1.3 Motion Correction . . . . . . . . . 4.1.4 Registration . . . . . . . . . . . . . . 4.1.5 Normalization . . . . . . . . . . . . 4.1.6 Brain Mask . . . . . . . . . . . . . . 4.1.7 Brain Tissue Segmentation . . . 4.1.8 Using Brain Atlas Information 4.1.9 Spatial Smoothing . . . . . . . . .

. . . . . . . . . . .

. . . . . . . . . . .

. . . . . . . . . . .

. . . . . . . . . . .

. . . . . . . . . . .

. . . . . . . . . . .

. . . . . . . . . . .

. . . . . . . . . . .

. . . . . . . . . . .

. . . . . . . . . . .

. . . . . . . . . . .

. . . . . . . . . . .

. . . . . . . . . . .

. . . . . . . . . . .

. . . . . . . . . . .

. . . . . . . . . . .

25 25 25 27 28 30 32 34 35 36 39

. . . . . . . . . . .

. . . . . . . . . . .

. . . . . . . . . . .

. . . . . . . . . . .

. . . . . . . . . . .

. . . . . . . . .

. . . . . . . . .

. . . . . . . . .

. . . . . . . . .

. . . . . . . . .

. . . . . . . . .

xiii

xiv

Contents

4.2 The General Linear Model (GLM) for fMRI . . . . . . . . . . . . . 4.2.1 Modeling the BOLD Signal . . . . . . . . . . . . . . . . . . . . 4.2.2 The Linear Model . . . . . . . . . . . . . . . . . . . . . . . . . . . 4.2.3 Simulated fMRI Data . . . . . . . . . . . . . . . . . . . . . . . . . 4.3 Signal Detection in Single-Subject Experiments . . . . . . . . . . . 4.3.1 Voxelwise Signal Detection and Multiple Comparison Problem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4.3.2 Bonferroni Correction . . . . . . . . . . . . . . . . . . . . . . . . 4.3.3 Random Field Theory . . . . . . . . . . . . . . . . . . . . . . . . 4.3.4 False Discovery Rate (FDR) . . . . . . . . . . . . . . . . . . . . 4.3.5 Cluster Thresholds . . . . . . . . . . . . . . . . . . . . . . . . . . . 4.3.6 Permutation Tests . . . . . . . . . . . . . . . . . . . . . . . . . . . 4.4 Adaptive Smoothing in fMRI . . . . . . . . . . . . . . . . . . . . . . . . 4.4.1 Analyzing fMRI Experiments with Structural Adaptive Smoothing Procedures . . . . . . . . . . . . . . . . . . . . . . . . 4.4.2 Structural Adaptive Segmentation in fMRI . . . . . . . . . 4.5 Other Approaches for fMRI Analysis Using R . . . . . . . . . . . . 4.5.1 Multivariate fMRI Analysis . . . . . . . . . . . . . . . . . . . . 4.5.2 Independent Component Analysis (ICA) . . . . . . . . . . . 4.6 Functional Connectivity for Resting State fMRI . . . . . . . . . . . 5 Diffusion-Weighted Imaging . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.1 Diffusion-Weighted MRI Data . . . . . . . . . . . . . . . . . . . . . . . 5.1.1 The Diffusion Equation and MRI . . . . . . . . . . . . . . . 5.1.2 Example Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.1.3 Data Preprocessing . . . . . . . . . . . . . . . . . . . . . . . . . 5.1.4 Reading Preprocessed Data . . . . . . . . . . . . . . . . . . . 5.1.5 Basic Data Properties . . . . . . . . . . . . . . . . . . . . . . . . 5.1.6 Definition of a Brain Mask . . . . . . . . . . . . . . . . . . . . 5.1.7 Characterization of Noise in Diffusion-Weighted MRI 5.2 Modeling Diffusion-Weighted MRI Data . . . . . . . . . . . . . . . 5.2.1 The Apparent Diffusion Coefficient (ADC) . . . . . . . . 5.2.2 Diffusion Tensor Imaging (DTI) . . . . . . . . . . . . . . . . 5.2.3 Diffusion Kurtosis Imaging (DKI) . . . . . . . . . . . . . . . 5.2.4 The Orientation Distribution Function . . . . . . . . . . . . 5.2.5 Tensor Mixture Models . . . . . . . . . . . . . . . . . . . . . . 5.3 Smoothing Diffusion-Weighted Data . . . . . . . . . . . . . . . . . . 5.3.1 Effects of Gaussian Filtering . . . . . . . . . . . . . . . . . . . 5.3.2 Multi-shell Position-Orientation Adaptive Smoothing (msPOAS) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.4 Fiber Tracking Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.5 Structural Connectivity . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . .

. . . . .

. . . . .

. . . . .

40 40 43 48 50

. . . . . . .

. . . . . . .

. . . . . . .

51 53 54 56 57 60 60

. . . . . .

. . . . . .

. . . . . .

62 65 67 67 70 75

. . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . .

81 81 81 84 84 92 94 98 99 106 107 108 117 120 128 135 136

. . . . 136 . . . . 140 . . . . 143

Contents

6 Multiparameter Mapping . . . . . . . . . . . . . . . . . . . . . . . . . . . 6.1 Quantitative MRI and the Multiparameter Mapping . . . . . 6.2 Signal Model in FLASH Sequences . . . . . . . . . . . . . . . . . 6.3 Data From the Multiparameter Mapping (MPM) Protocol . 6.4 Re-parameterization of the Signal Model by ESTATICS . . 6.5 Correction for Instrumental B1 -Bias . . . . . . . . . . . . . . . . . 6.6 Correction for the Bias Induced by Low SNR . . . . . . . . . 6.7 Structural Adaptive Smoothing of Relaxometry Data . . . .

xv

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

147 147 148 149 153 157 159 164

Appendix A: Smoothing Techniques for Imaging Problems . . . . . . . . . . 171 Appendix B: Resources for Neuroimaging in R . . . . . . . . . . . . . . . . . . . . 189 Appendix C: Data, Software, and Hardware Resources. . . . . . . . . . . . . . 201 References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 207 Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 227

Acronyms

(ms)POAS (w)ODF ADC AIC AR AWS BET BIC BIDS BOLD CHARMED CSF CT DKI dMRI DTI DWI EAP EO EPI ESTATICS FA FACT FAST FC FDR FLAIR FLASH fMRI

(Multi-shell) position-orientation adaptive smoothing (Weighted) orientation distribution function Apparent diffusion coefficient Akaike information criterion Autoregressive Adaptive weights smoothing Brain extraction tool Bayes information criterion Brain Imaging Data Structure Blood oxygenation level-dependent Composite hindered and restricted model of diffusion Cerebrospinal fluid X-ray computed tomography Diffusion kurtosis imaging Diffusion-weighted magnetic resonance imaging Diffusion tensor imaging Diffusion-weighted images Ensemble average propagator Effective order Echo planar imaging Estimating the apparent transverse relaxation time (R⋆2) from images with different contrasts Flip angle or fractional anisotropy Fiber assignment by continuous tracking FMRIB’s Automated Segmentation Tool Functional connectivity False discovery rate Fluid-attenuated inversion recovery Fast low angle shot Functional magnetic resonance imaging

xvii

xviii

FOV FSL FWE FWHM GA GE GLM GM GRAPPA HARDI HBM HRF IC ICA ITK JSON LANE MCMC MD MNI MPM MPRAGE MRI MT MVPA NLM PAWS PCA PD PET PGSE PS PVC-FA Q-ball qMRI RF RFT ROI SE SENSE SNR SPM TE TR WM

Acronyms

Field of view FMRIB Software Library Familywise error Full width half maximum Geodesic anisotropy Gradient echo General linear model Gray matter Generalized autocalibrating partial parallel acquisition High angular resolution diffusion imaging Human brain mapping Hemodynamic response function Independent component Independent component analysis Insight Segmentation and Registration Toolkit JavaScript Object Notation Local adaptive noise estimation Markov chain Monte Carlo Mean diffusivity Montreal Neurological Institute Multiparameter mapping Magnetization-prepared 180 degrees radio-frequency pulses and rapid gradient echo Magnetic resonance imaging Magnetization transfer Multivariate pattern analysis Nonlocal means Patchwise adaptive weights smoothing Principal component analysis Proton density Positron emission tomography Pulsed gradient spin echo Propagation-separation approach Partial volume corrected fractional anisotropy Q-ball imaging Quantitative magnetic resonance imaging Radio frequency Random field theory Region of interest Spin echo Sensitivity encoding (for fast MRI) Signal-to-noise ratio Statistical parametric map Echo time Repetition time White matter

Chapter 1

Introduction

Images are common in our lives. They come as simple photographs or as the result of various medical, technical, or scientific experiments and are often very easy to interpret for our visual capabilities as humans. It was therefore a real revolution when Lauterbur and Mansfield invented the use of the magnetic resonance phenomenon to generate images of the human body probably in the same way as X-ray. It enabled in vivo images of soft tissues and even better it was not based on ionizing radiation, like computed axial tomography (CT) or positron emission tomography (PET), but on magnetic fields and thus harmless and applicable in healthy subjects. Related to the subject of this book, this stipulated a lot of neuroscientific research on structure and function of the human brain. Often statistical models and methods are needed for the understanding of the information that is contained in the images. This has become even more important as neuroimaging evolved from providing images in two dimensions to three-dimensional volumes or time series of volumes or even data in five- or six-dimensional spaces. Then visual inspection becomes difficult if not impossible and the information has to be aggregated by appropriate methods. In the following chapters, we will demonstrate how such an analysis can be performed for the three MRI imaging modalities that we work with. Specifically, in Chap. 2, we give a very short introduction into the physics of magnetic resonance imaging (MRI). This includes the description of the image formation process and explains how the excitation of nuclear spins by radio-frequency waves leads to a spatial signal that we know as images. It also introduces the three specific MR imaging modalities that we cover in Chaps. 4–6. The chapter might be dropped, if the reader is only interested in the data analysis once the MR images have been reconstructed. Chapter 3 is dedicated to the handling of MRI data. It describes different data formats and how these can be accessed from an R session. As there are many different packages and solutions, we only detail a selection of packages and functions, which we generally rely on and find useful. The chapter also introduces the standardized BIDS format. © Springer Nature Switzerland AG 2019 J. Polzehl and K. Tabelow, Magnetic Resonance Brain Imaging, Use R!, https://doi.org/10.1007/978-3-030-29184-6_1

1

2

1 Introduction

Chapter 4 describes the analysis of functional magnetic resonance imaging (fMRI) data. Thereby, we focus on a single-subject analysis with the full pipeline of data preprocessing, the General Linear Model, and inference with correction for the multiplicity of the statistical tests. Part of the chapter elaborates on the use of structural adaptive smoothing procedure in fMRI, which we specifically developed. We also include alternative fMRI analysis methods, i.e., others then the mass-univariate approach. The chapter concludes with a section on functional connectivity. The second MR imaging modality is diffusion-weighted MRI in Chap. 5. Diffusion MRI is prone to noise, with low signal-to-noise ratio (SNR) in case of highresolution and large diffusion gradients. There, we discuss properties of minimally processed data, the necessary preprocessing steps in dMRI and the effects of low SNR in modeling. We, in detail, describe a number of diffusion models ranging from the diffusion tensor model to tensor mixtures and to the orientation distribution function. We outline structural adaptive smoothing methods that are able to reduce the noise without blurring fine structures. Based on the specific diffusion models, we describe fiber tracking methods and introduce the concept of structural connectivity. DMRI is part of quantitative MRI as it infers on physical quantities, here the direction-dependent diffusion constant. Specific sequences allow for the direct estimation of the relaxation times of the spin excitation process and other quantitative parameters. In Chap. 6, we therefore discuss a relatively new sequence called multiparameter mapping. We describe the estimation model, required bias correction methods, and a structural adaptive smoothing method for this kind of data, which allows for noise reduction especially at high spatial resolutions. One connecting element of Chaps. 4–6 is the structural adaptive smoothing methods based on the propagation-separation approach (Polzehl and Spokoiny 2006) that come in different flavors depending on the specific modality. We therefore review its developments in Appendix A and discuss its relation to general nonparametric smoothing methods. Appendix B gives an overview of R packages that are related to neuroimaging and describes data sources. Finally, Appendix C summarizes data, packages, and hardware requirements for the examples given in this book. Using these, (almost) all results and figures in this book can be reproduced. This book focuses on neuroimaging analysis with R, i.e., the combination of the analysis, mainly statistical, of neuroimaging data, with its implementation in a specific programming language. Such an approach naturally remains incomplete. However, we can recommend a number of excellent textbooks for further reading and more details. For example, regarding R we like to refer to the excellent book Wickham (2019). The physics of magnetic resonance imaging (MRI) is explained in Callaghan (1991). For readers without a strong background in physics, the first chapters in Huettel et al. (2014) provide an accessible explanation both as an overview and a more in-depth elaboration. A comprehensive introduction into the analysis of magnetic resonance imaging data is provided in Jenkinson and Chappell (2017). Functional magnetic resonance imaging (fMRI) and its analysis is the actual topic of Huettel et al. (2014). Some books on fMRI especially from a statistical perspective are

1 Introduction

3

Friston et al. (2007), Lazar (2008), or Poldrack et al. (2011). The recent and very comprehensive collection in Ombao et al. (2016) provides not only a state-of-the-art review of data analysis in fMRI, but also for diffusion magnetic resonance imaging (dMRI), which is the second important MRI modality which we cover in this book. For an introduction into dMRI, we refer to Johansen-Berg and Behrens (2013) or Jones (2010). Last but not least as a specific recommendation for those readers interested in brain connectivity we mention Sporns (2011).

Chapter 2

Magnetic Resonance Imaging in a Nutshell

2.1 The Principles of Magnetic Resonance Imaging Since its invention in the early 70s by Lauterbur (Lauterbur 1973; Mansfield and Grannell 1973) and Mansfield (Mansfield 1977), for which they shared the 2003 Nobel prize in Physiology and Medicine, magnetic resonance imaging (MRI) has evolved into a versatile tool for the in vivo examination of tissue. One of the reasons for this is that it provides a large number of image contrast mechanisms especially suited for imaging soft tissue. Furthermore, unlike X-ray computed tomography (CT) and positron emission tomography (PET), it does not rely on high energetic radiation but on the interaction of a strong magnetic field and resonant radio-frequency (RF) waves with the atomic nuclei. Hence, it does in principle not harm the examined tissue and can be applied also in healthy subjects. Thus, MRI is a perfect tool for the examination of the living brain in neuroimaging which is the subject of this book. MRI is based on the nuclear magnetic resonance phenomenon. For a very comprehensive introduction into the physics, we refer to the excellent textbook of Callaghan (1991). For those readers who do not have a strong background in physics, the first chapters in Huettel et al. (2014) may be a more appropriate choice. Although MRI is based on quantum mechanical properties of the particles at the sub-atom level, the large ensemble of particles in the tissue allows for a semiclassical description that can be relatively easily accessed, cf. also Hanson (2008). Here, we very(!) shortly review the basic ideas of MRI.

2.1.1 The Zeeman Effect for Atomic Nuclei The behavior of atomic nuclei is inherently quantum mechanical. Mathematically, the states of quantum mechanical objects are described by eigenfunctions of operators in some Hilbert space that correspond to observable quantities. Typically, the set of eigenvalues for these observables is discrete rather than spanning a continuous range. For MRI these are, e.g., the energy of a particle and the nuclear spin I , which every atomic nucleus possesses.

© Springer Nature Switzerland AG 2019 J. Polzehl and K. Tabelow, Magnetic Resonance Brain Imaging, Use R!, https://doi.org/10.1007/978-3-030-29184-6_2

5

6

2 Magnetic Resonance Imaging in a Nutshell

  H HH

?

γ B0 6

Iz = − 12 Iz = + 12

Fig. 2.1 The Zeeman effect for a nuclear spin of size I = 21 shows the splitting of the energy levels of a particle in the presence of a magnetic field. As a result, the state with antiparallel spin I = − 21 has a slightly higher energy

I is an angular momentum and can have an integer or half-integer value in units 19 of , the Planck constant divided by 2π . For example, a 1 H (proton), a 13 6 C, or a 9 F nucleus have I = 21 . A deuteron 2 H has I = 1, while the predominant carbon isotope 12 6 C has no spin I = 0. Here, we will only be concerned with the hydrogen nucleus 1 H as it is omnipresent in biological tissue and is mainly used in MRI. We generally describe the quantum mechanical states of the spin of a single 1 H nucleus in terms of the eigenfunctions of the z-component Iz of the spin operator. Then, there exist two spin states having a value of ± 21 for Iz . As the spin operator is an angular momentum, quantum mechanical commutation rules dictate that the eigenstates of Iz are not eigenstates of the x- and y-component. This means that once the z-component is measured, neither of the other two components can be measured simultaneously, which gives rise to the precession movement of the macroscopic magnetization vector considered in the next section. Nuclear magnetic resonance is now based on the Zeeman effect for the nuclear energy levels (Callaghan 1991). The effect describes the splitting of the energy levels of an atomic nucleus in the presence of some external magnetic field B0 . This splitting arises from the interaction of the field B0 with the nuclear magnetic momentum μ of the nucleus, which in turn is due to the nuclear spin I . For convenience we choose the magnetic field to be aligned in z-direction, hence B0 = (0, 0, B0 ). The splitting of the spectral lines is then according to the value of Iz , see Fig. 2.1, and leads to a small difference in energy of the two states which is of size: ΔE = γ B0 . Here, γ is the gyromagnetic ratio, which is an intrinsic property of the nucleus under consideration.

2.1.2 Macroscopic Magnetization Vector In thermal equilibrium, there will be a population difference for these states according to the Boltzmann factor, with less than half of all nuclei in the higher energetic state. Summing up all magnetic moments of all nuclei in the ensemble, this gives rise

2.1 The Principles of Magnetic Resonance Imaging

7

 . All states of the ensemble can to a macroscopically measurable magnetization M  . Specifically, the temporal development of the bulk then be described in terms of M  is governed by the equation: magnetization M  ∂M  × B0 ), = γ (M ∂t where × denotes the cross product. The general solution of this equation is a preces around the z-axis with the Larmor frequency sion movement of M ω0 = γ B0 , which is in the radio-frequency regime. For example, for a proton (1 H) in a magnetic field B0 = 3 T, we find ω0 = 128 MHz. In thermal equilibrium, the transverse  vanishes and M  = (0, 0, M0 ). component of M Note that this interpretation for the precession movement is only valid for the  . The transverse component of a single nuclear spin is macroscopic magnetization M not observable due to the abovementioned commutation rules of the spin operator. This contradiction resolves when we consider the evolution operator of the quantum mechanical state, which describes a rotation around z with frequency ω0 . Although a single transverse spin component is not observable, the ensemble behavior sums up to a macroscopic transverse magnetization which rotates with Larmor frequency.

2.1.3 Spin Excitation and Relaxation It is possible to excite this system of spins by a transverse oscillating field B1 with the resonance frequency ω0 . Having in mind the typical values for ω0 , this is basically the application of a transverse radio-frequency wave. A detailed examination of  is displaced from its this excitation process yields that the magnetization vector M equilibrium alignment with the z-axis. The (flip) angle of this excitation of duration t is α = ω1 t, where ω1 = γ B1 is the precession frequency around the, say, x-axis due to the field B1 , see Fig. 2.2. After such an excitation, there is a nonvanishing  , which is then precessing at frequency ω0 around the transverse component of M z-axis. Quantum mechanically, the resonant excitation can be interpreted as switching a number of spins from the lower to the higher energy state in the Zeeman levels, . which lowers the longitudinal component Mz of M Once the transverse pulse is turned off, the system returns to the equilibrium state by individual nuclei switching back to the lower energy state until the equilibrium  rotates population is reached again. Macroscopically, the magnetization vector M  induces a measurable current in back to z direction. The precession movement of M the receiver coils placed around the tissue. Physically, there are two processes that govern the relaxation process and that operate on different timescales. The longitudi-

8

2 Magnetic Resonance Imaging in a Nutshell

 by a transverse resonant excitation field B1 , Fig. 2.2 Displacement of the magnetization vector M specifically in x-direction, i.e., an x-pulse

 relaxes exponentially with time constant T1 due to spin–lattice nal component of M relaxation. On the other hand, the relaxation of the transverse component has a different timescale T2 as it has different physical origin and is mainly due to spin–spin , relaxation. Using the notation M+ = Mx + iMy for the transverse component of M we get the Bloch equations M+ ∂M+ = −ω0 M+ − ∂t T2 ∂Mz = −(Mz − M0 )/T1 ∂t for the phenomenological description of the relaxation process. Due to magnetic field inhomogeneities, the transverse signal can decay even faster than with time constant T2 ; this time is usually denoted as T2 . The solution of these equations is given by M+ = Mxy0 exp(−t/T2 ) exp(−iω0 t) Mz = M0 (1 − exp(−t/T1 )) where Mxy0 denotes the initial magnitude of the transverse magnetization. The measured MR signal then reflects the sum of all transverse magnetization in the bulk. MRI requires successive excitations with a characteristic time between the excitation pulses, known as TR (repetition time). As the relaxation time T1 is typically rather large, the new excitation may occur without full recovery of the longitudinal magnetization. Thus, the MR signal is basically given by S = M0 (1 − exp(−TR/T1 )) exp(−t/T2 ).

(2.1)

2.1 The Principles of Magnetic Resonance Imaging

9

2.1.4 Spatial Localization and Pulse Sequences In a static magnetic field B0 , all spins possess the same Larmor frequency ω0 . So do all electromagnetic waves from the relaxation processes after excitation. Thus, it is not possible to resolve the source of a signal from any specific location of the bulk. It was the core idea of Lauterbur and Mansfield how to determine the spatial location of the signal and make nuclear magnetic resonance an imaging technique. Specifically, the spatial resolution of MRI is achieved through the additional application of magnetic field gradients leading to spatially varying magnetic field and consequently Larmor frequency. The application of radio-frequency pulses for excitation in combination with magnetic field gradients forms specific MR sequences. Depending on the desired MR contrast, there exist a plethora of specific sequences. This variability is one of the sources of the enormous interest in MRI. Most common in MRI are two basic experimental designs for MR sequences, namely, the gradient-echo (GE) and the spin-echo (SE) sequence. For a detailed introduction, we refer the reader to the textbooks Callaghan (1991) and Huettel et al. (2014). The basic difference between a gradient-echo and a spin-echo sequence is that in the latter an additional 180◦ pulse flips the magnetization of the spins to the opposite direction. This refocusing pulse eliminates the effects of magnetic field inhomogeneities, such that in Eq. (2.1) T2 enters instead of T2 for gradient-echo sequences. The analysis of the MR signal size at the echo time t = TE of the acquisition of the signal echo for different choices of TR and TE, see Eq. (2.1), reveals that the contrast of the signal from tissues with different T1 relaxation times is largest for intermediate TR and short TE (T1 -weighted image). For long TR and intermediate TE, the signal contrast for tissue with different T2 times is enhanced (T2 -weighted image), while proton density-weighted images (PDw) are related to long TR and short TE. Figure 2.3 provides orthographic views for MR brain images obtained within the “Kirby21” reproducibility study (Landman et al. 2011) using three different imaging sequences: dataDir