Editing 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.

To change an ROI, click and drag one of the handles:
- Use the centre handle to move an ROI.
- Use an edge handle to stretch an ROI vertically or horizontally.
- Use a corner handle to stretch an ROI both vertically and horizontally.
To change an Elliptical ROI, click and drag either:
- The centre handle to move the ROI.
- The handle at the end of the major or minor axis to alter the axis length.
Rotating ROIs
The following types of ROI can be rotated individually:
- Straight Line.
- Curved Line.
- Elliptical.
- Irregular (either manually drawn or contour).
- Spline (either open of closed).
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:
- the angle between the line and the horizontal for straight Line ROIs.
- the angle of the major axis for Elliptical ROIs.
- the angle of the current rotation for all other types of ROI.
When the mouse is released, the status bar shows the final rotation angle.
When more than one ROI is selected, the ROIs are rotated as a group, with the centre of rotation being at the centroid of all the ROIs combined. When rotated together like this, there is no restriction on the types of ROI that can be rotated.
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:
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: 
Here are some general rules about what happens to different types of ROI as they are eroded or dilated.
- Dilation of a Marker results in a rectangular ROI; erosion deletes it.
- Text ROIs behave just like Markers.
- Dilation of a Line ROI results in a Irregular ROI with a rectangular shape; erosion deletes it.
- Dilation of a Curved Line or Open Spline ROI results in a fat snake-like Irregular ROI; erosion deletes it.
- Dilation of a Rectangular ROI results in a larger Rectangular ROI; erosion results in a smaller one. If a Rectangular ROI is very small, erosion will delete it.
- Dilation of an Elliptical ROI results in a larger Elliptical ROI; erosion results in a smaller one. If an Elliptical ROI is very small, erosion will delete it.
- Dilation of an Irregular ROI results in a larger Irregular ROI; erosion results in a smaller one. If an Irregular ROI is very small, erosion will delete it. Erosion can result in a Irregular ROI being divided into two or more Irregular ROIs.
- Dilation and erosion of a Closed Spline ROI may result in a noticeable change in shape of the spline, since the operation shifts each point on the Spline along the normal to the tangent through the point, in a direction that is either outward (for dilation) or inward (for erosion).
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: 
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.
- And Not (Descending Size). Starting with the largest ROI (by area), this is AND NOTted with the next-largest. The result is then AND NOTted with the next next-largest, and so on until all ROIs have been used. The AND NOT operation is a subtraction of the intersected area. Since the Rectangular ROI is bigger than the Elliptical ROI, the result is as shown below in this example.

After And Not (Descending Size).
- And Not (Ascending Size). Starting with the smallest ROI (by area), this is AND NOTted with the next-smallest. The result is then AND NOTted with the next next-smallest, and so on until all ROIs have been used. The AND NOT operation is a subtraction of the intersected area. Since the Elliptical ROI is smaller than the Rectangular ROI, the result is as shown below in this example.

After And Not (Ascending Size).
- Union. The combined shapes of the overlapping ROIs form a new Irregular ROI.

After Union.
- Intersection. Only the intersecting parts of the ROIs remain as a new Irregular ROI.

After Intersection.
- XOR (exclusive OR). Only the parts of the ROIs that do not overlap remain as a new ROI (or set of ROIs). In this example, the result is 2 Irregular ROIs with the overlapping part cut from the original ROIs. For clarity, these 2 ROIs are shown separately below.


After XOR (Exclusive OR).
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:

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.

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

The same ROI, with higher zoom - more handles are visible.
To change the outline, use the mouse in the following way:
- Click and drag a vertex handle to change its position. Other non-visible handles are also dragged along too.
- Press the "Shift" key and click on a vertex handle to delete it.
- Press the "Control" key and click on a vertex handle to add a new pair of vertices either side of it.
- For Irregular ROIs (either created by manual drawing, or by contouring) you can double-click on a vertex handle to "open up" the ROI, so that you can modify an Irregular ROI to easily include a part of a feature that was missed by contouring. The sequence of images below shows this in action.
![]() |
![]() |
![]() |
![]() |
|---|---|---|---|
| Before opening. Double click on a handle to open. |
Opened. Continue drawing with the mouse. |
Drawing in progress. Double-click to close. |
Modification complete. |
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:
- Click and drag a spline handle to change its position.
- Press the "Shift" key and click on a spline handle to delete it.
- Press the "Control" key and click on a spline handle to add a new pair of points either side of it.
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:
.
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.

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

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

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:

Here is a close up of the bridge during erasure:

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:

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.

The original ROI.

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

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
.
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:
-
Cut (accelerator: Control-X). Deletes an ROI, but places it on the ROI clipboard. If more than one ROI is selected, operation applies to all selected ROIs.
-
Copy (accelerator: Control-C). Copies an ROI to the ROI clipboard. If more than one ROI is selected, operation applies to all selected ROIs.
-
Paste (accelerator: Control-V). Paste ROI(s) in the clipboard to the selected slice.
-
Select All (accelerator: Control-A). Select all ROIs in the selected slice.
-
Paste To Slices ... Paste ROI(s) in the clipboard to a range of slices. A dialog pops up for you to set the range of slice numbers into which the ROIs will be pasted, and a step between slices:

Set the slice range and step, then click the
button.
-
Paste All Slices. Paste ROI(s) in the clipboard to the all slices of the image.
-
Edit Outline. Shows the Vertex handles of an irregular ROI, allowing the outline to be edited.
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:
, 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.



