Class: ROIVec
Defined in: src/roi/ROI_improved.ts:315
ROIVec - Represents a volumetric ROI with associated vector data for each voxel.
Direct translation of Python's ROIVec class.
Extends
Extended by
Constructors
Constructor
new ROIVec(
data,
space,
coords): ROIVec;Defined in: src/roi/ROI_improved.ts:325
Creates an ROIVec instance.
Parameters
data
number[][] | Matrix
Matrix where each row corresponds to a voxel, columns represent vector components
space
NeuroSpace object defining the spatial reference
coords
number[][]
Matrix with 3 columns representing (i,j,k) coordinates
Returns
ROIVec
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: Matrix;Defined in: src/roi/ROI_improved.ts:316
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
ncol
Get Signature
get ncol(): number;Defined in: src/roi/ROI_improved.ts:345
Get the number of columns (vector dimension).
Returns
number
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
getSubset()
getSubset(indices): ROICoords;Defined in: src/roi/ROI_improved.ts:104
Extract subset of coordinates.
Parameters
indices
number | number[] | boolean[]
Returns
Inherited from
asSparse()
asSparse(fillValue?): SparseNeuroVol;Defined in: src/roi/ROI_improved.ts:148
Convert to SparseNeuroVol representation as a binary mask. All voxels in the ROI will have a value of 1, all others will be 0.
Parameters
fillValue?
number = 1
The value to assign to ROI voxels (default: 1)
Returns
A SparseNeuroVol with the ROI voxels set to fillValue
Inherited from
getVector()
getVector(index): number[];Defined in: src/roi/ROI_improved.ts:353
Retrieves the vector data at a specific voxel index.
Parameters
index
number
Index of the voxel in the ROI.
Returns
number[]
setVector()
setVector(index, vector): void;Defined in: src/roi/ROI_improved.ts:362
Sets the vector data at a specific voxel index.
Parameters
index
number
Index of the voxel in the ROI.
vector
number[]
Vector data to set.
Returns
void
getColumn()
getColumn(colIndex): number[];Defined in: src/roi/ROI_improved.ts:372
Get column of data (all values for a specific vector component).
Parameters
colIndex
number
Returns
number[]
setColumn()
setColumn(colIndex, values): void;Defined in: src/roi/ROI_improved.ts:379
Set column of data.
Parameters
colIndex
number
values
number[]
Returns
void
toString()
toString(): string;Defined in: src/roi/ROI_improved.ts:389
String representation.
Returns
string