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