A poster presented at SMBE 2003 conference which describes the package can be downloaded here.

The package is available from CRAN

AnalyzeFMRI is an R package that
provides I/O, visualisation and
analysis of functional Magnetic Resonance Imaging (fMRI) datasets
stored in the ANALYZE image format. The package supercedes the packages
AnalyzeIO and AnalyzeRead (described below).

- Datasets can be read into R in several different ways i.e. one slice, one time series, whole dataset etc and displayed quickly and simply using a tcl/tk GUI (Graphical User Interface). Screenshots.
- Arrays from within an R session can also be written out into the ANALYZE image format.
- A simple spectral summary of the dataset can be quickly calculated.
- Spatial ICA (Independent Component Analysis) can be applied to the dataset. This provides a decomposition of an fMRI dataset into spatially independent components, if they exist. If not the algorithm returns the Projection Pursuit directions i.e interesting projections of the multivariate dataset. In this way the Spatial ICA algorithm provides an extremely useful way of exploring large fMRI datasets.This is applied to the dataset using C code written for the fastICA package (see above). There is a tcl/tk GUI that allows Spatial ICA to be applied quickly and simply. The output can be saved to a series of jpeg files for compact storage of the decomposition. Screenshots
- Functions for linear and non-linear smoothing of an array.
- Functions to fit a mixture model (1 Normal and 2 Gamma components) to an fMRI t-statistic image. Includes, an implementation of the spatial mixture modelling approach of Hartvig and Jensen (2000)
- Functions that simulate Gaussian and Gamma random fields and estimate the smoothness of a given field.
- Functions for calculating Bonferroni, False Discovery Rate and Random Field Theory thresholds for fMRI statistic maps.

More functionality will be slowly added.

An S-PLUS version will appear when i get some more time (although i'm more likely to do it soon if someone wants to use it!)

Please let me know if you use this package and have suggestions for functionality that you would find useful.

The package is available from CRAN

You can download an example datasaet from
fmri.null.dataset.tar.gz

The gzipped tar archive contains 4 files described below

[1] jm2.null.mc.img - null fMRI dataset with
dimensions 64x64x21x190

[2] jm2.null.mc.hdr - header file for [1]

[3] jm2.null.mc.mask.img - mask for [1] which is 1
for voxels inside the brain and 0 outside.

[4] jm2.null.mc.mask.hdr - header file
for [3]

The method relies upon the fact that mixtures of independent variables tend to become more gaussian in distribution when they are mixed linearly (by the Central Limit Theorem). Thus in order to recover the independent sources we should maximise some measure of non-gaussianity. The FastICA algorithm (as its name suggests) is designed to provide a computationally quick method of estimating the unobserved independent components. The algorithm iteratively maximises an approximation to the negentropy of the projected data. Negentropy is based on the information-theoretic quantity of (differential) entropy which measures the "randomness" of an observed variable. Since gaussian variables have the largest entropy among all random variables of equal variance entropy can be used to define a measure of non-gaussianity i.e. negentropy. In practice this quantity can be time consuming to calculate. This led to the development of the fast and robust approximations implemented in the FastICA algorithm. The algorithm has been implemented by the original authors in MATLAB .

In the absence of a generative model for the data the algorithm can be used to find Projection Pursuit directions. Projection Pursuit is a technique for finding 'interesting' directions/projections in multi-dimensional datasets. These projectoins and are useful for visualising the dataset and in density estimation and regression. Interesting directions are those which show the least Gaussian distribution, which is what the FastICA algorithm does.

The fastICA package contains both R/Splus and C code to implement the FastICA algorithm. The R/Splus code is included for clarity whereas the C code allows the method to be run much faster. When the package is compiled the code is linked to optimized BLAS routines if they are present on your machine. If not then unoptimized BLAS routines are compiled separately, which makes the code faster than the R code but not as fast as it could be. Most of the C code included in the package was written by Chris Heaton who is a summer research student at the Department of Statistics, University of Oxford (see this report ).

The R package is available from CRAN

The Splus library source code is available from the following link fastICA_S_1.0-2.tar.gz (see Installation instructions )

A pre-compiled binary for Splus 6.0 for Windows has been made available by Professor B D Ripley at http://www.stats.ox.ac.uk/pub/MASS3/Winlibs/fastICA.zip

A standalone C version of the code is also available fastiCa.tgz The code is essentially the same as that used in the R and Splus packages described above but uses the ranlib RNG library. Please read the README file included in the directory for instructions on compilation. I have successfully compiled this code on my Linux machine but thats about it so far. The code is distributed under the GPL license (for details see the file COPYING). An static executable of this code is available at fastiCa

Spencer, C., Su, Z., Donnelly, P. and Marchini, J. (2008) Designing Genome-Wide Association Studies: sample size, power, and the choice of genotyping chip. submitted.

Download : GWApower_1.1.tar.gz

Currently includes

- Bootstap test for multimodality of a sample of data
- MCMC methods for simulating from a 2D Ising model
- Demonstration of the Central Limit Theorem.
- HTH vs HTT coin tosing simulation
- Demonstrate the Law of Large Numbers.
- Simulation of a simple 2 state Markov chain.
- Simulation of a 1D random walk