getColourScale {tractor.base}R Documentation

Obtaining colour scales

Description

The getColourScale function can be used to obtain a standard or customised colour scale for use in the package's image visualisation functions.

Usage

getColourScale(n)

Arguments

n

A number, colour name or list (see Details).

Details

Colour scales can be specified in any of three ways. Firstly, by a single number, representing a predefined colour scale. Currently valid values are 1 (greyscale, black background), 2 (red to yellow heat scale, red background), 3 (blue to red rainbow scale, blue background), 4 (blue to white to red diverging scale, white background), 5 (white to red, white background), 6 (white to blue, white background), 7 (yellow to orange to red) and 8 (purple to green to yellow, perceptually uniform). Secondly, a single colour name can be given (see colours); in this case the background will be black. This is useful for binary images. Thirdly, and most flexibly, a list with two named elements can be given: colours, a vector of colours representing the colour scale, perhaps created using using the shades package; and background, a single colour representing the background.

Value

A list with elements

colours

A character-mode vector representing the colours in the scale, usually of length 100. This can be passed as a colour scale to R's plotting functions.

background

A single character string representing the background colour.

Author(s)

Jon Clayden

References

Please cite the following reference when using TractoR in your work:

J.D. Clayden, S. Muñoz Maniega, A.J. Storkey, M.D. King, M.E. Bastin & C.A. Clark (2011). TractoR: Magnetic resonance imaging and tractography with R. Journal of Statistical Software 44(8):1-18. doi:10.18637/jss.v044.i08.

See Also

colours, rgb, colorRamp, and the shades package for colour manipulation.

Examples

getColourScale(1)


[Package tractor.base version 3.4.2 Index]