roiexpr

Description

This node allows a region of interest to be composed from several regions of interest using an expression and imposed on an image.

It is not a node for creating several ROIs at once - the output is always a single ROI.

ROIs can be created for use within the expression by using the "Add ROI" button. These will be assigned to the variables a,b,c.. within the expression, and can be edited by:

  • clicking on their label in the left-most column of the table (to select the entire row) and then clicking and dragging on the canvas,
  • double clicking on the description text in the table to open a numerical editor (not for poly or painted).

Additional ROIs can be connected to the p, q, r inputs; these will be assigned to those variables within the expression. The input image's ROIs are combined into a single ROI and assigned to the variable 'i'. The input image itself is available as the variable 'img'.

Other properties of the image are available and other calculations may be made, but the result of the expression must be an ROI.

Examples:

  • a+b : the union of ROIs 'a' and 'b' from the node's ROI list
  • a*b : the intersection of ROIs 'a' and 'b'
  • a-b : ROI 'a' with ROI 'b' removed
  • -a : the negative of ROI 'a' (i.e. the entire image area as an ROI but with a hole in it)
  • roi(img) - p : any ROIs on the image already, but with the ROI on input 'p' cut out

Connections

Inputs

Index Name Type Desc
0 (none) img Image input
1 p roi ROI which appears as 'p' in expression
2 q roi ROI which appears as 'q' in expression
3 r roi ROI which appears as 'r' in expression

Outputs

Index Name Type Desc
0 (none) img Output image with ROI from expression result imposed
1 (none) roi The ROI generated from the expression

Parameters

roiexprrois: listtype = paintedtype: string (default '')type of the ROI
label: string (default '')the ROI's label
labeltop: boolean (default False)should the label be above or below the ROI when rendered?
colourthe colour of the ROI (ordered)r: int or float (default 1.0)The red component 0-1
g: int or float (default 0.0)The green component 0-1
b: int or float (default 0.0)The blue component 0-1
thickness: int or float (default 0)the border thickness for rendering
fontsize: int or float (default 10)the fontsize for rendering
drawbg: boolean (default True)should the label's background container be filled with black/white (depending on colour)?
drawBox: boolean (default True)draw the ROI bounding box? (painted only)
drawEdge: boolean (default True)draw the ROI edge, or fill it? (painted only)
bbrectbounding box (ordered)x: integer (default 0)The x coordinate of the top left corner
y: integer (default 0)The y coordinate of the top left corner
w: integer (default 0)The width of the rectangle
h: integer (default 0)The height of the rectangle
map: ndarray (default None)mask
r: int or float (default 10)brush radius
type = circletype: string (default '')type of the ROI
label: string (default '')the ROI's label
labeltop: boolean (default False)should the label be above or below the ROI when rendered?
colourthe colour of the ROI (ordered)r: int or float (default 1.0)The red component 0-1
g: int or float (default 0.0)The green component 0-1
b: int or float (default 0.0)The blue component 0-1
thickness: int or float (default 0)the border thickness for rendering
fontsize: int or float (default 10)the fontsize for rendering
drawbg: boolean (default True)should the label's background container be filled with black/white (depending on colour)?
drawBox: boolean (default True)draw the ROI bounding box? (painted only)
drawEdge: boolean (default True)draw the ROI edge, or fill it? (painted only)
croicircle definition (ordered)x: integer (default 0)Centre x coordinate
y: integer (default 0)Centre y coordinate
r: integer (default -1)Radius
type = polytype: string (default '')type of the ROI
label: string (default '')the ROI's label
labeltop: boolean (default False)should the label be above or below the ROI when rendered?
colourthe colour of the ROI (ordered)r: int or float (default 1.0)The red component 0-1
g: int or float (default 0.0)The green component 0-1
b: int or float (default 0.0)The blue component 0-1
thickness: int or float (default 0)the border thickness for rendering
fontsize: int or float (default 10)the fontsize for rendering
drawbg: boolean (default True)should the label's background container be filled with black/white (depending on colour)?
drawBox: boolean (default True)draw the ROI bounding box? (painted only)
drawEdge: boolean (default True)draw the ROI edge, or fill it? (painted only)
points: list (ordered)x: int or float (default 0.0)x
y: int or float (default 0.0)y
drawPoints: boolean (default True)should we draw points
type = recttype: string (default '')type of the ROI
label: string (default '')the ROI's label
labeltop: boolean (default False)should the label be above or below the ROI when rendered?
colourthe colour of the ROI (ordered)r: int or float (default 1.0)The red component 0-1
g: int or float (default 0.0)The green component 0-1
b: int or float (default 0.0)The blue component 0-1
thickness: int or float (default 0)the border thickness for rendering
fontsize: int or float (default 10)the fontsize for rendering
drawbg: boolean (default True)should the label's background container be filled with black/white (depending on colour)?
drawBox: boolean (default True)draw the ROI bounding box? (painted only)
drawEdge: boolean (default True)draw the ROI edge, or fill it? (painted only)
bbrectangle (ordered)x: integer (default 0)The x coordinate of the top left corner
y: integer (default 0)The y coordinate of the top left corner
w: integer (default 0)The width of the rectangle
h: integer (default 0)The height of the rectangle
expr: string (default '')Expression

Automatically generated by generate_autodocs.py

Date: 2025-02-17T16:09:18.986731