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
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 object defining the spatial reference
coords
number[][]
Matrix with 3 columns representing (i,j,k) coordinates
Returns
ROIVol
Overrides
Properties
space
readonly space: NeuroSpace;Defined in: src/roi/ROI_improved.ts:15
Inherited from
coords
readonly coords: number[][];Defined in: src/roi/ROI_improved.ts:16
Inherited from
data
readonly data: TypedArray;Defined in: src/roi/ROI_improved.ts:168
Accessors
length
Get Signature
get length(): number;Defined in: src/roi/ROI_improved.ts:62
Returns the number of voxels in the ROI.
Returns
number
Inherited from
dim
Get Signature
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
Methods
indices()
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
realCoords()
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
centroid()
centroid(): number[];Defined in: src/roi/ROI_improved.ts:91
Computes the centroid of the ROI in real-world coordinates.
Returns
number[]
Inherited from
get()
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()
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()
asSparse(): SparseNeuroVol;Defined in: src/roi/ROI_improved.ts:225
Convert to SparseNeuroVol representation.
Returns
Overrides
getSubset()
getSubset(indices): ROIVol;Defined in: src/roi/ROI_improved.ts:239
Extract subset based on indices.
Parameters
indices
number | number[] | boolean[]
Returns
ROIVol
Overrides
toString()
toString(): string;Defined in: src/roi/ROI_improved.ts:271
String representation.
Returns
string