Learn R Programming

RNifti (version 1.7.0)

channels: Extract channels from RGB data

Description

Extract one or more channels from an RGB data array that was obtained from an RGB NIfTI image or created by the rgbArray function. The result is more amenable to numeric manipulation.

Usage

channels(array, channels = c("red", "green", "blue", "alpha"), raw = FALSE)

Value

A raw-mode or integer-mode array with one more dimension than the first argument, corresponding to channels.

Arguments

array

An image, an rgbArray, or another array that can be converted to the latter.

channels

A character vector of channels to extract.

raw

Boolean value: if TRUE, return a raw array, which is the most compact representation; otherwise return an integer array.

Author

Jon Clayden <code@clayden.org>