ROIVol: Create an instance of class 'ROIVol'

View source: R/roi.R

ROIVolR Documentation

Create an instance of class ROIVol

Description

This function constructs an instance of the ROIVol class, which represents a region of interest (ROI) in a 3D volume. The class stores the NeuroSpace object, voxel coordinates, and data values for the ROI.

Usage

ROIVol(vspace, coords, data = rep(1, nrow(coords)))

Arguments

vspace

An instance of class NeuroSpace with three dimensions, which represents the dimensions and voxel spacing of the 3D volume.

coords

A 3-column matrix of voxel coordinates for the region of interest.

data

The data values associated with the region of interest, provided as a numeric vector. By default, it is a vector of ones with a length equal to the number of rows in the 'coords' matrix.

Value

An instance of class ROIVol, containing the NeuroSpace object, voxel coordinates, and data values for the region of interest.

Examples

# Create a NeuroSpace object
vspace <- NeuroSpace(dim = c(5, 5, 5), spacing = c(1, 1, 1))

# Define voxel coordinates for the ROI
coords <- matrix(c(1, 2, 3, 2, 2, 2, 3, 3, 3), ncol = 3)

# Create a ROIVol object
roi_vol <- ROIVol(vspace, coords)

bbuchsbaum/neuroim2 documentation built on March 29, 2024, 6:36 p.m.