Convert ClusteredNeuroVol to DenseNeuroVol
Source:R/clustervol.R
as-ClusteredNeuroVol-DenseNeuroVol.RdThis method converts a ClusteredNeuroVol into an equivalent DenseNeuroVol object.
Usage
# S4 method for class 'ClusteredNeuroVol,DenseNeuroVol'
coerce(from, to = "DenseNeuroVol", strict = TRUE)Arguments
- from
A
ClusteredNeuroVolobject to be converted- to
The target class,
"DenseNeuroVol".- strict
Logical; whether to enforce the target class exactly.
Value
A DenseNeuroVol object
Examples
# Create a clustered volume
mask <- read_vol(system.file("extdata", "global_mask_v4.nii", package="neuroim2"))
clusters <- rep(1:5, length.out=sum(mask))
cvol <- ClusteredNeuroVol(mask, clusters)
# Convert to DenseNeuroVol
dvol <- as(cvol, "DenseNeuroVol")