Skip to content

Function: squareROI() ​

ts
function squareROI(
   vol, 
   centroid, 
   surround, 
   fixDim?, 
   fill?, 
   nonzero?): ROIVolWindow;

Defined in: src/roi/ROI_factories.ts:199

Creates a square ROI with a fixed dimension (e.g., z-dimension). This creates a 2D square in the plane perpendicular to the fixed dimension.

Parameters ​

vol ​

NeuroVol

The NeuroVol representing the volume

centroid ​

number[]

The center voxel coordinates [i, j, k]

surround ​

number

Number of voxels around the center voxel

fixDim? ​

number = 2

The dimension to fix (0 for x, 1 for y, 2 for z)

fill? ​

number = 1

Optional value to assign to the data slot. Defaults to 1

nonzero? ​

boolean = false

If true, only include voxels with non-zero values

Returns ​

ROIVolWindow

An ROIVolWindow representing the square ROI

Released under the MIT License.