| Home | | | Quick start | | | Cookbook | | | All symbols | | | Analytical index | | | Namespaces | | | Syntax | | | Statements | | | CX | | | Frequency | | | Functions | | | Examples | | | Examples by command |
This page is generated automatically from the interpreter function registry and grouped by practical use.
RECT.AREA(rect)
Returns w*h for valid rectangles, otherwise 0.
value = RECT.AREA(rect)RECT.CLIP(rect, width, height)
Clips a rectangle to image bounds [0,width) x [0,height).
value = RECT.CLIP(rect, width, height)RECT.CREATE(x, y, w, h)
Creates a half-open pixel rectangle represented by x,y,w,h. XEND is x+w and YEND is y+h.
r = RECT.CREATE(10, 20, 30, 40)RECT.EMPTY(rect)
Returns TRUE when rect has zero/negative width or height.
value = RECT.EMPTY(rect)RECT.EQUAL(a, b)
Returns TRUE when x,y,w,h are identical.
value = RECT.EQUAL(a, b)RECT.FROM_TEXT(text)
Reads a rectangle from RECT(x,y,w,h), RECT:x,y,w,h, or plain x,y,w,h text.
r2 = RECT.FROM_TEXT(RECT.TO_TEXT(r))RECT.H(rect)
Returns the rectangle height in pixels.
value = RECT.H(rect)RECT.INTERSECT(a, b)
Returns the half-open intersection of two rectangles, or an empty rectangle when they do not overlap.
value = RECT.INTERSECT(a, b)RECT.TO_TEXT(rect)
Serializes a rectangle as RECT(x,y,w,h).
value = RECT.TO_TEXT(rect)RECT.UNION(a, b)
Returns the smallest half-open rectangle containing both valid rectangles.
value = RECT.UNION(a, b)RECT.VALID(rect)
Returns TRUE when rect has strictly positive width and height.
value = RECT.VALID(rect)RECT.W(rect)
Returns the rectangle width in pixels.
value = RECT.W(rect)RECT.X(rect)
Returns the first included X pixel coordinate.
value = RECT.X(rect)RECT.XEND(rect)
Returns the exclusive end X coordinate x+w.
value = RECT.XEND(rect)RECT.Y(rect)
Returns the first included Y pixel coordinate.
value = RECT.Y(rect)RECT.YEND(rect)
Returns the exclusive end Y coordinate y+h.
value = RECT.YEND(rect)MASK.APPLY(image,mask[,background])
Returns image/stack pixels inside the mask unchanged and replaces outside pixels with background. Single images/masks broadcast across stacks.
Parameters enclosed in [...] may be omitted. Nested brackets mean that the later parameter is available only when the previous optional level is also supplied.
| Parameter | Meaning |
|---|---|
background | Initial canvas background value. |
inside = MASK.APPLY(img, mask, 0)MASK.AREA(mask)
Alias-style semantic count of foreground pixels. For a rectangular single-frame mask it equals RECT.AREA(rect).
ASSERT MASK.AREA(mask) = RECT.AREA(r), "area mismatch"MASK.BBOX(mask[,frame])
Returns the half-open RECT bounding box of all non-zero mask pixels in the selected frame.
Parameters enclosed in [...] may be omitted. Nested brackets mean that the later parameter is available only when the previous optional level is also supplied.
| Parameter | Meaning |
|---|---|
frame | Zero-based frame index; some stack commands accept -1 for all frames. |
r = MASK.BBOX(mask)MASK.COUNT(mask)
Counts foreground pixels, where any non-zero channel marks a foreground pixel. For stacks, counts all frames.
n = MASK.COUNT(mask)MASK.COUNT_NONZERO(mask)
Compatibility alias for COUNT_NONZERO / MASK.COUNT.
n = MASK.COUNT_NONZERO(mask)MASK.EMPTY(mask)
Returns TRUE if the mask has no foreground pixels.
ASSERT NOT MASK.EMPTY(mask), "mask unexpectedly empty"MASK.FROM_ROI(image[,value])
Creates a mask from the programmatic ROI stored on an image or stack.
Parameters enclosed in [...] may be omitted. Nested brackets mean that the later parameter is available only when the previous optional level is also supplied.
| Parameter | Meaning |
|---|---|
value | Scalar value written, drawn, or used as foreground/background according to the command. |
img = ROI.SET_RECT(img, r)
mask = MASK.FROM_ROI(img)MASK.INVERT(mask)
Returns the binary inverse of a mask, using 0 for foreground and 255 for background.
inv = MASK.INVERT(mask)MASK.RECT(width,height,rect[,value]) OR MASK.RECT(width,height,x,y,w,h[,value])
Creates a binary mask image from a RECT geometry or explicit x,y,w,h coordinates. The rectangle is clipped to the mask bounds.
Parameters enclosed in [...] may be omitted. Nested brackets mean that the later parameter is available only when the previous optional level is also supplied.
| Parameter | Meaning |
|---|---|
value | Scalar value written, drawn, or used as foreground/background according to the command. |
r = RECT.CREATE(10,12,20,15)
mask = MASK.RECT(80,60,r)MASK.TO_ROI(mask[,frame]) OR MASK.TO_ROI(image,mask[,frame])
With one mask returns MASK.BBOX. With image+mask returns a copy of the image with ROI set to the mask bounding box.
Parameters enclosed in [...] may be omitted. Nested brackets mean that the later parameter is available only when the previous optional level is also supplied.
| Parameter | Meaning |
|---|---|
frame | Zero-based frame index; some stack commands accept -1 for all frames. |
img2 = MASK.TO_ROI(img, mask)
r = ROI.RECT(img2)MASK.VALID(mask)
Returns TRUE when the argument is a non-empty image/stack that can be treated as a mask.
ASSERT MASK.VALID(mask), "mask not valid"