Regions of Interest - ROIs

Introduction to ROIs

In laboratory imaging experiments, users are often interested in just a part of the image. To define such an interesting part of the image we use one or more Regions of Interest (ROIs). These regions are used later in analysis and measurements.

Note

Do not confuse image ROIs with Camera ROI which is used to reduce the active area to just a part of the camera sensor (CCD or CMOS). Such reduction usually results in higher frame rate. See Camera ROI.

Creating and editing ROIs

ROIs can be created and edited using commands gathered in the ROI menu. ROIs can be also created from binary objects, graticules (for equally spaced shapes) and from binary layers created by tracking.

  1. Global ROI

  2. Background ROI

  3. Moving ROI

  4. Turn Background ROI On

  5. Turn ROI On

Types of ROI

Individual ROIs (ROI objects) are 2D objects. They can have different shape: rectangular, elliptical polygonal or Bezier. One shape can be created with one or more tools. For instance polygon ROI can be defined using both Draw Polygonal ROI and Autodetect ROI.

In case of an ND file which has time axis (e.g. time-lapse) individual ROI objects can be defined as Global or as Changing over time. Global objects do not change any of their characteristics over time. Objects that are defined as changing over time can change their position and shape in time (however objects cannot change their shape - e.g. from ellipse to polygon). This feature is useful for track moving or warping objects.

To track moving objects use the Edit ROIs in Time editor or just change any global ROI into changing over time from the objects' context menu and move it or change its' shape (see interactive edit) on two or more frames. Such frames are called key-frames (2 shows trajectories with little boxes representing the key-frames). All frames in between key-frames are interpolated from these two key-frames. Frames before and after first and last frame respectively are taken from that first or last frame. Therefore it is not necessary to reposition or redraw the ROI on every frame.

In case of Multi Point ND2 file there is one more option: ROI can be defined per Multi Point (which is the default). It means that ROIs from one point are completely independent of ROIs defined on the other point (even if they have the same number). This applies also to ROIs defined as Changing over Time (in case the image has time axis too). On the other hand if the ROI is changed to a Global it will be shared among all points of the Multi Point set.

Depending on the application purposes ROI objects can have different usage. NIS-Elements can handle Background ROIs, Reference ROIs, Stimulation ROIs and Standard ROIs.

Interaction with ROIs

ROIs can be manipulated anytime directly in the image window. Many of the following techniques work in ROI editors too. Objects cannot be moved or resized when they are Locked (some analysis tools or users may lock them to prevent accidental modification). They must be unlocked (from the ROIs' context menu) before any manipulation. Note that the mouse cursor changes over the ROI to indicate which action will be started after mouse button is pressed (it changes when modification keys like Alt and Ctrl are pressed).

Selection

ROI objects can be selected by clicking on an unselected object (other previously selected are unselected). Clicking on a ROI object with Ctrl key pressed results in altering the selection state. More than one object can be selected in this way. Double-clicking on any object results in only that object being selected. All objects can be selected by pressing Ctrl+A or by choosing Select All ROIs from the menu over any ROI. Alternatively, it is also possible to select a set of objects by dragging a rectangle around them with Ctrl key being pressed.

Moving

Objects are moved by simply dragging them (cursor indicates that). When more objects are selected, only the one below the cursor position is moved by default. This can be changed by pressing the Alt key and move all selected objects. When object is changing over time, any moving results in a new key-frame. Individual dots representing the key-frames can be moved too. It is possible to duplicate existing objects by Shift dragging. It works on selected objects. In case of a key-framed object, object is duplicated with all its' key-frames unless Alt is pressed.

Resizing

Resizing a ROI is done by dragging its' contour (the cursor changes accordingly). Note that the hot-zone (the area where mouse cursor changes into different tool) for resizing is outside of the object contour while the hot-zone for moving is inside. Resizing always affects only one object (selection is not taken into account). The behavior slightly varies depending on the object shape. By default resize does not hold aspect of the object - width and height can be changed independently. By holding Shift key aspect is maintained (useful for circles) and the center is not moved. Rectangle can be also rotated by using Alt key while dragging.

Exact values can be entered in ROI Properties dialog which is accessible from the ROI context menu.

Simple ROI Editor

When creating more than one ROI, the Simple ROI editor is the tool of choice. With this tool it is possible to make all possible shapes with different methods. All interaction techniques work here as well.

Note that many actions have a hot-key (P for Pointing tool, R for Rectangle, E for ellipse, L for Polygon, B for Bezier, A for Auto detection, H for drawing holes and others) to speed up the process of interaction.

Auto-Detect Tool

Auto-detect tool is available from ROI menu, Simple ROI editor, Edit ROIs in time editor and some other places. It produces a Polygon ROI. Using the tool is two step process: The first click on an image structure results in preliminary object contour, that is drawn on the screen. After that, user can further tweak the object contour and then finish whole auto-detect by confirming with right mouse button. User can always cancel auto-detect by pressing the Esc key.

The very first click is important, because these pixels under the cursor determine intensities from which the algorithm guesses the whole object. As a general rule it is better to choose brightest pixels in the bright objects (fluorescence) and dimmest in the dark object. It is also good to click near the center of the object.

After the click the algorithm presents its guess of the object contour and goes into the interactive phase. In this phase it is possible to:

Redefine the first point

by clicking again in the image

Cancel auto-detect

by pressing Esc key

Grow or shrink the object area

(changes the intensity range of pixels making the object) by scrolling mouse wheel or pressing PageUp/PageDown (for finer steps use Ctrl + mouse wheel)

Erode or Dilate

morphologically the object by 'E'/'D' or Down/Up keys

Open or Close

morphologically the object by 'O'/'C' keys

Morpho-separate

portions of the object by 'S' or 'P' key (if it is not possible to separate the key does nothing)

Using ROIs for analysis

ROIs are used mainly in the following procedures:

Time Measurement

Changing image intensity inside the ROIs is measured.

Automated Measurement

Selected object features or numbers of objects inside each ROI are measured.

Object Count

ROIs are used to restrict areas of interest where the objects are counted,

ROI Statistics

ROIs are used to measure intensities interactively.

In all these cases ROI selection is taken into account as well as intersection options in Measurement Options.

Additionally the Time measurement interprets the ROI usage type. Background ROIs are used for offset subtraction and Reference ROIs can be used for bleaching correction.

ROIs in Time - Moving ROIs

(requires: Object tracking)

Introduction to Moving ROIs

To define a moving ROI:

  1. Open or capture a time-lapse ND2 file.

  2. Display the first frame of the image and open the vector ROI editor by the ROI > Simple ROI Editor command.

  3. With one of the editor tools, draw the ROI around an object. Close the ROI editor.

  4. Right-click the ROI and select ROI Changes Over Time from the context menu.

  5. Play the image sequence and if the object of interest starts to move out of the ROI, pause the replay.

  6. Now it is possible to drag the ROI to the new position. If the ROI is created by the vector editor, its size and rotation can be also modified.

  7. Play the sequence further and drag the ROI to a new position each time the object in the image moves.

Note

ROI positions between two user-defined frames are interpolated. If the object of interest was moving at constant speed with a linear trajectory, then it would be sufficient to define the ROI positions only in the first and the last frame of the image sequence.

Tips on Moving ROI

Automatic ROI Definition

Automatic Tracking features may be utilized to define moving ROIs. Already tracked objects may be converted to moving ROIs by clicking the Binary to ROI button. See also Tracking.

Move all ROIs at Once

Hold the Ctrl key to select/unselect more than one ROI by mouse. If you want to move all the selected ROIs at once, the Alt key while moving them by mouse, otherwise only the clicked ROI is moved.

Editing ROIs in Time

The Edit ROIs in time editor simplifies editing ROIs that are changing over time. Run ROI > Edit ROIs in Time to display it. ROIs created and edited with this tool are converted into changing over time. All operations can be rolled back by Undo/Redo.

The editor has two major tools: Draw and Detect. Both produce polygon shapes but in the first case it is drawn manually around a structure on the image whereas in the latter it is automatically detected after one click. When Draw or Detect is selected, it is possible to start drawing or detecting immediately as indicated by cursor symbol. In case of editing an existing object, it will be hidden after this first click is made, so the new one can be drawn unobstructed. Esc key is always available to cancel and revert to the previous state. Other tools are for Picking, Moving and Deleting objects.

In this editor, there is always exactly one object selected. Its name and color is reported in the first combo box. In the image here reported, there is object 1 (red) currently selected. To toggle between creation of new objects and editing of existing ones there is the New button.

There are some hot-keys that improve efficiency of the editing process:

  • All tools have a hot-key (indicated with underscore and on the tooltip).

  • Selected object can be changed with Up/Down arrows or number keys on the main keyboard (for objects with id from 1 to 9).

  • Current frame can be moved with the Left/Right keys by one frame and with PageUp/PageDown by number of frames defined in the Skip combo. To move between key-frames it is possible to use '['/']' or ','/'.' for previous and next respectively.

ROI Editor Options

Move

This tool moves the ROI to a different place in the image. As you place the cursor over the ROI, color of the selected ROI is indicated near the mouse cursor (this proves very useful when you have defined many ROIs, or they are overlapping). Simply drag and drop the ROI to another position.

Pick

Use this tool to select directly in the image which ROI you want to edit.

Draw

Use this tool to draw a freehand curve which defines new region of interest. Press the right mouse button to close the curve and finish the definition.

Detect

Enables the user to redetect ROI or to detect a new ROI (when the New button is pressed, or New item is selected from the pull down menu).

New

Press this button to create a new ROI. According to which detection tool is selected, you can either start drawing a new ROI, or click inside the image to let the application detect the ROI automatically.

ROI picker

Select which ROI you want to edit from the pull down menu.

After Edit

Specify which action is taken after a ROI has been edited.

Do Nothing

maintains the current frame and the selected object. The user must advance manually by hotkeys or ND navigation control as well as select objects by picking them or by means of hotkeys (1-9).

Select Next Object

If there are multiple moving ROIs, after editing the first ROI (Draw or Detect) confirmed by a right-click, the next object of this frame is selected. After all ROIs are edited it jumps forward to the next frame (according to the Skip option).

Jump forward

Jumps forward by N frames after an object is edited. It keeps the o object selected. N is defined by the Skip option. Use this option if you need to track one object from start to end of its trajectory.

Skip

Choose how many frames are skipped after editing of the current frame is finished. Skip 1 frame just moves to the nearest next frame.

Delete

Press this button to delete selected ROI.

Undo / Redo

Moves back and forth through the history of changes.

Help

Displays help file.

Finish

Press this button to finish definition and close the dialog.