Region of Interest (ROI) Creation

Start the ROI Toolkit from the Toolkits menu: Menu item to launch the ROI Toolkit

The ROI Toolkit will now appear.

roi_toolkit

Note: in order to make better use of your computer screen space, you can 'minimise' the ROI Toolkit by clicking the ROI toolkit minimisation button. This hides the contouring settings and ROI details. To restore the ROI Toolkit and show these, click on the ROI toolkit maximisation button. The minimisation state at startup can also be configured in the ROI Preferences.

Creating an ROI

There are eight types of ROI, which can be created by clicking on the icon in the ROI Toolkit frame:

text Text
marker Marker
line_roi Line
rectangular Rectangular
elliptical Elliptical
curved_line_roi Curved line
irregular Irregular, manually drawn
Open spline Open spline
Closed spline Closed spline
contour Irregular, contour following

You can also create hollow Hollow ROIs by merging two or more ROIs, where one ROI contains all the others within its perimeter.

For handy ROI creation you can also bring up the "handy ROI tools" window from the ROI Toolkit: show_handy_tools.

This pops up the window shown below:

handy_tools

You can move this window around to wherever it is easiest to access, to minimise your movement of the mouse. Alternatively, you can also very rapidly create ROIs using the keyboard accelerators detailed below for each type of ROI.

There are different ways to create and edit the different types of ROI. These are detailed below.

Text Annotation

[Keyboard accelerator: point to the image and press the 't' key.]

To create some text annotation, click on the text icon.

The status bar gives you the instructions "click on the image and type text; ⟨Enter⟩ to finish; Esc to cancel". To define some text annotation, click on the point where you want the text to appear, then type in the text you require, and press the Enter key to finish. Alternatively, just click with the mouse away from the text you have just typed in. To cancel the operation, press the "Escape" key on the keyboard. The text ROI will look like this:

text_roi

To change the position of some text, click on the text, then click and drag one of the corner handles to move it to a new position.

All text ROIs are displayed with text in the same font size. However, the size is configurable using the ROI Toolkit Preferences.

Note: you can also rapidly create some text by pointing with the mouse to the image, and pressing the 't' key on your keyboard.

Markers

[Keyboard accelerator: point to the image and press the 'm' key.]

To create a marker, click on the marker icon.

The status bar gives you the instructions "click on the image; Esc to cancel". To drop a marker, click on your chosen point somewhere in the image. To cancel the operation, press the "Escape" key on the keyboard. The marker will look like this:

marker_roi

To change the position of the marker, click on the marker, which will then appear with a green "handle" in the centre, shown enlarged below:

marker_roi_handle

To move the marker, click and drag the handle to its new position.

Note: you can also rapidly create a Marker by pointing with the mouse within the image, and pressing the 'm' key on your keyboard.

Lines

To create a straight line distance measurement, click on the line_roi icon.

The status bar gives you the instructions "click, hold and drag to define; Esc to cancel". To define a line, click point somewhere in the image and hold the mouse button down; this will be the first end of the line. Drag the mouse to the other end of the line (somewhere within the same slice of the image), and release the mouse button. The line will now have been defined. To cancel the operation, press the "Escape" key on the keyboard. The line ROI will look like this:

line_roi_defined

To change the line, click on it, after which it will then appear with a green "handle" in the centre, as shown below:

line_roi_selected

To change the line, you can:

Rectangular ROIs

To create a rectangular ROI, ensure that you have a slice selected, click on the rectangular icon.

This will create a "default" rectangular ROI in the middle of the selected slice:

default_rectangular_roi

The rectangular ROI has handles, allowing you to change the shape, size and position of the ROI. These are show enlarged below:

rectangular_roi_handles

To change an ROI, click and drag one of the handles:

In addition, Line, Curved Line, Elliptical and Irregular ROIs can be rotated, by pressing the "Shift" key and dragging one of the axis handles. See ROI Editing section for more details.

Elliptical ROIs

To create an elliptical ROI, ensure that you have a slice selected, then click on the elliptical icon.

This will create a "default" elliptical ROI in the middle of the selected slice:

default_elliptical_roi

The elliptical ROI has five handles that allow you change the shape, size and angle of the ROI. Use the centre handle to move the ROI. The other four handles are at the ends of the major and minor axes: click and drag these handles to alter the major and minor axis lengths.

Curved Lines

A Curved Line ROI is actually made up multiple straight-line segments. However, if the segments are short, the appearance is that of a curve. To create a curved line distance measurement, click on the curved_line_roi icon.

The status bar gives you the instructions "click or trace points around the shape; Esc to cancel". To define a curved line, you can click the mouse at individual points around the curve, or you can hold the mouse button down to draw the curve.

curved_line_roi_being_drawn

To end the curve, double-click with the mouse. You can also finalize the curve using the keyboard accelerator 'z'. To cancel the operation press the "Escape" key on your keyboard.

Note: you can zoom and scroll the image as you are drawing the outline, as usual. To change the curved line, click on it, after which it will then appear with nine "handles", as shown below:

curved_line_roi_selected

To change the line, you can:

Irregular ROIs

[Keyboard accelerator: you can initiate creation of an Irregular ROI by pointing to the image pressing the 'i' key.]

Irregular ROIs are drawn manually on the image, and are (like Curved Lines) made up of multiple straight line segments. Click on the irregular icon to start drawing: the status bar gives the instructions: "click or trace points around the shape; Esc to cancel".

You can click the mouse at individual points around the outline of the feature you want to measure, or you can hold the mouse button down to draw around the outline.

irregular_roi_being_drawn

To close the outline, and create a completed ROI, double-click with the mouse. You can also finalize the ROI using the keyboard accelerator 'z'. To cancel the operation press the "Escape" key on your keyboard.

Note: if you make a mistake during your drawing, press the "Shift" key on your keyboard; the mouse cursor changes to look like this: roi_erase_cursor and acts an eraser. Retrace your steps with the mouse, and the eraser will remove the end of the line; release the "Shift" key to continue drawing.

Note: you can zoom and scroll the image as you are drawing the outline, as usual.

Note: for ROIs drawn by hand that have segments of the outline that cross, the "even-odd winding rule" is used to define the interior and exterior portions of the ROI. The figure below shows such a shape:

winding_rule

That which is defined to be the interior of the ROI is coloured in blue. To see how the even-odd rule works, consider the line drawn through the ROI. Each time the line crosses the outline of the ROI, a counter is incremented. When the counter is odd, the line is inside the ROI; when the counter is even, the line is outside the ROI. This rule works for any line drawn through the ROI, and for any direction of traversal of the line.

Open Spline ROIs

[Keyboard accelerator: you can initiate creation of an Open Spline ROI by pointing to the image pressing the 'o' key.]

An Open Spline ROI automatically has a smooth shape: a cubic spline interpolator is used to join the points that you define. The spline line passes through the points, but a smooth arc is drawn between the points.

Click on the Open Spline icon to start drawing: the status bar gives the instructions: "click points around the shape; Esc to cancel".

Click the mouse at individual points that you want the spline to pass through. As the Open Spline ROI is being drawn, you see the points you clicked and the line passing through them.

A Spline ROI being drawn

To complete the ROI with a final point at the end, double-click with the mouse. You can also finalize the spline using the keyboard accelerator 'z'. To cancel the operation press the "Escape" key on your keyboard. After completion, the positions of the points on the spline can be adjusted by selecting and dragging the green handles. See also the section on editing Spline ROIs.

Note: if you make a mistake during your drawing, press the "Shift" key on your keyboard and click on the last point drawn, which will remove the last point.

Note: you can zoom and scroll the image as you are drawing the outline, as usual.

Closed Spline ROIs

[Keyboard accelerator: you can initiate creation of a Closed Spline ROI by pointing to the image pressing the 's' key.]

A Closed Spline ROI is similar to the Open Spline, but the ends of the line are automatically joined to form a smooth, closed shape.

Click on the Closed Spline icon to start drawing: the status bar gives the instructions: "click points around the shape; Esc to cancel".

Click the mouse at individual points that you want the spline to pass through. As the Closed Spline ROI is being drawn, you see the points you clicked and the line passing through them. To complete the ROI, double-click to create final point and close the shape. You can also finalize the Spline using the keyboard accelerator 'z'. To cancel the operation press the "Escape" key on your keyboard.

A completed Closed Spline ROI
A completed Closed Spline ROI

After completion, the positions of the points on the spline can be adjusted by selecting and dragging the green handles. See also the section on editing Spline ROIs.

Note: if you make a mistake during your drawing, press the "Shift" key on your keyboard and click on the last point drawn, which will remove the last point.

Note: you can zoom and scroll the image as you are drawing the outline, as usual.

Contoured ROIs

[Keyboard accelerator: point to the edge of a feature and press the 'c' key.] A contoured ROI follows a contour, or level of intensity, from a point indicated by a mouse click.

To initiate contouring, select the contouring mode from the menu as detailed below, then click on the contour icon. Move the mouse near to the edge of a feature on the image, an click with the mouse to create a contour around that feature. You can also create the contour using the keyboard accelerator 'z' instead of a mouse click. To cancel the operation press the "Escape" key on your keyboard.

Note: when coutouring using a fixed level or mouse +/- δ, you can interactively alter the level value by pressing down the left mouse button and dragging the mouse pointer up and down the screen. Move the mouse up the screen to increase the level value; move it down to decrease it. The contour produced at the new level is updated as you drag the mouse.

Jim will now have produced a contour, shown in light blue, outlining an image feature. Below is the result of applying edge detection and contouring to the edge of brain lesion.

lesion_contour

The following options modify the way in which contouring works:

Hollow ROIs

A hollow ROI is created from two or more ROIs, where one ROI contains all the other ROIs: the inner ROIs are used to form holes in the outer ROI. To create a hollow ROI, perform the following steps.
  1. Select two or more ROIs, where one ROI contains all the other ROIs, as illustrated below.

    hollow_select

  2. Click the hollow button in the ROI Toolkit.
  3. You will now have a single ROI of type "Hollow". The regions within the outer ROI are "hollows" that do not contribute to ROI statistics such as area and mean intensity. However, these parts of the ROI do contribute to the perimeter.

If one regions does not completely contain all the all the other ROIs, as illustrated below, you will receive an error message when you try to create the hollow ROI.

hollow_not_allowed

This will generate the error message "one ROI must completely contain all the others to make a Hollow ROI"

Pixel Snap pixel_snap

Turning pixel snap on (by checking pixel_snap) causes the outlines of ROIs to snap onto the nearest corners or centres of image pixels. Thus, for example with Pixel Snap turned on, Rectangular ROIs will always contain a whole number of pixels. Without Pixel Snap, ROIs are free to have any shape defined by the user.

The ROI Toolkit can be set so that the vertices of some ROIs (Line, Curved Line, Spline and Irregular ROIs) can snap either to the corners or to the centres of pixels. Change between snapping to centres/corners, by setting your preference in the ROI Preferences dialog.

Jim Home