Abstract Class: NeuroSlice
Defined in: src/volume/NeuroSlice.ts:12
Abstract base class for representing a 2D slice of neuroimaging data.
Constructors
Constructor
new NeuroSlice(space, data): NeuroSlice;Defined in: src/volume/NeuroSlice.ts:29
Constructs a NeuroSlice instance.
Parameters
space
The 2D geometric space of the slice data.
data
The raw 2D slice data.
Returns
NeuroSlice
Throws
If space.dim is not 2-dimensional or data.length does not match space.dim.
Accessors
dim
Get Signature
get dim(): number[];Defined in: src/volume/NeuroSlice.ts:47
Get the dimensions of the slice.
Returns
number[]
An array of two numbers representing the dimensions.
space
Get Signature
get space(): NeuroSpace;Defined in: src/volume/NeuroSlice.ts:55
Get the NeuroSpace object associated with this slice.
Returns
The NeuroSpace object representing the geometric space of the slice.
spacing
Get Signature
get spacing(): number[];Defined in: src/volume/NeuroSlice.ts:63
Get the spacing of the slice.
Returns
number[]
An array of two numbers representing the spacing.
origin
Get Signature
get origin(): number[];Defined in: src/volume/NeuroSlice.ts:71
Get the origin of the slice.
Returns
number[]
An array of two numbers representing the origin.
trans
Get Signature
get trans(): Matrix;Defined in: src/volume/NeuroSlice.ts:75
Returns
Matrix
inverseTrans
Get Signature
get inverseTrans(): Matrix;Defined in: src/volume/NeuroSlice.ts:79
Returns
Matrix
Methods
getAt()
getAt(i, j): number;Defined in: src/volume/NeuroSlice.ts:90
Get a pixel value at specified coordinates.
Parameters
i
number
x-coordinate
j
number
y-coordinate
Returns
number
The pixel value.
Throws
If coordinates are out of bounds.
setAt()
setAt(
i,
j,
value): void;Defined in: src/volume/NeuroSlice.ts:106
Set a pixel value at specified coordinates.
Parameters
i
number
x-coordinate
j
number
y-coordinate
value
number
The value to set.
Returns
void
Throws
If coordinates are out of bounds.
getRow()
getRow(j): TypedArray;Defined in: src/volume/NeuroSlice.ts:121
Get a row of the slice.
Parameters
j
number
y-coordinate of the row
Returns
The row data as the same TypedArray type.
Throws
If the row index is out of bounds.
getColumn()
getColumn(i): TypedArray;Defined in: src/volume/NeuroSlice.ts:135
Get a column of the slice.
Parameters
i
number
x-coordinate of the column
Returns
The column data as the same TypedArray type.
Throws
If the column index is out of bounds.
getData()
getData(): TypedArray;Defined in: src/volume/NeuroSlice.ts:160
Public getter for the underlying data array.
Returns
The TypedArray containing the slice data.