as.array-methods: Convert ClusteredNeuroVol to a base array

as.array,ClusteredNeuroVol-methodR Documentation

Convert ClusteredNeuroVol to a base array

Description

Ensures that clustered volumes dispatch through the 'as.array' S4 generic and return dense arrays of cluster labels aligned to the underlying space.

Provides an 'as.array' S4 method so sparse volumes can be coerced with the same syntax used for dense objects.

Usage

## S4 method for signature 'ClusteredNeuroVol'
as.array(x, ...)

## S4 method for signature 'SparseNeuroVol'
as.array(x, ...)

## S4 method for signature 'SparseNeuroVec'
as.array(x, ...)

Arguments

x

A SparseNeuroVec object.

...

Additional arguments (currently ignored).

Value

A dense array of cluster ids.

A dense array with voxel values at their spatial locations and zeros elsewhere.

A dense 4D array with sparse values inserted at mask indices and zeros elsewhere.


neuroim2 documentation built on April 16, 2026, 5:07 p.m.