Skip to main content

Variable: helpers

const helpers: object

Type declaration

clearSegmentValue()

clearSegmentValue: (segmentationId, segmentIndex) => void

Clears the specified segment value from a segmentation.

Parameters

segmentationId: string

The unique identifier of the segmentation.

segmentIndex: number

The index of the segment to be cleared.

Returns

void

Throws

If the segmentation type is not supported (currently only labelmap is supported).

Remarks

This function iterates through all voxels in the segmentation and sets the value to 0 for any voxel that matches the specified segment index. It supports both stack and volume segmentations.

computeVolumeLabelmapFromStack()

computeVolumeLabelmapFromStack: (args) => Promise<object>

Computes a volume segmentation from a stack of image IDs.

Parameters

args: any

Returns

Promise<object>

A promise that resolves to an object containing the volumeId of the created volume.

volumeId

volumeId: string

Async

convertStackToVolumeLabelmap()

convertStackToVolumeLabelmap: (args) => Promise<void>

Converts a stack-based segmentation to a volume-based segmentation.

Parameters

args: any

Returns

Promise<void>

A promise that resolves when the conversion is complete.

convertVolumeToStackLabelmap()

convertVolumeToStackLabelmap: (__namedParameters) => Promise<void>

Parameters

__namedParameters

__namedParameters.options?

__namedParameters.options.newSegmentationId?: string

__namedParameters.options.removeOriginal?: boolean

__namedParameters.options.viewportId: string

__namedParameters.segmentationId: string

Returns

Promise<void>

Defined in

tools/src/stateManagement/segmentation/index.ts:43