Last updated on 2018-01-24 by Brandon Whitcher

**Data Input/Output**

*DICOM*

The industry standard format, for data coming off a clinical
imaging device, is DICOM
(Digital Imaging and Communications in Medicine). The DICOM
"standard" is very broad and very complicated. Roughly speaking
each DICOM-compliant file is a collection of fields organized into
two four-byte sequences (group,element) that are represented as
hexadecimal numbers and form a *tag*. The (group,element)
combination announces what type of information is coming next.
There is no fixed number of bytes for a DICOM header. The final
(group,element) tag should be the "data" tag (7FE0,0010), such
that all subsequent information is related to the image(s).

- The packages oro.dicom, divest, fmri and tractor.base (part of the tractor project) provide R functions that read DICOM files and facilitate their conversion to ANALYZE or NIfTI format.

*ANALYZE and NIfTI*

Although the industry standard for medical imaging data is DICOM, another format has come to be heavily used in the image analysis community. The ANALYZE format was originally developed in conjunction with an image processing system (of the same name) at the Mayo Foundation. An Anlayze (7.5) format image is comprised of two files, the "hdr" and "img" files, that contain information about the acquisition and the acquisition itself, respectively. A more recent adaption of this format is known as NIfTI-1 and is a product of the Data Format Working Group (DFWG) from the Neuroimaging Informatics Technology Initiative (NIfTI). The NIfTI-1 data format is almost identical to the ANALYZE format, but offers a few improvements: merging of the header and image information into one file (.nii), re-organization of the 348-byte fixed header into more relevant categories and the possibility of extending the header information.

- The packages RNifti, AnalyzeFMRI, fmri, tractor.base (part of the tractor project), oro.nifti, and neuroim all provide functions that read/write ANALYZE and NIfTI files.

**Magnetic Resonance Imaging (MRI)**

*Diffusion Tensor Imaging (DTI)*

- The R package dti provides structural adaptive smoothing methods for the analysis of diffusion weighted data in the context of the DTI model. Due to its edge preserving properties these smoothing methods are capable of reducing noise without compromizing significant structures (e.g., fibre tracts). The package also provides functions for DTI data processing from input, via tensor reconstruction to visualization (2D and 3D).
- The tractor.base package (part of the tractor project) consists of functions for reading, writing and visualising MRI images. Images may be stored in ANALYZE, NIfTI or DICOM file formats, and can be visualised slice-by-slice or in projection. It also provides functions for common image manipulation tasks, such as masking and thresholding; and for applying arbitrary functions to image data. The package is written in pure R.

- Diffusion anisotropy has been used to characterize white matter neuronal pathways in the human brain, and infer global connectivity in the central nervous system. The gdimap package implements algorithms to estimate and visualize the orientation of neuronal pathways using model-free methods (q-space imaging methods). The estimation of fibre orientation has been implemented using (1) by extracting local maxima or (2) directional statistical clustering of the ODF voxel data.

*Dynamic Contrast-Enhanced MRI (DCE-MRI)*

- The DATforDCEMRI package performs voxel-wise deconvolution analysis of contrast agent concentration versus time data and generates the impulse response function (IRF), which may be used to approximate commonly utilized kinetic parameters such as Ktrans and Ve. An interactive advanced voxel diagnosis tool (AVDT) is also provided to facilitate easy navigation of the voxel-wise data.
- The dcemriS4 package contains a collection of functions to perform quantitative analysis from a DCE-MRI (or diffusion-weighted MRI) acquisition on a voxel-by-voxel basis and depends on the S4 implementation of the NIfTI and ANALYZE classes in oro.nifti. Data management capabilities include: read/write for NIfTI extensions, full audit trail, improved visualization, etc. The steps to quantify DCE-MRI are as follows: motion correction and/or co-registration, T1 estimation, conversion of signal intensity to gadolinium contrast-agent concentration and kinetic parameter estimation. Parametric estimation of the kinetic parameters, from a single-compartment (Kety or extended Kety) model, is performed via Levenburg-Marquardt optimization or Bayesian estimation. Semi-parametric estimation of the kinetic parameters is also possible via Bayesian P-splines.

*Functional Connectivity*

- The brainwaver package provides basic wavelet analysis of multivariate time series with a visualisation and parametrisation using graph theory. It computes the correlation matrix for each scale of a wavelet decomposition, via waveslim. Hypothesis testing is applied to each entry of one matrix in order to construct an adjacency matrix of a graph. The graph obtained is finally analysed using small-world theory and, with efficient computation techniques, tested using simulated attacks. The brainwaver project is complementary to the CamBA project for brain image data processing. A collection of scripts (with a makefile) is available to download along with the brainwaver package.

*Functional MRI*

- adaptsmoFMRI contains R functions for estimating the blood oxygenation level dependent (BOLD) effect by using functional magnetic resonance imaging (fMRI) data, based on adaptive Gauss Markov random fields, for real as well as simulated data. Inference of the underlying models is performed by efficient Markov Chain Monte Carlo simulation, with the Metropolis Hastings algorithm for the non-approximate case and the Gibbs sampler for the approximate case. When comparing the results of approximate to the non-approximate version the outcome is in favour of the former, as the gain of accuracy in estimation, when not approximating, is minimal and the computational burden becomes less cumbersome.
- AnalyzeFMRI is a package originally written for the processing and analysis of large structural and functional MRI data sets under the ANALYZE format. It has been updated to include new functionality: complete NIfTI input/output, cross-platform visualization based on Tcl/Tk components, and spatial/temporal ICA (Independent Components Analysis) via a graphical user interface (GUI).
- The package arf3DS4 applied the active region fitting (ARF) algorithm for the analysis of functional magnetic resonance imaging (fMRI) data. ARF uses Gaussian shape spatial models to parameterize active brain regions.
- The R package fmri provides tools for the analysis of functional MRI data. The core is the implementation of a new class of adaptive smoothing methods. These methods allow for a significant signal enhancement and reduction of false positive detections without, in contrast to traditional non-adaptive smoothing methods, reducing the effective spatial resolution. This property is especially of interest in the analysis of high-resolution functional MRI. The package includes functions for input/output of some standard imaging formats (ANALYZE, NIfTI, AFNI, DICOM) as well as for linear modelling the data and signal detection using Random Field Theory. It also includes ICA and NGCA (non-Gaussian Components Analysis) based methods and hence has some overlap with AnalyzeFMRI.
- Neuroimage is an R package (currently only available within the neuroim project on R-Forge) that provides data structures and input/output routines for functional brain imaging data. It reads and writes NIfTI-1 data and provides S4 classes for handling multi-dimensional images.
- Compute Unified Device Architecture (CUDA) is a software platform for massively parallel high-performance computing on NVIDIA GPUs. cudaBayesreg provides a CUDA implementation of a Bayesian multilevel model for the analysis of brain fMRI data. The CUDA programming model uses a separate thread for fitting a linear regression model at each voxel in parallel. The global statistical model implements a Gibbs Sampler for hierarchical linear models with a normal prior. This model has been proposed by Rossi, Allenby and McCulloch in Bayesian Statistics and Marketing, Chapter 3, and is referred to as "rhierLinearModel" in the R package bayesm.

*Structural MRI*

- The package dpmixsim implements a Dirichlet Process Mixture (DPM) model for clustering and image segmentation. The DPM model is a Bayesian nonparametric methodology that relies on MCMC simulations for exploring mixture models with an unknown number of components. The code implements conjugate models with normal structure (conjugate normal-normal DPM model). Applications are oriented towards the classification of MR images according to tissue type or region of interest.
- The package mritc provides tools for MRI tissue classification using normal mixture models and (partial volume, higher resolution) hidden Markov normal mixture models fitted by various methods. Functions to obtain initial values and spatial parameters are available. Facilities for visualization and evaluation of classification results are provided. To improve the speed, table lookup methods are used in various places, vectorization is used to take advantage of conditional independence, and some computations are performed by embedded C code.

*Visualization*

- The package brainR includes functions for creating three-dimensional (3D) and four-dimensional (4D) images using WebGL, RGL, and JavaScript commands. This package relies on the X ToolKit (XTK).
- Morpho is a collection of tools for statistical shape analysis and visualization of point based shape representations (landmarks, meshes). Apart from the core functions such as General Procrustes Analysis and sliding of semi-landmarks, Morpho is sporting a variety of statistical procedures to assess group differences and asymmetry, most of them based on permutation/bootstrapping methods. For registration purposes there are functions to calculate landmark transforms (rigid, similarity, affine and thin-plate spline) as well as iterative closest point registration and automated alignment exploiting the shapes' principal axes. To deal with missing/erroneous data there are imputation methods available for missing landmarks and interactive outlier detection. For visualization there are functions to create interactive 3D plots of distance maps as well as visualizing differences between point clouds by deforming rectangular grids, both in 2D and 3D. Additionally, it includes an algorithm to retrodeform surface meshes representing structures that have suffered a series of locally affine deformations (e.g. fossils).
- Rvcg interfaces VCGLIB to provide functions for manipulating triangular surface meshes; e.g., surfaces generated from medical image segmentations. Among those manipulations are quadric-edge collapse decimation, smoothing, subsampling, closest point search or uniform remeshing. Additionally it allows the generation of isosurfaces from 3D arrays. It has capabilities for import/export of STL, PLY and OBJ files, both in binary and ASCII format.

*Simulation*

- The package neuRosim allows users to generate fMRI time series or 4D data. Some high-level functions are created for fast data generation with only a few arguments and a diversity of functions to define activation and noise. For more advanced users it is possible to use the low-level functions and manipulate the arguments.

**General Image Processing**

- adimpro is a package for 2D digital (color and B/W) images, actually not specific to medical imaging, but for general image processing.
- The package bayesImageS implements several algorithms for segmentation of 2D and 3D images (such as CT and MRI). It provides full Bayesian inference for hidden Markov normal mixture models, including the posterior distribution for the smoothing parameter. The pixel labels can be sampled using checkerboard Gibbs or Swendsen-Wang. MCMC algorithms for the smoothing parameter include the approximate exchange algorithm (AEA), pseudolikelihood (PL), thermodynamic integration (TI), and approximate Bayesian computation (ABC-MCMC and ABC-SMC). An external field prior can be used when an anatomical atlas or other spatial information is available.
- EBImageis an R package which provides general purpose functionality for the reading, writing, processing and analysis of images. Furthermore, in the context of microscopy-based cellular assays, this package offers tools to transform the images, segment cells and extract quantitative cellular descriptors.
- The package mmand (Mathematical Morphology in Any Number of Dimensions) provides morphological operations like erode and dilate, opening and closing, as well as smoothing and kernel-based image processing. It operates on arrays or array-like data of arbitrary dimension.
- The RNiftyReg provides an interface to the NiftyReg image registration tools. Rigid-body, affine and non-linear registrations are available and may be applied in 2D-to-2D, 3D-to-2D and 4D-to-3D procedures.
- The package fslr contains wrapper functions that interface with the FMRIB Sofware Library (FSL), a powerful and widely-used neuroimaging software library, using system commands. The goal with this package is to interface with FSL completely in R, where you pass R-based NIfTI objects and the function executes an FSL command and returns an R-based NIfTI object.

**Positron Emission Tomography (PET)**

- The occ package provides a generic function for
estimating PET neuro-receptor occupancies by a drug, from the
total volumes of distribution of a set of regions of interest
(ROI). Fittings methods include the reference region, the
*ordinary least squares*(OLS, sometimes known as "occupancy plot") and the*restricted maximum likelihood estimation*(REML). - The PET package contains three of the major iterative reconstruction techniques (Algebraic Reconstruction Technique, Likelihood Reconstruction using Expectation Maximization and Least Squares Conjugate Method) and several direct reconstruction methods for radon transformed data. Furthermore, it offers the possibility to simulate a marked Poisson process with spatial varying intensity.

**Electroencephalography (EEG)**

- edfReader reads some of the most popular file formats in EEG recordings.
- The EEG package (currently only available within the
eeg project on R-Forge) reads in single trial
EEG (currently only ascii-exported pre-processed and trial
segmented in Brain Vision Analyzer), computes averages (i.e.,
event-related potentials or ERP's) and stores ERP's from
multiple data sets in a
`data.frame`like object, such that statistical analysis (linear model, (M)ANOVA) can be done using the familiar R modeling frame work. - eegkit includes many useful functions for analysing EEG signals (among others, visualizing positions of electrodes).
- PTAk is an R package that uses a multiway method to decompose a tensor (array) of any order, as a generalisation of a singular value decomposition (SVD) also supporting non-identity metrics and penalisations. A 2-way SVD with these extensions is also available. The package also includes additional multiway methods: PCAn (Tucker-n) and PARAFAC/CANDECOMP with these extensions. Applications include the analysis of EEG and functional MRI data.

9 days ago by Pierre Lafaye de Micheaux

Functions for Analysis of fMRI Datasets Stored in the ANALYZE or NIFTI Format

4 months ago by Matt Moores

Bayesian Methods for Image Segmentation using a Potts Model

7 months ago by John Muschelli

Helper Functions to 'misc3d' and 'rgl' Packages for Brain Imaging

5 years ago by Sophie Achard

Basic wavelet analysis of multivariate time series with a visualisation and parametrisation using graph theory.

3 years ago by Adelino Ferreira da Silva

CUDA Parallel Implementation of a Bayesian Multilevel Model for fMRI Data Analysis

5 years ago by Gregory Z. Ferl

Deconvolution Analysis Tool for Dynamic Contrast Enhanced MRI

3 years ago by Brandon Whitcher

A Package for Image Analysis of DCE-MRI (S4 Implementation)

6 years ago by Adelino Ferreira da Silva

Dirichlet Process Mixture model simulation for clustering and image segmentation

4 months ago by John Muschelli

Wrapper Functions for FSL ('FMRIB' Software Library) from Functional MRI of the Brain ('FMRIB')

3 years ago by Adelino Ferreira da Silva

Generalized Diffusion Magnetic Resonance Imaging

a month ago by Stefan Schlager

Calculations and Visualisations Related to Geometric Morphometrics

3 years ago by Marijke Welvaert

Functions to Generate fMRI Data Including Activated Data, Noise Data and Resting State Data

7 months ago by Brandon Whitcher

Rigorous - NIfTI + ANALYZE + AFNI : Input / Output

9 months ago by Stefan Schlager

Manipulations of Triangular Meshes Based on the 'VCGLIB' API

2 months ago by Jon Clayden

Read, Manipulate and Visualise Magnetic Resonance Images

3 years ago by Brandon Whitcher

Basic wavelet routines for one-, two- and three-dimensional signal processing