Skip to main content

Function: sampleAreaAnnotationVoxels()

sampleAreaAnnotationVoxels(__namedParameters): AreaAnnotationVoxel[]

Selects the voxels an area annotation covers, and feeds them to a statistics accumulator, per Rule M of https://github.com/cornerstonejs/cornerstone3D/issues/2889

Every area annotation tool shares this whole path. The plane, the thickness, the index bounds and the accumulation are identical for a polyline, a circle, an ellipse and a rectangle; only createShape differs:

// Planar freehand ROI
createShape: ({ volume, planePoint, viewPlaneNormal }) =>
createPolylineShape({ volume, planePoint, viewPlaneNormal, polyline }),

// Circle ROI
createShape: ({ volume, planePoint, viewPlaneNormal }) =>
createCircleShape({ volume, planePoint, viewPlaneNormal, centerWorld, radius }),

// Rectangle ROI
createShape: ({ volume, planePoint, viewPlaneNormal }) =>
createRectangleShape({ volume, planePoint, viewPlaneNormal, centerWorld,
majorAxis, majorHalfLength, minorHalfLength }),

Nothing here reads a viewport. The same annotation over the same volume therefore selects the same voxels at any zoom, any pan, any canvas size and any slab thickness, and at any orientation.

See docs/docs/concepts/cornerstone-tools/annotation/voxel-statistics.md.

Parameters

__namedParameters: AreaAnnotationVoxelsOptions

Returns

AreaAnnotationVoxel[]

the voxels when storePointData is set, otherwise an empty array. onSample runs either way.

Defined in

tools/src/utilities/sampleAreaAnnotationVoxels.ts:136