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