SparseNeuroVol

SparseNeuroVol(data, space, indices=None, label='', mask=None)

Sparse 3D neuroimaging volume. Uses scipy.sparse for efficient storage.

Parameters

Name Type Description Default
data array - like Non-zero values required
space NeuroSpace Spatial metadata required
indices array - like Linear indices of non-zero values None
label str Volume label ''

Attributes

Name Description
data Get non-zero values.
indices Get indices of non-zero values.
nnz Number of non-zero elements.

Methods

Name Description
as_array Convert to numpy array.
as_dense Convert to dense representation.
as_logical Convert to logical representation.
as_numeric Get non-zero values only.
as_sparse Already sparse, optionally apply new mask.
values Get all values (including zeros).

as_array

SparseNeuroVol.as_array()

Convert to numpy array.

as_dense

SparseNeuroVol.as_dense()

Convert to dense representation.

as_logical

SparseNeuroVol.as_logical()

Convert to logical representation.

as_numeric

SparseNeuroVol.as_numeric()

Get non-zero values only.

as_sparse

SparseNeuroVol.as_sparse(mask=None)

Already sparse, optionally apply new mask.

values

SparseNeuroVol.values()

Get all values (including zeros).

Back to top