Saving and Retrieving Regions of Interest (ROIs)

Once ROIs have been created and edited to your satisfaction, they can be stored on disk in an ROI file. The format of these files is given in the file formats section.

Saving Regions of Interest to Disk

In the ROI Toolkit, select Save ROIs ... from the File menu: file_save_rois

The first time you save a set of ROIs, a File Chooser will pop up so that you can select the file into which you want to save the ROIs. In the File Chooser, select a name for the ROI file. The usual file extension for ROI files is ".roi"; a default name will be given for you, created from the name of the image that is loaded. You may change this name (including the extension) to anything you wish. If the chose ROI file already exists, you will be asked whether you want to:

The ROI Toolkit will now calculate the statistics for all the ROIs in the image, and store both the ROI definition and the statistics.

During the save operation, you are prevented from changing the ROIs in the loaded image. However, you may load a new image and continue working with that if you wish.

Note: until ROIs are written to disk, on closing the ROI Toolkit, or unloading the image, you will always be prompted to save the ROIs. At this stage you may chose either to discard the (edited) ROIs, or to cancel the closing of the ROI Toolkit. When the ROI toolkit is closed, all regions currently defined for the loaded image are discarded.

If you modify the ROIs and subsequently save them again, you will not be prompted for the ROI file name: the ROIs will be written to the current ROI file, overwriting the contents.

To save the ROIs to a different ROI file, in the ROI Toolkit, select Save ROIs As ... from the File menu: file_save_as_rois

A File Chooser will pop up so that you can select the new file into which you want to save the ROIs.

Saving Regions of Interest by Colour

If you have attached some significance to the colour of ROIs, you may want to save ROIs with different colours into separate ROI files. If you select select Save ROIs by Colour ... from the File menu: file_save_by_colour

A File Chooser will pop up in the normal way, but now the file name you select will be used as the basis for the individual ROI files. The ROIs will be saved into files with names basename_C0.roi .. basename_C8.roi, where basename is the file name you select in the File Chooser, and C0 .. C8 are the numbers corresponding to the default and 8 user-selectable ROI colours.

Loading Regions of Interest from Disk

To load previously-saved ROIs from disk, in the ROI Toolkit, select Load ROIs from the File menu: file_load_rois

In the File Chooser, select a name of an existing ROI file. A default name will be given for you, created from the name of the image that is loaded; if you used the default name for the save operation, then the file name will match the ROI for the loaded image. You can, of course, load regions that were defined in a different image than the currently-loaded image by changing the name of the ROI file to load.

If ROIs are successfully loaded from the file, a message will appear showing how many ROIs were loaded, and the ROIs will be shown on the image slices.

If the currently-loaded image has fewer slices than the image used to define and save ROIs, it is possible for the slice in which an ROI was defined to be absent from the loaded image. If this happens, a message will appear warning you of this fact. ROIs like this will not be loaded into the current image.

If the currently-loaded image has a smaller field-of-view than the image used to define and save ROIs, it is possible for a ROI to be entirely outside the field of view of the loaded image. If this happens, a message will appear warning you of this fact; the ROI will be retained, but it will be impossible to see or to edit the ROI.

Note: Jim can load ROIs that have been saved by the popular ImageJ and Dispimage programs. However, it cannot save ROIs in these formats.
Note: there are some ROI types and ROI features in ImageJ that cannot be translated into Jim ROIs; these types of ROI and features are skipped over if encountered.

Unloading Regions of Interest

If you have finished with a set of ROIs and wish to remove them from the image, you can unload them by selecting the Unload ROIs from the File menu: file_unload_rois

If the ROIs have not been saved, then you will be asked whether you really want to unload (and thereby discard) them. Once the ROIs are unloaded from the image, they cannot be retrieved later, unless you first save them to disk.

Automatically Loading Regions of Interest

You may have a repetitive task to perform, where you need the same ROIs to be loaded for a series of images to be analysed. You can tell Jim to load ROIs automatically from an ROI file whenever a new image is loaded. To do this, select the Auto Load ROIs menu check-box from the File menu: file_auto_load_rois

This will bring up a file chooser so that you can select the ROI file to automatically load. Whenever you load a new image, the ROIs from this file will also be loaded. To turn off this auto-loading, uncheck the Auto Load ROIs check-box in the File menu.

If you subsequently want to select a different set of ROIs to automatically load, then choose this with the Select Auto Load ROIs ... in the File menu.

Jim Home