Skip to content

Class: ROIVol ​

Defined in: src/roi/ROI_improved.ts:167

ROIVol - Class representing a volumetric region of interest (ROI) in a brain image, defined by a set of coordinates and associated data values.

Direct translation of Python's ROIVol class.

Extends ​

Extended by ​

Constructors ​

Constructor ​

ts
new ROIVol(
   data, 
   space, 
   coords): ROIVol;

Defined in: src/roi/ROI_improved.ts:178

Creates an ROIVol instance.

Parameters ​

data ​

TypedArray | number[]

Numeric vector of values corresponding to each coordinate

space ​

NeuroSpace

NeuroSpace object defining the spatial reference

coords ​

number[][]

Matrix with 3 columns representing (i,j,k) coordinates

Returns ​

ROIVol

Overrides ​

ROICoords.constructor

Properties ​

space ​

ts
readonly space: NeuroSpace;

Defined in: src/roi/ROI_improved.ts:15

Inherited from ​

ROICoords.space


coords ​

ts
readonly coords: number[][];

Defined in: src/roi/ROI_improved.ts:16

Inherited from ​

ROICoords.coords


data ​

ts
readonly data: TypedArray;

Defined in: src/roi/ROI_improved.ts:168

Accessors ​

length ​

Get Signature ​

ts
get length(): number;

Defined in: src/roi/ROI_improved.ts:62

Returns the number of voxels in the ROI.

Returns ​

number

Inherited from ​

ROICoords.length


dim ​

Get Signature ​

ts
get dim(): [number, number];

Defined in: src/roi/ROI_improved.ts:70

Get dimensions of the coordinate matrix. Returns [nrows, ncols] where ncols is always 3.

Returns ​

[number, number]

Inherited from ​

ROICoords.dim

Methods ​

indices() ​

ts
indices(): number[];

Defined in: src/roi/ROI_improved.ts:77

Returns the indices of the voxels in the ROI based on the space dimensions.

Returns ​

number[]

Inherited from ​

ROICoords.indices


realCoords() ​

ts
realCoords(): number[][];

Defined in: src/roi/ROI_improved.ts:84

Returns the real-world coordinates of the voxels in the ROI.

Returns ​

number[][]

Inherited from ​

ROICoords.realCoords


centroid() ​

ts
centroid(): number[];

Defined in: src/roi/ROI_improved.ts:91

Computes the centroid of the ROI in real-world coordinates.

Returns ​

number[]

Inherited from ​

ROICoords.centroid


get() ​

ts
get(index): number;

Defined in: src/roi/ROI_improved.ts:204

Retrieves the data value at a specific relative voxel index.

Parameters ​

index ​

number

Index of the voxel in the ROI.

Returns ​

number


getAt() ​

ts
getAt(
   i, 
   j, 
   k): number;

Defined in: src/roi/ROI_improved.ts:212

Get value at specific coordinates. Returns 0 if coordinates are not in the ROI.

Parameters ​

i ​

number

j ​

number

k ​

number

Returns ​

number


asSparse() ​

ts
asSparse(): SparseNeuroVol;

Defined in: src/roi/ROI_improved.ts:225

Convert to SparseNeuroVol representation.

Returns ​

SparseNeuroVol

Overrides ​

ROICoords.asSparse


getSubset() ​

ts
getSubset(indices): ROIVol;

Defined in: src/roi/ROI_improved.ts:239

Extract subset based on indices.

Parameters ​

indices ​

number | number[] | boolean[]

Returns ​

ROIVol

Overrides ​

ROICoords.getSubset


toString() ​

ts
toString(): string;

Defined in: src/roi/ROI_improved.ts:271

String representation.

Returns ​

string

Overrides ​

ROICoords.toString

Released under the MIT License.