Open Roi file without RoiManager

I am wondering if there is a way to open a roi file (previously saved via the RoiManager) in a script without having to use the RoiManager (rm) like
rm.runCommand("Open", RoiPath.toString()).
which is adding the roi to the RoiManager.

While I would prefer to store directly the content of the file in a Roi object, so something like
myRoi = IJ.openRoi(RoiPath.toString())
but I could not find such thing.

The idea is to feed the Roi from file to a batch processing script. While I would keep the RoiManager for the output of the script. I still can do it with the previous command but it is a bit more of boilerplate code.


There’s and that contain static methods to open and save ImageJ1 ROIs.

#@ File roiFile
#@ File (style="save") outputFile


roi =
// process your roi here
success =, outputFile.getPath())