MaskSegmentHelper
Source: maskSegmentHelper.js:13
Mask segment helper: helps handling the segments list, but does NOT update the associated mask (use special commands for that such as DeleteSegmentCommand, ChangeSegmentColourCommand...).
Constructor
new MaskSegmentHelper(mask: MaskImage): MaskSegmentHelperParameters
mask(MaskImage) — The associated mask image.
Instance Methods
getMask(): MaskImage
Get the associated mask image.
Returns
MaskImage— The mask image.
hasSegment(segmentNumber: number): boolean
Check if a segment is part of the segments list.
Parameters
segmentNumber(number) — The segment number.
Returns
boolean— True if the segment is included.
getNumberOfSegments(): number
Get the number of segments of the segmentation.
Returns
number— The number of segments.
maskHasSegments(numbers: Array.<number>): Array.<boolean>
Check if a segment is present in a mask image.
Parameters
numbers(Array.<number>) — Array of segment numbers.
Returns
Array.<boolean>— Array of boolean set to true if the segment is present in the mask.
getSegment(segmentNumber: number): MaskSegment | undefined
Get a segment from the inner segment list.
Parameters
segmentNumber(number) — The segment number.
Returns
MaskSegment| undefined— The segment or undefined if not found.
addSegment(segment: MaskSegment)
Add a segment to the segments list.
Parameters
segment(MaskSegment) — The segment to add.
removeSegment(segmentNumber: number)
Remove a segment from the segments list.
Parameters
segmentNumber(number) — The segment number.
updateSegment(segment: MaskSegment)
Update a segment of the segments list.
Parameters
segment(MaskSegment) — The segment to update.
findOverlap(rhs: MaskSegmentHelper): OverlapMap
Find the overlap for each segment between two segmentation masks. It is assumed these images have the same orientation.
Parameters
rhs(MaskSegmentHelper) — The helper of the segmentation image to find overlap with.
Returns
OverlapMap— The overlapping voxel counts. First level is the segments from this image, second level is the compare image segments.