Interface: INeuroHyperVec
Defined in: src/hypervec/INeuroHyperVec.ts:113
Interface for high-dimensional neuroimaging data
Properties
spatialDim
spatialDim: [number, number, number];Defined in: src/hypervec/INeuroHyperVec.ts:117
Spatial dimensions [x, y, z]
space
space: NeuroSpace;Defined in: src/hypervec/INeuroHyperVec.ts:122
Spatial coordinate system
dimensions
dimensions: DimensionInfo[];Defined in: src/hypervec/INeuroHyperVec.ts:127
Information about non-spatial dimensions
ndim
ndim: number;Defined in: src/hypervec/INeuroHyperVec.ts:132
Total number of dimensions (spatial + non-spatial)
shape
shape: number[];Defined in: src/hypervec/INeuroHyperVec.ts:137
Shape of the full array
size
size: number;Defined in: src/hypervec/INeuroHyperVec.ts:142
Total number of elements
Methods
getSubVolume()
getSubVolume(indices): NeuroVol | NeuroVec;Defined in: src/hypervec/INeuroHyperVec.ts:148
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
getVoxelSeries()
getVoxelSeries(
x,
y,
z,
dims?): number[];Defined in: src/hypervec/INeuroHyperVec.ts:157
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[]
setSubVolume()
setSubVolume(indices, data): void;Defined in: src/hypervec/INeuroHyperVec.ts:164
Set data for a sub-volume
Parameters
indices
Record<string, number | number[]>
Indices for non-spatial dimensions
data
Data to set
Returns
void
reduce()
reduce(dims, options): INeuroHyperVec;Defined in: src/hypervec/INeuroHyperVec.ts:171
Reduce along specified dimensions
Parameters
dims
string[]
Dimension names to reduce
options
Reduction options
Returns
INeuroHyperVec
mapAlong()
mapAlong(dims, fn): INeuroHyperVec;Defined in: src/hypervec/INeuroHyperVec.ts:178
Apply function along specified dimensions
Parameters
dims
string[]
Dimensions to map over
fn
(data) => NeuroVol
Function to apply
Returns
INeuroHyperVec
concat()
concat(other, dim): INeuroHyperVec;Defined in: src/hypervec/INeuroHyperVec.ts:185
Concatenate with another hypervec along a dimension
Parameters
other
INeuroHyperVec
Other hypervec
dim
string
Dimension name
Returns
INeuroHyperVec
split()
split(dim, indices): INeuroHyperVec[];Defined in: src/hypervec/INeuroHyperVec.ts:192
Split along a dimension
Parameters
dim
string
Dimension to split
indices
number[]
Indices where to split
Returns
INeuroHyperVec[]
permute()
permute(order): INeuroHyperVec;Defined in: src/hypervec/INeuroHyperVec.ts:198
Permute dimensions
Parameters
order
string[]
New dimension order by name
Returns
INeuroHyperVec
extractFeatures()
extractFeatures(options): object;Defined in: src/hypervec/INeuroHyperVec.ts:204
Extract features using dimensionality reduction
Parameters
options
Feature extraction options
Returns
object
components
components: INeuroHyperVec;loadings
loadings: number[][];explainedVariance?
optional explainedVariance?: number[];correlateAlong()
correlateAlong(dim1, dim2): number[][];Defined in: src/hypervec/INeuroHyperVec.ts:215
Compute correlation between different conditions/subjects
Parameters
dim1
string
First dimension name
dim2
string
Second dimension name
Returns
number[][]
glm()
glm(designMatrix, contrastMatrix): object;Defined in: src/hypervec/INeuroHyperVec.ts:222
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;toArray()
toArray(): Float32Array;Defined in: src/hypervec/INeuroHyperVec.ts:231
Convert to dense array (use with caution for large data)
Returns
Float32Array
save()
save(filename, format?): Promise<void>;Defined in: src/hypervec/INeuroHyperVec.ts:238
Save to file
Parameters
filename
string
Output filename
format?
string
Format (hdf5, nifti-5d, custom)
Returns
Promise<void>
view()
view(spec): INeuroHyperVec;Defined in: src/hypervec/INeuroHyperVec.ts:244
Create a view with reordered/subsetted dimensions
Parameters
spec
Record<string, number | number[] | "all">
Specification for the view
Returns
INeuroHyperVec
clone()
clone(): INeuroHyperVec;Defined in: src/hypervec/INeuroHyperVec.ts:249
Clone the hypervec
Returns
INeuroHyperVec
dispose()
dispose(): void;Defined in: src/hypervec/INeuroHyperVec.ts:254
Dispose of resources
Returns
void