Persistence of Roi.properties

roi

#1

I see the

public void setProperty(String key, String value)

and

public String getProperty(String property)

method of the Roi Object in package ij.gui; (https://imagej.nih.gov/ij/developer/source/).

Are these properties saved when the Rois are Saved (and exported) through the Roi Manager?
In Roi.java: private Properties props; doesn’t seem to be saved anywhere. So are their lifespan limited
only during the ImageJ session?


#2

If you save an image with a ROI as a *tif the ROI will be restored if you reopen the *.tif.

If you have multiple ROI’s you can save the ROI’s with the ROI Manager, see:


You can also use the macro recorder to get the required commands in different languages

See also (Image Properties):

http://imagej.1557.x6.nabble.com/Get-and-Set-Image-Properties-td3688417.html
https://imagej.nih.gov/ij/plugins/imp-props.html


#3

Thank you very much for your reply!

Indeed, set & getProperty for a custom property is persistent. I managed to set a custom property to some Rois, export the Rois through the Roi Manager to a file, load the file back and retrieve the values of the custom property key of the annotated Rois.

Thanks again.