Trouble Using Enlarge with SetOverlay() ROI

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Trouble Using Enlarge with SetOverlay() ROI

alexwatson
This post was updated on .
Hi Everyone,

I'm trying to use imp.setOverlay() to set an overlay onto the image which has ROIs in it.

I know it is working because I'm seeing the ROIs and there's no NullPointerExceptions.

The problem is that IJ.run(imp, "Enlarge...", "enlarge=10 pixel") is not working.

I looked at the source code for MaximumFinder and Selection, but could not figure out how to create an OvalRoi that surrounds my PointRois in a simpler way than to actually loop through them myself.  I just want a method to call to do this for me, if possible.

Sincerely,

Alex W
Reply | Threaded
Open this post in threaded view
|

Re: Trouble Using Enlarge with SetOverlay()

Jim Passmore-2
On Mon, Jul 2, 2012 at 5:01 PM, alexwatson <[hidden email]> wrote:

> I'm trying to use imp.setOverlay() to set an overlay onto the image which
> has ROIs in it.
>
> I know it is working because I'm seeing the ROIs and there's no
> NullPointerExceptions.
>
> The problem is that IJ.run(imp, "Enlarge...", "enlarge=10 pixel") is not
> working.
>

Alex,
I'm not completely sure what you're doing without a little more code, but
perhaps you're misunderstanding the setOverlay() method.  It can be called
in 3 ways according to the API documentation, and in general adds an
overlay to an image, but does NOT create a selection as I understand it.

The Enlarge... command, however, requires a selection to be active.  If I
create an overlay and call Enlarge... I get an error message about a
selection required.  However, if I first do an Image | Overlay | To ROI
Manager command (found in the OverlayCommands class if you're writing
code), then grab a selection from the ROI Manager, the Enlarge... command
works for me.

hth,

*Jim Passmore*
Research Associate
Sealed Air Corporation

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html