Editing Regions of Interest (ROIs)

Using the handles

The shape of an ROI can be altered in several ways, but most commonly by dragging the "handles" that are around the outline of an ROI. To see the handles on an ROI, first select the ROI by clicking on the outline (ensure first that you are in Edit Mode). ROI handles are shown enlarged below for a Rectangular ROI.

The handles on a rectangular roi

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

To change an Elliptical ROI, click and drag either:

Rotating ROIs

The following types of ROI can be rotated:

These ROIs can be rotated by holding down the "Shift" key and dragging one of the corner or edge handles. For straight Line ROIs, drag one of the ends of the Line to rotate.

As the ROI is being rotated, the status bar shows:

When the mouse is released, the status bar shows the final rotation angle.

Flipping ROIs

ROIs can be flipped horizontally or vertically. To flip an ROI or several ROIs together, select the ROIs, and then select the flip direction from the Edit menu of the ROI Toolkit: Menu to flip an ROI or multiple ROIs together

Morphological Operations on ROIs

[Keyboard accelerators: Control-E (erode) and Control-D (dilate)]

Morphological operations can be performed on ROIs to erode or dilate them. Erosion involves shaving one pixel-width from the outline of an ROI to shrink it; dilation involves enlarging an ROI by one pixel-width. To erode or dilate an ROI or several ROIs together, select the ROIs, and then select the morphological operation from the Edit menu of the ROI Toolkit: Menu to perform morphological operations on ROIs

Here are some general rules about what happens to different types of ROI as they are eroded or dilated.

By default, the amount by which ROIs are eroded and dilated is one pixel width or height. If pixels are non-square, then the amount is average of the pixel width and height. However, the amount is settable in the ROI Preferences.

Logical Operations on ROIs

Logical operations can be performed on ROIs to combine them in different ways. To perform logical operations on two or more ROIs, select the ROIs, and then select the logical operation from the Edit menu of the ROI Toolkit: Editing ROIs using a logical operation

The result of logical operations is illustrated for the two ROIs shown below: a Rectangular ROI and an Elliptical ROI.


The two ROIs before the logical operation.

Vertex handles on Irregular and Curved Line ROIs

You can move the individual vertices of an Irregular or Curved Line ROI, using its vertex handles. To see the vertex handles, first select an Irregular or Curved Line ROI, by clicking on its border once. Then click again on the border (you can also use the ROI toolkit Edit Outline from the Edit menu, or use the keyboard accelerator "Control-O"). The ROI will then appear like this:

roi_edit_outline

When an ROI has a lot of handles, not all the handles may be visible. Only a selection of handles is shown, such that the visible handles do not overlap. As you zoom in on the ROI, more and more handles can be seen, since they do not overlap at high zoom. This makes editing the outline of Irregular ROIs quicker, since coarse changes can be made at low zoom before zooming in for fine-detail changes.

roi_edit_outline_low_zoom

An ROI seen at low zoom - only a selection of the vertices has a handle shown.

roi_edit_outline_high_zoom

The same ROI, with higher zoom - more handles are visible.

To change the outline, use the mouse in the following way:

Note: you can zoom and scroll the image as you are editing the ROIs.

Vertex handles on Open and Closed Spline ROIs

You can move the individual points that define Spline ROIs, using its point handles. To see the point handles, first select an Open or Closed Spline ROI, by clicking on its border once. Then click again on the border (you can also use the ROI toolkit Edit Outline from the Edit menu, or use the keyboard accelerator "Control-O"). You can the edit the points on the Spline:

Using the Eraser

Irregular ROIs may also be edited using the "Eraser" tool. When an Irregular ROI is selected and editable, the tool becomes active: eraser.

You will typically use the eraser tool to remove part of an Irregular ROI that has been produced by contour following, where the contour follows the image feature for most of its outline, but then deviates towards another image feature. For example, below is an attempt to outline a small brain lesion in the frontal white matter using edge detection and contouring. The outline has deviated into the second (almost confluent) periventricular lesion below.

irregular_before_erase

For example, to remove the bottom "limb" of this ROI, click on the eraser icon, and draw an erasing line that separates the ROI from the unwanted limb. Points erased will appear as a white line.

irregular_during_erase

After the erasure, the original ROI will be split into two, as shown below. Any unwanted ROIs can now be selected and deleted.

irregular_after_erase

All points on the ROI outline beneath the eraser line will be deleted. If this results in two or more breaks in the ROI outline, then the original ROI will be divided into two or more ROIs. For the purposes of audit, the original ROI will be retained as the largest of the remaining ROIs (the remaining ROI with the largest number of outline points). Any additional ROIs will be treated as new ROIs.

Another example of the use of the Eraser is to separate contours that are joined by a small "bridge". In the following example, after attempting to outline the brain by following a contour, the brain was joined to the scalp by a very small bridge of tissue:

brain_before_erase

Here is a close up of the bridge during erasure:

brain_scalp_bridge

Using a small eraser width (1 pixel), the Eraser was used to divide the brain from the scalp contour, resulting in the two contours below:

brain_after_erase

The unwanted scalp contour was then selected and deleted.

Using the Eraser to Extend an ROI

You can also use the eraser to extend an irregular ROI's boundary. To do this, start drawing the eraser line inside an ROI, loop the line outside the ROI, and then end with the line back inside the ROI. This loop that you form will extend the boundary of the ROI, as illustrated below.

roi_before_extension

The original ROI.

roi_during_extension

The eraser line, starting and ending inside the ROI, but looping outside.

roi_after_extension

The extended ROI, includes the area enclosed by the loop.

Eraser Width

The width of the eraser line is measured in screen pixels, and is set from the selector Setting the width of the eraser line.

ROI Deletion

To delete an ROI, first select it, then either choose Cut from the ROI Toolkit Editmenu, the keyboard accelerator "Control-X", or press the delete key.

Other ROI Edit Operations

Other ROI editing operations are available in the ROI Toolkit Edit menu:

Note: Sometime when you create ROIs or copy/paste them, you will see a message stating that an ROI already exists in the slice and has not been created. The ROI Toolkit does not allow a region of the same type and shape to appear twice in the same slice. This is to prevent unintentional duplication of ROIs that lie exactly on top of each other, so that the user would be unaware of one of the ROIs. If this happened, then area and volume measurement might give the erroneous results because of these "hidden" ROIs.

Note: When you have a selected slice, you can cycle through the ROIs by pressing the ">" and "<" keys. As you press the ">" key the next ROI in the selected slice is selected. As you press the "<" key the previous ROI in the selected slice is selected. Deleted ROIs cannot be selected in this way.

ROI Edit Undo

When you add or change ROIs and make a mistake or the result is unsatisfactory, the operation can be undone. To undo the last operation, select Undo from the Edit menu: roi_edit_undo, or use the keyboard accelerator "Control-Z".

Note that the maximum number of undo operations is set in the user preferences of the ROI toolkit.

Jim Home