Skip to content

Class: DenseNeuroHyperVec

Defined in: src/hypervec/NeuroHyperVec.ts:22

Dense implementation of NeuroHyperVec

Implements

Constructors

Constructor

ts
new DenseNeuroHyperVec(
   space, 
   dimensions, 
   data?): DenseNeuroHyperVec;

Defined in: src/hypervec/NeuroHyperVec.ts:30

Parameters

space

NeuroSpace

dimensions

DimensionInfo[]

data?

Float32Array<ArrayBufferLike>

Returns

DenseNeuroHyperVec

Properties

spatialDim

ts
spatialDim: [number, number, number];

Defined in: src/hypervec/NeuroHyperVec.ts:23

Spatial dimensions [x, y, z]

Implementation of

INeuroHyperVec.spatialDim


space

ts
space: NeuroSpace;

Defined in: src/hypervec/NeuroHyperVec.ts:24

Spatial coordinate system

Implementation of

INeuroHyperVec.space


dimensions

ts
dimensions: DimensionInfo[];

Defined in: src/hypervec/NeuroHyperVec.ts:25

Information about non-spatial dimensions

Implementation of

INeuroHyperVec.dimensions

Accessors

ndim

Get Signature

ts
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

INeuroHyperVec.ndim


shape

Get Signature

ts
get shape(): number[];

Defined in: src/hypervec/NeuroHyperVec.ts:64

Shape of the full array

Returns

number[]

Shape of the full array

Implementation of

INeuroHyperVec.shape


size

Get Signature

ts
get size(): number;

Defined in: src/hypervec/NeuroHyperVec.ts:68

Total number of elements

Returns

number

Total number of elements

Implementation of

INeuroHyperVec.size

Methods

getSubVolume()

ts
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

| NeuroVol | NeuroVec

Implementation of

INeuroHyperVec.getSubVolume


getVoxelSeries()

ts
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

INeuroHyperVec.getVoxelSeries


setSubVolume()

ts
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

| NeuroVol | NeuroVec

Data to set

Returns

void

Implementation of

INeuroHyperVec.setSubVolume


reduce()

ts
reduce(dims, options): INeuroHyperVec;

Defined in: src/hypervec/NeuroHyperVec.ts:318

Reduce along specified dimensions

Parameters

dims

string[]

Dimension names to reduce

options

ReductionOptions

Reduction options

Returns

INeuroHyperVec

Implementation of

INeuroHyperVec.reduce


mapAlong()

ts
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

INeuroHyperVec

Implementation of

INeuroHyperVec.mapAlong


concat()

ts
concat(other, dim): INeuroHyperVec;

Defined in: src/hypervec/NeuroHyperVec.ts:455

Concatenate with another hypervec along a dimension

Parameters

other

INeuroHyperVec

Other hypervec

dim

string

Dimension name

Returns

INeuroHyperVec

Implementation of

INeuroHyperVec.concat


split()

ts
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

INeuroHyperVec[]

Implementation of

INeuroHyperVec.split


permute()

ts
permute(order): INeuroHyperVec;

Defined in: src/hypervec/NeuroHyperVec.ts:608

Permute dimensions

Parameters

order

string[]

New dimension order by name

Returns

INeuroHyperVec

Implementation of

INeuroHyperVec.permute


extractFeatures()

ts
extractFeatures(options): object;

Defined in: src/hypervec/NeuroHyperVec.ts:641

Extract features using dimensionality reduction

Parameters

options

FeatureExtractionOptions

Feature extraction options

Returns

object

components
ts
components: INeuroHyperVec;
loadings
ts
loadings: number[][];
explainedVariance?
ts
optional explainedVariance?: number[];

Implementation of

INeuroHyperVec.extractFeatures


correlateAlong()

ts
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

INeuroHyperVec.correlateAlong


glm()

ts
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
ts
beta: INeuroHyperVec;
tstat
ts
tstat: NeuroVol;
pval
ts
pval: NeuroVol;

Implementation of

INeuroHyperVec.glm


toArray()

ts
toArray(): Float32Array;

Defined in: src/hypervec/NeuroHyperVec.ts:712

Convert to dense array (use with caution for large data)

Returns

Float32Array

Implementation of

INeuroHyperVec.toArray


save()

ts
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

INeuroHyperVec.save


view()

ts
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

INeuroHyperVec

Implementation of

INeuroHyperVec.view


clone()

ts
clone(): INeuroHyperVec;

Defined in: src/hypervec/NeuroHyperVec.ts:760

Clone the hypervec

Returns

INeuroHyperVec

Implementation of

INeuroHyperVec.clone


dispose()

ts
dispose(): void;

Defined in: src/hypervec/NeuroHyperVec.ts:768

Dispose of resources

Returns

void

Implementation of

INeuroHyperVec.dispose

Released under the MIT License.