NeuroVec-class: NeuroVec

NeuroVec-classR Documentation

NeuroVec

Description

This S4 class represents a four-dimensional brain image, which can be used to store and process time series data such as fMRI or 4D functional connectivity maps. The class extends the basic functionality of NeuroObj.

Constructor function for the NeuroVec class. This function is used to create an instance of a NeuroVec object, which represents a four-dimensional brain image.

Usage

NeuroVec(data, space = NULL, mask = NULL, label = "")

Arguments

data

The image data, which can be a matrix, a 4D array, or a list of NeuroVol objects. If the latter, the geometric space of the data (NeuroSpace) will be inferred from the constituent volumes, which must all be identical.

space

An optional NeuroSpace object. Does not need to be included if the data argument is a list of NeuroVol objects.

mask

An optional array of type logical.

label

A label of type character.

Value

A concrete instance of the NeuroVec class. If a mask is provided, the function returns a SparseNeuroVec object; otherwise, it returns a DenseNeuroVec object.

Usage

To create a NeuroVec object, use the constructor function NeuroVec().

Examples

# Load an example 4D brain image
example_4d_image <- read_vec(system.file("extdata", "global_mask_v4.nii", package="neuroim2"))

# Create a NeuroVec object by copying the @.Data field (not advised in practice)
neuro_vec <- NeuroVec(data=example_4d_image@.Data, space=space(example_4d_image))

# Load an example 4D brain image
example_4d_image <- read_vec(system.file("extdata", "global_mask_v4.nii", package="neuroim2"))

# Create a NeuroVec object
neuro_vec <- NeuroVec(data=example_4d_image@.Data, space=space(example_4d_image))


bbuchsbaum/neuroim2 documentation built on April 20, 2024, 4:20 p.m.