Next Article in Journal
Precision Medicine Care in ADHD: The Case for Neural Excitation and Inhibition
Next Article in Special Issue
Built to Last: Functional and Structural Mechanisms in the Moth Olfactory Network Mitigate Effects of Neural Injury
Previous Article in Journal
KCNA2 Autoimmunity in Progressive Cognitive Impairment: Case Series and Literature Review
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

A R-Script for Generating Multiple Sclerosis Lesion Pattern Discrimination Plots

by
Robert Marschallinger
1,2,*,
Carmen Tur
3,4,
Hannes Marschallinger
5 and
Johann Sellner
2,6,7
1
Department of Geoinformatics, University of Salzburg, Schillerstr 30, 5020 Salzburg, Austria
2
Department of Neurology, Christian Doppler Medical Center, Paracelsus Medical University, Ignaz-Harrer Str. 79, 5020 Salzburg, Austria
3
Department of Neuroinflammation, Queen Square Multiple Sclerosis Centre, UCL Institute of Neurology, University College London, London WC1N 3BG, UK
4
Neurology/Neuroimmunology Department, Multiple Sclerosis Centre of Catalonia, Vall d’Hebron University Hospital, 08035 Barcelona, Spain
5
Marschallinger GeoInformatik, Fischtagging 87, 5201 Seekirchen, Austria
6
Department of Neurology, Landesklinikum Mistelbach-Gänserndorf, Liechtensteinstr. 67, 2130 Mistelbach, Austria
7
Department of Neurology, Klinikum Rechts der Isar, Technische Universität München, Ismaninger Str. 22, 81675 München, Germany
*
Author to whom correspondence should be addressed.
Brain Sci. 2021, 11(1), 90; https://doi.org/10.3390/brainsci11010090
Submission received: 22 November 2020 / Revised: 3 January 2021 / Accepted: 5 January 2021 / Published: 12 January 2021

Abstract

:
One significant characteristic of Multiple Sclerosis (MS), a chronic inflammatory demyelinating disease of the central nervous system, is the evolution of highly variable patterns of white matter lesions. Based on geostatistical metrics, the MS-Lesion Pattern Discrimination Plot reduces complex three- and four-dimensional configurations of MS-White Matter Lesions to a well-arranged and standardized two-dimensional plot that facilitates follow-up, cross-sectional and medication impact analysis. Here, we present a script that generates the MS-Lesion Pattern Discrimination Plot, using the widespread statistical computing environment R. Input data to the script are Nifti-1 or Analyze-7.5 files with individual MS-White Matter Lesion masks in Montreal Normal Brain geometry. The MS-Lesion Pattern Discrimination Plot, variogram plots and associated fitting statistics are output to the R console and exported to standard graphics and text files. Besides reviewing relevant geostatistical basics and commenting on implementation details for smooth customization and extension, the paper guides through generating MS-Lesion Pattern Discrimination Plots using publicly available synthetic MS-Lesion patterns. The paper is accompanied by the R script LDPgenerator.r, a small sample data set and associated graphics for comparison.

1. Introduction

Multiple sclerosis (MS), an inflammatory demyelinating disease of the central nervous system with neurodegenerative processes in the later course, affects more than 2.5 million people worldwide. It is the leading nontraumatic cause of serious neurologic disability in young adults. MS is initially characterized by phases of clinical relapses and remissions in 80–90% of the patients, and frequently followed by progression of disability over time. MS is highly variable—from benign to disastrous [1]: some patients may accumulate severe and irreversible disability within a few years, while others may show a benign course with just little or no disability even after decades. The hallmark of MS are lesions in the white and grey matter of the central nervous system, which are hyperintense on T2-weighted MRI sequences. MRI is the key technology to assess MS-lesion dissemination in space and time [2]. The number of MS-lesions, total lesion volume, spatial lesion pattern and single lesion shape are highly variable across patients with MS [3]. This makes the correlation of radiological data and clinical findings extremely challenging—a situation also known as the “clinicoradiological paradox” [4].
Variography, a core method of classical geostatistics, proved suitable for explorative data analysis (EDA) of MS-White Matter Lesion patterns (MS-WML) and for extracting quantitative spatial-statistics metrics on MS-WML. The MS-Lesion Pattern Discrimination Plot (MS-LDP) summarizes these metrics in a clear and standardized form, to aid in follow-up, cross-sectional and medication impact analysis [5,6]. With the aid of the MS-LDP, significantly different evolution of MS-lesion patterns could be disclosed between male and female early MS cohorts [7].

2. Materials and Methods

2.1. Sample Data

Three phantoms of brains with MS-lesions (MNI_mild, MNI_moderate, MNI_severe) that were used for both illustrating this paper and as the accompanying sample data were downloaded from: https://brainweb.bic.mni.mcgill.ca/brainweb/anatomic_ms.html.

2.2. Software

The R-script LDPgenerator.r (Supplementary Materials, see Appendix A for description) is based on the statistical computing environment R [8] and was developed and tested in R version 3.6.0. LDPgenerator.r, the above-mentioned sample data and result files can be found in Appendix A. RNifti, a necessary R package can be downloaded and installed from the CRAN package repository: https://CRAN.R-project.org/package=RNifti.

2.3. Basics of the MS-Lesion Pattern Discrimination Plot

Below, the rationale behind and the making of the MS-Lesion Pattern Discrimination Plot (MS-LDP) is reviewed in compact form. For a more in-depth discussion of the clinical background, especially the application of the MS-LDP to real-world data sets, see [5,6,7]. As an example of MS-LDP graphics depicting a larger cohort of patients with MS that was processed with LDPgenerator.r, see LDP_Supplement.jpg in Appendix A (from [7], where also an interpretation of this MS-LDP can be found).
Based on geostatistical methods, LDPgenerator.r produces MS-LDP from either binary MS-WML masks or MS-WML probability maps in Montreal Normal Brain (MNB) geometry (Figure 1).
In the current context, a binary MS-WML mask is a voxel array that represents MS-lesions with voxel value of 1 and all other voxels with value of 0. Such masks are derived from MRI data either by expert manual labelling the MS-lesions with specific software (e.g., MRIcron, [9]) or by automatic MS-lesion extraction software (e.g., LST, [10]). Automatic MS-lesion extraction software yields MS-WML probability maps with lesion probability values between 0.0 and 1.0. These can be internally binarized by LDPgenerator.r, employing a user-supplied threshold. MNB geometry means that individual brain geometry is mapped to the Montreal Normal Brain template [11], usually with the help of dedicated software (e.g., SPM [12] or FSL [13]).
Geostatistics comprises a range of algorithms for characterizing, modelling [14] and simulation [15] of multidimensional data and associated uncertainty, including spatiotemporal data [16]. Originally developed for mining optimization [17], geostatistics subsequently found the way into a variety of space-time related fields. In medicine, early applications of geostatistics deal with the creation of geomedical maps, showing the geographical distribution of disease cases (https://www.esri.com/library/ebooks/geomedicine.pdf) [18]. Possible applications of geostatistics go far beyond 2D mapping in the macro scales, however. For example, geostatistical methods can be readily employed in the micro scales [19,20] and enable quantitative texture analysis [21,22]. Since this paper focuses on the application of the variogram to texture analysis of MS-lesion patterns, a short excursus to the foundation of variography seems reasonable. The variogram is a central EDA tool in classical two-point geostatistics (“classical” as compared to the more recent approach of Multiple-Point Geostatistics [23]). The variogram (Figure 2) quantifies the spatial structure of measurements by contrasting the distance between pairs of measurement points (abscissa) and the associated variability (γ, on the ordinate). In other words, the variogram yields a measure of spatial correlation [24,25].
The empirical variogram γ(h) is straightforwardly computed using (Equation (1)):
γ ( h ) = 1 2 n ( h ) * i = 1 n ( ( z ( x i ) z ( x i + h ) ) 2
z(x) value of variable at some 3D location x, here z(x) is a voxel with z = binary variable (0 or 1); h lag vector of separation between observed data (units: here, mm); n(h) number of data pairs [z(x), z(x+h)] at lag h; γ(h) empirical variogram value for lag h.
The γ(h) of a binary MS-WML is calculated by comparing the values (0 or 1) of all voxel pairs within a specified lag h, according to Equation (1). Calculating γ(h) for increasing lag distances h, the empirical variogram plot (short: “the variogram”) is derived (Figure 2).
Variograms of binary MS-WML generally start with small values of γ at small h (distance in Figure 2), which is due to the large correlation of adjacent voxel pairs. After an increase in γ with lag away from the origin, with further increases in h the correlation decreases, and the variogram levels off. The flatter the variogram near its origin, the more pronounced is the spatial correlation (i.e., in the current context: the larger the MS-lesions will be, on average). Computing variograms for specific lag orientations yields so-called directional variograms. Individual directional empirical variograms in the three major orthogonal directions of MNB geometry (x, y, z directions, compare Figure 1) can be used to disclose and quantify spatial anisotropies of MS-lesion patterns.
Since empirical variograms focus on visual inspection, several permissible variogram functions for quantifying empirical variograms were introduced [26]. These functions approximate an empirical variogram’s shape by two parameters: the variogram range a, and the variogram sill c. Among the available variogram model functions, the exponential variogram model was found to be the most suitable for quantifying MS-lesion patterns [5]:
γ ( h ) = c ( 1 exp ( 3 | h | a ) )
c Sill; a Range; h lag vector of separation; γ(h) model variogram value for lag h.
When exponential variogram models are separately fitted to x, y, z directional variograms (Equation (2)), three value pairs are derived: a [ X ] , c [ X ] ;   a [ Y ] , c [ Y ] ;   a [ Z ] , c [ Z ] ; (with a [ X ] , c [ X ] ;   values of a ,   c in direction x, etc.). Plotting the natural logarithm of above three value pairs, the Component MS-LDP is produced (Figure 3a). It yields information on MS-WML geometrical anisotropies—e.g., lesion confluence along the CSF system, isotropic growth of individual lesions or Dawson fingers. The MS-LDP (Figure 3b) abstracts MS-WML geometry with just two parameters in combining above three value pairs by their means (Equation (3)):
a ¯ = ln ( m e a n ( a [ X ] , a [ Y ] , a [ Z ] ) ,   c ¯ = ln ( m e a n ( c [ X ] , c [ Y ] , c [ Z ] )
The MS-LDP quantifies important geometric aspects of MS-WML: a is considered a measure of spatial continuity, c is proxy of total lesion load. The higher a, the bigger and smoother (i.e., with less lesion surface roughness) are lesions; the higher c, the higher is total MS-lesion load. From analyzing a larger cohort of consistently acquired MS-WML, abscissa a, and ordinate c of the MS-LDP were defined to span: a … 0 to 3, c … −12 to −4 [6]. Figure 3a is a Component MS-LDP and Figure 3b is the associated MS-LDP, produced from MNI_mild, MNI_moderate and MNI_severe data.

3. Results (Developed Code)

3.1. LDPgenerator.r: Program and Data Flow

Figure 4 shows LDPgenerator.r code sections and sequence of operations. In short, the program flow is as follows: after the user has selected input and output files, for each input file, empirical variograms are calculated and exponential variogram models are fitted. Variogram graphics are generated and Component MS-LDP and MS-LDP parameters are stored in a container file. After processing all input files, plots are generated from the container file.
Below, code sections 1–5 are described in more detail (see Figure 4 and compare respective comments in LDPgenerator.r code):
  • Section 1 (code lines 11–12):
Package RNifti is loaded; this package is prerequisite for fast access to images stored in Nifti-1 or Analyze-7.5 medical image formats.
  • Section 2 (code lines 14–29):
Default values for variography parameters can be set by the user: image (binarization) threshold in case MS-lesion probability maps from automatic MS-lesion segmentation programs are to be processed, nonlinear least squares (nls) starting estimates, number of lags, graphics appearance.
ImageThreshold: The standard input to LDPgenerator is binary MS-WML, i.e., a binarized voxel array with MS-lesion voxels = 1 and all other voxels = 0. When floating-point MS-lesion probability maps with MS-lesion probabilities between 0.0 and 1.0 are input, ImageThreshold controls the conversion to binary: all voxels with values above ImageThreshold are set to 1.0 (MS-lesion), voxels with lower values are set to 0.0 (non-lesion).
Max_lag: Defines the number of distance classes (lags) used in variography. Each distance class is one voxel wide, i.e. measured in voxel dimension. Variograms of binary MS-WML should be confined to distances of 0–15 mm, because this range holds the most relevant correlation information [5]; i.e., if voxel dimension is 1.5 mm, Max_lag should be set to 10.
Guess_a, Guess_C: nls starting estimates for the Exponential Variogram Model. For further information on nls (Nonlinear Least Squares function) parameters, see the R documentation.
LDPxdim, LDPydim: Size of LDP and Variogram graphics output, in pixels (width, height).
LDPsymbolsize, LDPtextsize: Relative size of symbols and annotation text in MS-LDP graphics.
VarioGraphicsPostfix: File postfix of Variogram graphics per Nifti/Analyze file.
  • Section 3 (code lines 32–36): Input and output files are selected; LDPgenerator.r uses the straightforward graphical user interface (GUI) of base R.
List of input files (*.nii, *.img, *.hdr): Input files can be selected from the list presented by the GUI. Input files must be formatted Nifti-1.0 (file type *.nii) or Analyze-7.5 (file pairs of type *.hdr,*.img). Mixing Nifti and Analyze files is possible. Analyze files can be selected by selecting either .hdr or .img. Make sure input files are explicitly 3D in the image headers (!)
LDP container file (*.var): The user provides a file name, with standard extension var. The LDP container file (ASCII) contains variography data (compare Table 1) on each input file to generate the Component MS-LDP and MS-LDP graphics.
LDP graphics file (*.png): The user provides a file name, with standard extension .png. After processing all input files, LDPgenerator.r produces the MS-LDP (Figure 3b).
LDP component graphics file (*.png): The user provides a file name, with standard extension .png.
After processing all input files, LDPgenerator.r produces the Component MS-LDP with a, c symbols for x, y, z directions (compare Figure 3a). Graphics file format is portable network graphics.
  • Section 4 (code lines 46–207): In the central processing loop, for each input file, the following operations are performed:
  • Section 4a (code lines 51–69): RNifti extracts a voxel array and associated geometry data (number of voxels in x, y, z direction, xyz dimension per voxel).
  • Section 4b (code lines 71–76): The extracted voxel array is thresholded, yielding a classified result (1 = MS-lesion, 0 = rest).
  • Section 4c (code lines 78–139): Three individual empirical variograms are calculated—one per voxel array x, y, z direction, for lags 1 to Max_lag. Lag values and pair counts are stored.
  • Section 4d (code lines 141–175): An exponential variogram model is separately fit to each x, y, z empirical variograms, using the R nls function with starting estimates Guess_a, Guess_C. Derived model parameters ax, Cx, ay, Cy, az, Cz, and mean a, mean c values are stored for x, y, z directions.
  • Section 4e (code lines 177–200): Per input file, empirical variogram graphs and associated exponential variogram model functions for individual x, y, z directions are displayed and stored in png format, with associated filenames.
  • Section 4f (code lines 202–207): The index number (1 ... n) of processed MS-WML, the natural logarithm of model parameters mean(ax, ay, az), mean(Cx, Cy, Cz) and directional components ax, Cx, ay, Cy, az, Cz, and the respective input file name are appended to the LDP container file (ASCII). File contents are a good starting point for postprocessing geostatistical data on MS-WML (Table 1). MS-WML index numbers are displayed in MS-LDP and Component MS-LDP graphics to reference input file names while not overloading graphics.
  • Section 5 (code lines 209–248): MS-LDP and Component MS-LDP graphics are displayed and exported in png format. LDPgenerator.r terminates.

3.2. A Worked Example in 5 Steps

The associated sample data set comprises three MS-lesion probability maps (“brain phantoms”) downloaded from brainweb https://brainweb.bic.mni.mcgill.ca/brainweb/anatomic_ms.html, converted to the Analyze format. First, copy the file pairs MNI_mild.hdr, MNI_mild.img; MNI_moderate.hdr, MNI_moderate.img; MNI_severe.hdr, MNI_severe.img (files included in Supplementary Materials, see Appendix A for description) to a suitable directory. Then follow the 5 steps below:
  • Step 1: From standard R, launch LDPgenerator.r (no changes of parameters necessary in the script);
  • Step 2: Define input files: Navigate to the relevant directory and select MNI_mild.hdr, MNI_moderate.hdr and MNI_severe.hdr from the file list;
  • Step 3: Define the LDP container output file: In the highlighted input box, type MNI.var (Supplementary Materials, see Appendix A for description);
  • Step 4: Define the LDP graphics output file: In the highlighted input box, type MNI_LDP.png (Supplementary Materials, see Appendix A for description);
  • Step 5: Define the Component LDP graphics output file: In the highlighted input box, type MNI_LDP_xyz.png (Supplementary Materials, see Appendix A for description).
After step 5, LDPgenerator.r sequentially opens the selected input files and creates associated graphics containing variograms, variogram models and model parameters in the input file directory: MNI_mild.hdr_variograms.png, MNI_moderate.hdr_variograms.png, MNI_severe.hdr_variograms.png (files included in Supplementary Materials, see Appendix A for description). Moreover, variography parameters are appended to the LDP container file MNI.var. To avoid overloading graphics with labels, in MNI.var the input files are sequentially numbered from 1 … n, graphical elements in MNI_LDP_xyz.png and MNI_LDP.png are labelled accordingly.
Table 1 shows contents of LDP container file (ASCII) with variogram model parameters: ID, variogram model parameters and associated MS_WML file names.
As further example, a “real-world” MS-LDP that was used in a clinical study is included in Supplementary Materials (LDP_Supplement.jpg, Supplementary Materials, see Appendix A for description). See [7] for details and in-depth interpretation.

4. Discussion

Based on the widespread, freely available R statistics environment, LDPgenerator.r provides routine production of MS-Lesion Pattern Discrimination Plots, associated variogram graphics and statistics.
The first implementation for generating MS-LDP that was used in [5,6,7] involved operating-system based scripting and incorporated, besides R scripts, two MS-Windows based software components. Obviously, this was tedious, error-prone and limited the generation of MS-LDP to the MS-Windows operating system. As compared to above original implementation, MS-LDP can now be produced easily in standard R, by just selecting input files and defining output files via the R standard graphical user interface.
The script runs with acceptable speed, processing time for a typical MS-WML is about one minute on a current PC. Clearly, an interpreted language like R has drawbacks regarding processing speed. There are several opportunities for script improvement, however: LDPgenerator.r involves several loops, parts of which could be re-formulated as optimized user defined functions, which in turn would speed up the script. Except of package RNifti, the current version of LDPgenerator.r is implemented on base R. Since the R environment enables straightforward code extension with a wealth of packages, here are some ideas for customization/improvements:
  • Adding a 3D viewer: The recent version of RNifti (1.1) contains a basic viewer for easy implementation of Nifti/Analyze viewing. Providing interactive viewing of MS-WML would facilitate setting the correct binarization threshold values, via enabling visual checking of resulting lesion probability maps.
  • Availability of state-of-art GUI elements like customizable buttons, input boxes or spinners would enable easy tuning of variography and graphics parameters.
  • Using an improved graphics package—see: https://cran.r-project.org/web/views/Graphics.html. More sophisticated annotation elements like labels, scalable arrows, or improved legend elements would facilitate explorative data analysis of time series portrayed in the MS-LDP, e.g., data from follow-up MRI.
LDPgenerator.r was developed with R version 3.6.0 and tested with input data from variable sources. Some pitfalls occurred that need to be mentioned: LDPgenerator.r can process only Nifti and Analyze files that are declared “3D” in their file headers. Using R Studio to launch LDPgenerator.r, graphics generation failed with high-resolution (4k) graphics hardware. LDPgenerator.r was tested under Windows 7 and Windows 10 operating systems. While no problems occurred under Windows 7, under Windows 10, a Qt: Untested Windows version 10.0 detected! message is issued. In the current context this warning can be ignored, however.

Supplementary Materials

The following are available online at https://www.mdpi.com/2076-3425/11/1/90/s1, Program code and sample data to be found in Appendix A.

Author Contributions

Conceptualization, R.M., J.S.; methodology, R.M.; software, R.M., H.M.; validation, R.M., C.T. and J.S.; writing—original draft preparation, R.M., J.S. All authors have read and agreed to the published version of the manuscript.

Funding

This research received no external funding.

Institutional Review Board Statement

Not applicable, this article deals with software development only; associated test data sets are publicly available phantoms.

Informed Consent Statement

Not applicable.

Data Availability Statement

The test data presented in this study are available in the Supplementary Materials.

Acknowledgments

The authors would like to thank two anonymous reviewers for their very constructive contributions.

Conflicts of Interest

The authors declare no conflict of interest.

Appendix A

The zip file in the Supplementary Materials contains the following files:
  • R Script
    LDPgenerator.R
  • Sample data for testing LDPgenerator.R
    MNI_mild.hdr
    MNI_mild.img
    MNI_moderate.hdr
    MNI_moderate.img
    MNI_severe.hdr
    MNI_severe.img
  • Associated LDPgenerator.R result files from above sample data
    MNI_mild.hdr_variograms.png
    MNI_moderate.hdr_variograms.png
    MNI_severe.hdr_variograms.png
    MNI.var
    MNI_LDP_xyz.png
    MNI_LDP.png
  • LDP with data from Clinical Study [7] (Marschallinger et al., 2018), created by LDPgenerator.r
    LDP_Supplement.jpg

References

  1. Compston, A.; Coles, A. Multiple sclerosis. Lancet 2008, 372, 1502–1517. [Google Scholar] [CrossRef]
  2. Thompson, A.J.; Banwell, B.L.; Barkhof, F.; Carroll, W.M.; Coetzee, T.; Comi, G.; Correale, J.; Fazekas, F.; Filippi, M.; Freedman, M.S.; et al. Diagnosis of multiple sclerosis: 2017 revisions of the McDonald criteria. Lancet Neurol. 2018, 17, 162–173. [Google Scholar] [CrossRef]
  3. Filippi, M.; Rocca, M.A. MR Imaging of Multiple Sclerosis. Radiology 2011, 25, 659–681. [Google Scholar] [CrossRef] [PubMed]
  4. Louapre, C. Conventional and advanced MRI in multiple sclerosis. Rev. Neurol. 2018, 174, 391–397. [Google Scholar] [CrossRef] [PubMed]
  5. Marschallinger, R.; Golaszewski, S.M.; Kunz, A.B.; Kronbichler, M.; Ladurner, G.; Hofmann, P.; Trinka, E.; McCoy, M.; Kraus, J. Usability and potential of geostatistics for spatial discrimination of multiple sclerosis lesion patterns. J. Neuroimaging 2014, 4, 278–286. [Google Scholar] [CrossRef] [PubMed]
  6. Marschallinger, R.; Schmidt, P.; Hofmann, P.; Zimmer, C.; Atkinson, P.M.; Sellner, J.; Trinka, E.; Mühlau, M. A MS-lesion pattern discrimination plot based on geostatistics. Brain Behav. 2016, 6, e00430. [Google Scholar] [CrossRef] [PubMed] [Green Version]
  7. Marschallinger, R.; Mühlau, M.; Pongratz, V.; Kirschke, J.S.; Marschallinger, S.; Schmidt, P.; Sellner, J. Geostatistical Analysis of White Matter Lesions in Multiple Sclerosis Identifies Gender Differences in Lesion Evolution. Front. Mol. Neurosci. 2018, 11, 460. [Google Scholar] [CrossRef] [PubMed]
  8. R Core Team. R: A Language and Environment for Statistical Computing; R Foundation for Statistical Computing: Vienna, Austria, 2017; Available online: https://www.R-project.org/ (accessed on 7 January 2021).
  9. Rorden, C.; Brett, M. Stereotaxic display of brain lesions. Behav. Neurol. 2000, 12, 191–200. [Google Scholar] [CrossRef] [PubMed]
  10. Schmidt, P.; Gaser, C.; Arsic, M.; Buck, D.; Forschler, A. An automated tool for detection of FLAIR-hyperintense white-matter lesions in multiple sclerosis. NeuroImage 2012, 59, 3774–3783. [Google Scholar] [CrossRef] [PubMed]
  11. Xiao, Y.; Lau, J.C.; Anderson, T.; De Kraker, J.; Collins, D.L.; Peters, T.; Khan, A.R. An accurate registration of the BigBrain dataset with the MNI PD25 and ICBM152 atlases. Sci. Data 2019, 6, 210. [Google Scholar] [CrossRef] [PubMed] [Green Version]
  12. Frackowiak, R.S.J.; Friston, K.J.; Frith, C.D.; Dolan, R.J.; Mazziotta, J.C. Human Brain Function; Academic Press: New York, NY, USA, 1997. [Google Scholar]
  13. Woolrich, M.W.; Jbabdi, S.; Patenaude, B.; Chappell, M.; Makni, S.; Behrens, T.; Beckmann, C.; Jenkinson, M.; Smith, S.M. Bayesian analysis of neuroimaging data in FSL. NeuroImage 2009, 45, 173–186. [Google Scholar] [CrossRef] [PubMed]
  14. Wackernagel, H. Multivariate Geostatistics. An Introduction with Applications; Springer: Berlin/Heidelberg, Germany, 1995; 256p. [Google Scholar]
  15. Lantuejoul, C. Geostatistical Simulation. Models and Algorithms; Springer: Berlin/Heidelberg, Germany, 2002; 256p. [Google Scholar]
  16. Christakos, G. Modern Spatiotemporal Geostatistics; Oxford University Press: Oxford, UK, 2000; 288p. [Google Scholar]
  17. Krige, D.G. A statistical approach to some basic mine valuation problems on the Witwatersrand. J. Chem. Metal. Min. Soc. S. Afr. 1951, 52, 119–139. [Google Scholar]
  18. Blewett, M.; Kildluff, M. Geostatistical Analysis of Possible Spirochetal Involvement in Multiple Sclerosis (abstract). In Proceedings of the ESRI Users Group Conference, San Diego, CA, USA, 7–11 August 2006. [Google Scholar]
  19. Conan, V.; Gesbert, S.; Howard, C.V.; Jeulin, D.; Meyer, F.; Renard, D. Geostatistical and morphological methods applied to three-dimensional microscopy. J. Microsc. 1992, 166, 169–184. [Google Scholar] [CrossRef] [PubMed]
  20. Marschallinger, R.; Höck, V.; Topa, D. A Method for the 3-D Reconstruction of Chemically Zoned Minerals from Microprobe Scanned Serial Sections. Microsc. Anal. 1993, 5, 5–7. [Google Scholar]
  21. Kourgli, A.; Belhadj-aissa, A.; Bouchemakh, A. Optimizing texture primitives description based on variography and mathematical morphology. In Image Analysis and Recognition; Campilho, A., Kamel, M., Eds.; Springer: Berlin/Heidelberg, Germany, 2004. [Google Scholar]
  22. Trevisani, S.; Cavalli, M.; Marchi, L. Variogram maps from LiDAR data as fingerprints of surface morphology on scree slopes. Nat. Hazards Earth Syst. Sci. 2009, 9, 129–133. [Google Scholar] [CrossRef] [Green Version]
  23. Mariethoz, G.; Caers, J. Multiple-Point Geostatistics. Stochastic Modeling with Training Images; Wiley-Blackwell: Oxford, UK, 2015; 364p. [Google Scholar]
  24. Deutsch, C.; Journel, A.G. Geostatistical Software Library and User’s Guide; Oxford Univ. Press: Oxford, UK, 1992; 340p. [Google Scholar]
  25. Gringarten, E.; Deutsch, C.V. Methodology for variogram interpretation and modeling for improved reservoir characterization. In Proceedings of the SPE Annual Technical Conference and Exhibition, Houston, TX, USA, 3–6 October 1999; pp. 1–13. [Google Scholar] [CrossRef]
  26. Cressie, N.A.C. Statistics for Spatial Data; Wiley: Hoboken, NJ, USA, 1993. [Google Scholar]
Figure 1. 3D-view of binary MS-lesion mask in MNB geometry (phantom of human brain with severe MS lesions, binarized (threshold value = 0.5). MS-lesions (with voxel value of 1) are magenta, all other volume (with voxel value of 0) is transparent. Small insert top left indicates position of MS-lesions within white matter (transparent grey). Axis colors: x = red, y = green, z = blue. Axis scale: millimeters.
Figure 1. 3D-view of binary MS-lesion mask in MNB geometry (phantom of human brain with severe MS lesions, binarized (threshold value = 0.5). MS-lesions (with voxel value of 1) are magenta, all other volume (with voxel value of 0) is transparent. Small insert top left indicates position of MS-lesions within white matter (transparent grey). Axis colors: x = red, y = green, z = blue. Axis scale: millimeters.
Brainsci 11 00090 g001
Figure 2. Variogram plot: Distance (abscissa) vs. γ (ordinate) with directional empirical variograms, separately fitted variogram models and associated model parameters a, c. Red, green, blue colors refer to variography x, y, z directions. Dots represent empirical directional variogram values, lines are fitted exponential variogram models, parameters a, c define coordinates of squares as derived from variogram modeling. Produced with LDPgenerator.r from binary MS-WML mask in Figure 1. See text for details.
Figure 2. Variogram plot: Distance (abscissa) vs. γ (ordinate) with directional empirical variograms, separately fitted variogram models and associated model parameters a, c. Red, green, blue colors refer to variography x, y, z directions. Dots represent empirical directional variogram values, lines are fitted exponential variogram models, parameters a, c define coordinates of squares as derived from variogram modeling. Produced with LDPgenerator.r from binary MS-WML mask in Figure 1. See text for details.
Brainsci 11 00090 g002
Figure 3. (a) Component MS-LDP, ln(a[x,y,z]) vs. ln(c[x,y,z]) for MS-WML: MNI_mild (label = 1), MNI_moderate (label = 2) and MNI_severe (label = 3). Each MS-WML geometry is expressed by x, y, z directional variogram model parameters, indicated by red, green, blue squares. For MNI_mild, a strong anisotropy according to MS-lesions stretched in z direction is indicated by relatively higher ln(a[z]). (b) MS-LDP, mean (ln(a[xyz]) vs. mean (ln(c[xyz]) for MNI_mild (label = 1), MNI_moderate (label = 2) and MNI_severe (label = 3). MS-lesion pattern (1, 2, 3) geometry is abstracted to one point each. This is useful to avoid overloading graphics when working with a larger number of MS-WML (e.g., [5,6], compare the real-world MS_LDP: LDP_Supplement.jpg, in Appendix A).
Figure 3. (a) Component MS-LDP, ln(a[x,y,z]) vs. ln(c[x,y,z]) for MS-WML: MNI_mild (label = 1), MNI_moderate (label = 2) and MNI_severe (label = 3). Each MS-WML geometry is expressed by x, y, z directional variogram model parameters, indicated by red, green, blue squares. For MNI_mild, a strong anisotropy according to MS-lesions stretched in z direction is indicated by relatively higher ln(a[z]). (b) MS-LDP, mean (ln(a[xyz]) vs. mean (ln(c[xyz]) for MNI_mild (label = 1), MNI_moderate (label = 2) and MNI_severe (label = 3). MS-lesion pattern (1, 2, 3) geometry is abstracted to one point each. This is useful to avoid overloading graphics when working with a larger number of MS-WML (e.g., [5,6], compare the real-world MS_LDP: LDP_Supplement.jpg, in Appendix A).
Brainsci 11 00090 g003
Figure 4. LDPgenerator.r program and data flow chart, indicating sequence of operations (blue labels) involved in generating MS-LDP. Grey labels are code sections, central processing loop is on grey background.
Figure 4. LDPgenerator.r program and data flow chart, indicating sequence of operations (blue labels) involved in generating MS-LDP. Grey labels are code sections, central processing loop is on grey background.
Brainsci 11 00090 g004
Table 1. Contents of variogram parameter file MNI.var.
Table 1. Contents of variogram parameter file MNI.var.
IDln(avg(a[xyz]))ln(avg(C[xyz]))ln(aX)ln(CX)ln(aY)ln(CY)ln(az)ln(CZ)File
10.62610−9.741820.30975−9.745330.40066−9.750811.01342−9.72945MNI_mild.img
21.00625−7.592340.89172−7.581710.98117−7.635541.13109−7.56123MNI_moderate.img
31.48463−6.514061.30517−6.473901.51387−6.575101.61090−6.49598MNI_severe.img
Publisher’s Note: MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Share and Cite

MDPI and ACS Style

Marschallinger, R.; Tur, C.; Marschallinger, H.; Sellner, J. A R-Script for Generating Multiple Sclerosis Lesion Pattern Discrimination Plots. Brain Sci. 2021, 11, 90. https://doi.org/10.3390/brainsci11010090

AMA Style

Marschallinger R, Tur C, Marschallinger H, Sellner J. A R-Script for Generating Multiple Sclerosis Lesion Pattern Discrimination Plots. Brain Sciences. 2021; 11(1):90. https://doi.org/10.3390/brainsci11010090

Chicago/Turabian Style

Marschallinger, Robert, Carmen Tur, Hannes Marschallinger, and Johann Sellner. 2021. "A R-Script for Generating Multiple Sclerosis Lesion Pattern Discrimination Plots" Brain Sciences 11, no. 1: 90. https://doi.org/10.3390/brainsci11010090

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop