I am trying to fill in a non trivial ROI, that’s not an oval, polygon, or rectangle, it is also not entirely enclosed. There are some breaks in the edges.
is it still possible to fill in any ROI regardless of shape?
from ij import IJ, ImagePlus
from ij.process import FloatProcessor
from ij.process import ImageProcessor
from ij.gui import Roi
imp = IJ.getImage()
ip = imp.getProcessor().convertToFloat() # as a copy # Grab the image processor converted to float values
The pixels points to an array of floats
pixels = ip.getPixels()
roi = RoiManager(1); #this is the ROI in the Roimanager
roi = RoiManager(1);
there is an error thrown with ip.setRoi(roi)
- TypeError: setRoi(): 1st arg can’t be coerced to ij.gui.Roi, java.awt.Rectangle, java.awt.Polygon
it’s bizarre that it requires just a rectangle or polygon, any suggestions? \