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 DICOMcompliant file is a collection of fields organized into
two fourbyte 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,
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
NIfTI1
and is a
product of the Data Format Working Group (DFWG) from the
Neuroimaging Informatics Technology Initiative (NIfTI). The
NIfTI1 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), reorganization of the 348byte
fixed header into more relevant categories and the possibility of
extending the header information.
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 slicebyslice 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 modelfree
methods (qspace 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 ContrastEnhanced MRI (DCEMRI)

The
DATforDCEMRI
package performs voxelwise
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 voxelwise data.

The
dcemriS4
package contains a collection of
functions to perform quantitative analysis from a DCEMRI (or
diffusionweighted MRI) acquisition on a voxelbyvoxel 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 DCEMRI are
as follows: motion correction and/or coregistration, T1
estimation, conversion of signal intensity to gadolinium
contrastagent concentration and kinetic parameter estimation.
Parametric estimation of the kinetic parameters, from a
singlecompartment (Kety or extended Kety) model, is performed
via LevenburgMarquardt optimization or Bayesian estimation.
Semiparametric estimation of the kinetic parameters is also
possible via Bayesian Psplines.

The
KATforDCEMRI
package contains functions for
fitting compartmental models to voxelwise contrast agent
concentration versus time data in order to estimate 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 voxelwise data
and pervoxel fitted model parameters.
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
smallworld 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

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,
crossplatform 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
nonadaptive smoothing methods, reducing the effective spatial
resolution. This property is especially of interest in the
analysis of highresolution 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 (nonGaussian Components Analysis)
based methods and hence has some overlap with
AnalyzeFMRI.

Neuroimage is an R package (currently only available within
the
neuroim
project on RForge) that provides
data structures and input/output routines for functional brain
imaging data. It reads and writes NIfTI1 data and provides S4
classes for handling multidimensional images.

Compute Unified Device Architecture (CUDA) is a software
platform for massively parallel highperformance 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
normalnormal 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
threedimensinoal (3D) and fourdimensional (4D) images using
WebGL, RGL, and JavaScript commands. This package relies on the X
ToolKit (
XTK
).
Simulation

The package
neuRosim
allows users to generate fMRI
time series or 4D data. Some highlevel 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 lowlevel 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.

EBImage
is an R package which provides general
purpose functionality for the reading, writing, processing and
analysis of images. Furthermore, in the context of
microscopybased 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
kernelbased image processing. It operates on arrays or
arraylike data of arbitrary dimension.

The
RNiftyReg
provides an interface to the
NiftyReg
image registration tools. Rigidbody, affine and nonlinear
registrations are available and may be applied in 2Dto2D,
3Dto2D and 4Dto3D procedures.

The package
fslr
contains wrapper functions that
interface with the
FMRIB Sofware
Library
(FSL), a powerful and widelyused neuroimaging
software library, using system commands. The goal with this
package is to interface with FSL completely in R, where you pass
Rbased NIfTI objects and the function executes an FSL command
and returns an Rbased NIfTI object.
Positron Emission Tomography (PET)

The
occ
package provides a generic function for
estimating PET neuroreceptor 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)

The EEG package (currently only available within the
eeg
project on RForge) reads in single trial
EEG (currently only asciiexported preprocessed and trial
segmented in Brain Vision Analyzer), computes averages (i.e.,
eventrelated 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.

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
nonidentity metrics and penalisations. A 2way SVD with these
extensions is also available. The package also includes
additional multiway methods: PCAn (Tuckern) and
PARAFAC/CANDECOMP with these extensions. Applications include
the analysis of EEG and functional MRI data.