Function: getViewSlabDepth()
getViewSlabDepth(
depth):number|undefined
Resolves a slab depth in mm, and reports "no slab" as undefined.
The caller supplies a full depth, and the two render paths reach that depth differently:
- A volume viewport stores a half thickness, because
setOrientationOfClippingPlanesputs the two clipping planes atfocalPoint ± slabThickness. Such a caller passesgetSlabThickness() * 2. - A generic planar viewport uses
vtkImageResliceMapper, where the field is already a full thickness. Such a caller passes the value as it is.
A depth at or below twice RENDERING_DEFAULTS.MINIMUM_SLAB_THICKNESS means
"no slab was requested", and not "a slab of 0.1 mm was requested". A literal
0.1 mm is thinner than any real voxel, so undefined lets the caller fall back
to one voxel along the normal.
See docs/docs/concepts/cornerstone-tools/annotation/voxel-statistics.md.
Parameters
• depth: number
The full depth the viewport shows, in mm.
Returns
number | undefined
The depth, or undefined when the viewport shows no slab of its own.