LogicalNeuroVol-class: LogicalNeuroVol

LogicalNeuroVol-classR Documentation

LogicalNeuroVol

Description

This S4 class represents a three-dimensional brain image, where all values are either TRUE or FALSE. It is particularly useful for creating and managing binary masks for brain images.

This function constructs a LogicalNeuroVol instance.

Usage

LogicalNeuroVol(data, space, label = "", indices = NULL)

Arguments

data

A three-dimensional array, a 1D vector with length equal to prod(dim(space)), or a set of indices where elements are TRUE.

space

An instance of class NeuroSpace.

label

A character string.

indices

An optional 1-d index vector.

Value

A LogicalNeuroVol instance.

Examples

# Load an example brain mask
brain_mask <- read_vol(system.file("extdata", "global_mask.nii", package="neuroim2"))

# Convert the brain mask to a LogicalNeuroVol
logical_vol <- LogicalNeuroVol(brain_mask, space(brain_mask))


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