Constructor
new MaskSegmentHelper(mask)
Name | Type | Description |
---|---|---|
mask | Image | The associated mask image. |
Classes
Methods
addSegment(segment)
Add a segment to the segments list.
Name | Type | Description |
---|---|---|
segment | MaskSegment | The segment to add. |
getNumberOfSegments() → {number}
Get the number of segments of the segmentation.
The number of segments.
- Type:
- number
getSegment(segmentNumber) → {MaskSegment|undefined}
Get a segment from the inner segment list.
Name | Type | Description |
---|---|---|
segmentNumber | number | The segment number. |
The segment or undefined if not found.
- Type:
- MaskSegment |
undefined
hasSegment(segmentNumber) → {boolean}
Check if a segment is part of the segments list.
Name | Type | Description |
---|---|---|
segmentNumber | number | The segment number. |
True if the segment is included.
- Type:
- boolean
maskHasSegments(numbers) → {Array.<boolean>}
Check if a segment is present in a mask image.
Name | Type | Description |
---|---|---|
numbers | Array.<number> | Array of segment numbers. |
Array of boolean set to true if the segment is present in the mask.
- Type:
- Array.<boolean>
removeSegment(segmentNumber)
Remove a segment from the segments list.
Name | Type | Description |
---|---|---|
segmentNumber | number | The segment number. |
updateSegment(segment)
Update a segment of the segments list.
Name | Type | Description |
---|---|---|
segment | MaskSegment | The segment to update. |