Class: DenseNeuroHyperVec
Defined in: src/hypervec/NeuroHyperVec.ts:22
Dense implementation of NeuroHyperVec
Implements
Constructors
Constructor
new DenseNeuroHyperVec(
space,
dimensions,
data?): DenseNeuroHyperVec;Defined in: src/hypervec/NeuroHyperVec.ts:30
Parameters
space
dimensions
data?
Float32Array<ArrayBufferLike>
Returns
DenseNeuroHyperVec
Properties
spatialDim
spatialDim: [number, number, number];Defined in: src/hypervec/NeuroHyperVec.ts:23
Spatial dimensions [x, y, z]
Implementation of
space
space: NeuroSpace;Defined in: src/hypervec/NeuroHyperVec.ts:24
Spatial coordinate system
Implementation of
dimensions
dimensions: DimensionInfo[];Defined in: src/hypervec/NeuroHyperVec.ts:25
Information about non-spatial dimensions
Implementation of
Accessors
ndim
Get Signature
get ndim(): number;Defined in: src/hypervec/NeuroHyperVec.ts:60
Total number of dimensions (spatial + non-spatial)
Returns
number
Total number of dimensions (spatial + non-spatial)
Implementation of
shape
Get Signature
get shape(): number[];Defined in: src/hypervec/NeuroHyperVec.ts:64
Shape of the full array
Returns
number[]
Shape of the full array
Implementation of
size
Get Signature
get size(): number;Defined in: src/hypervec/NeuroHyperVec.ts:68
Total number of elements
Returns
number
Total number of elements
Implementation of
Methods
getSubVolume()
getSubVolume(indices):
| NeuroVol
| NeuroVec;Defined in: src/hypervec/NeuroHyperVec.ts:128
Get a sub-volume by specifying indices for non-spatial dimensions
Parameters
indices
Record<string, number | number[]>
Map of dimension name to index or slice
Returns
Implementation of
getVoxelSeries()
getVoxelSeries(
x,
y,
z,
dims?): number[];Defined in: src/hypervec/NeuroHyperVec.ts:224
Get a time series for a specific voxel across specified dimensions
Parameters
x
number
X coordinate
y
number
Y coordinate
z
number
Z coordinate
dims?
string[]
Dimensions to extract (default: all non-spatial)
Returns
number[]
Implementation of
setSubVolume()
setSubVolume(indices, data): void;Defined in: src/hypervec/NeuroHyperVec.ts:257
Set data for a sub-volume
Parameters
indices
Record<string, number | number[]>
Indices for non-spatial dimensions
data
Data to set
Returns
void
Implementation of
reduce()
reduce(dims, options): INeuroHyperVec;Defined in: src/hypervec/NeuroHyperVec.ts:318
Reduce along specified dimensions
Parameters
dims
string[]
Dimension names to reduce
options
Reduction options
Returns
Implementation of
mapAlong()
mapAlong(dims, fn): INeuroHyperVec;Defined in: src/hypervec/NeuroHyperVec.ts:428
Apply function along specified dimensions
Parameters
dims
string[]
Dimensions to map over
fn
(data) => NeuroVol
Function to apply
Returns
Implementation of
concat()
concat(other, dim): INeuroHyperVec;Defined in: src/hypervec/NeuroHyperVec.ts:455
Concatenate with another hypervec along a dimension
Parameters
other
Other hypervec
dim
string
Dimension name
Returns
Implementation of
split()
split(dim, indices): INeuroHyperVec[];Defined in: src/hypervec/NeuroHyperVec.ts:541
Split along a dimension
Parameters
dim
string
Dimension to split
indices
number[]
Indices where to split
Returns
Implementation of
permute()
permute(order): INeuroHyperVec;Defined in: src/hypervec/NeuroHyperVec.ts:608
Permute dimensions
Parameters
order
string[]
New dimension order by name
Returns
Implementation of
extractFeatures()
extractFeatures(options): object;Defined in: src/hypervec/NeuroHyperVec.ts:641
Extract features using dimensionality reduction
Parameters
options
Feature extraction options
Returns
object
components
components: INeuroHyperVec;loadings
loadings: number[][];explainedVariance?
optional explainedVariance?: number[];Implementation of
INeuroHyperVec.extractFeatures
correlateAlong()
correlateAlong(dim1, dim2): number[][];Defined in: src/hypervec/NeuroHyperVec.ts:651
Compute correlation between different conditions/subjects
Parameters
dim1
string
First dimension name
dim2
string
Second dimension name
Returns
number[][]
Implementation of
glm()
glm(designMatrix, contrastMatrix): object;Defined in: src/hypervec/NeuroHyperVec.ts:703
Apply GLM across time or conditions
Parameters
designMatrix
number[][]
Design matrix
contrastMatrix
number[][]
Contrast matrix
Returns
object
beta
beta: INeuroHyperVec;tstat
tstat: NeuroVol;pval
pval: NeuroVol;Implementation of
toArray()
toArray(): Float32Array;Defined in: src/hypervec/NeuroHyperVec.ts:712
Convert to dense array (use with caution for large data)
Returns
Float32Array
Implementation of
save()
save(filename, format?): Promise<void>;Defined in: src/hypervec/NeuroHyperVec.ts:716
Save to file
Parameters
filename
string
Output filename
format?
string
Format (hdf5, nifti-5d, custom)
Returns
Promise<void>
Implementation of
view()
view(spec): INeuroHyperVec;Defined in: src/hypervec/NeuroHyperVec.ts:721
Create a view with reordered/subsetted dimensions
Parameters
spec
Record<string, number | number[] | "all">
Specification for the view
Returns
Implementation of
clone()
clone(): INeuroHyperVec;Defined in: src/hypervec/NeuroHyperVec.ts:760
Clone the hypervec
Returns
Implementation of
dispose()
dispose(): void;Defined in: src/hypervec/NeuroHyperVec.ts:768
Dispose of resources
Returns
void