Fill ROI holes does not work.

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Fill ROI holes does not work.

Ed Siefker
How do I close holes in a selection?  Image->Selection->Fill ROI Holes
does not work.

e.g. create an image with this code:

newImage("Untitled", "8-bit black", 1024, 1024, 1);
makeOval(252, 293, 390, 376);
setForegroundColor(255, 255, 255);
run("Fill", "slice");
setForegroundColor(0, 0, 0);
makeOval(402, 430, 148, 143);
run("Fill", "slice");
run("Select None");

Then create a selection from that image:


run("Auto Threshold", "method=Shanbhag white");
run("Create Selection");
roiManager("Add");

From here, Fill ROI Holes does nothing.  How do I fill this hole?
Thanks
-Ed

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

Re: Fill ROI holes does not work.

Ed Siefker
Oh.  I guess Fill ROI Holes is a GUI only function?   It's not enough
to run it, you have to click on the image.

How can I fill holes in an ROI from a macro?
On Tue, Dec 4, 2018 at 3:41 PM Ed Siefker <[hidden email]> wrote:

>
> How do I close holes in a selection?  Image->Selection->Fill ROI Holes
> does not work.
>
> e.g. create an image with this code:
>
> newImage("Untitled", "8-bit black", 1024, 1024, 1);
> makeOval(252, 293, 390, 376);
> setForegroundColor(255, 255, 255);
> run("Fill", "slice");
> setForegroundColor(0, 0, 0);
> makeOval(402, 430, 148, 143);
> run("Fill", "slice");
> run("Select None");
>
> Then create a selection from that image:
>
>
> run("Auto Threshold", "method=Shanbhag white");
> run("Create Selection");
> roiManager("Add");
>
> From here, Fill ROI Holes does nothing.  How do I fill this hole?
> Thanks
> -Ed

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

Re: Fill ROI holes does not work.

Krs5
In reply to this post by Ed Siefker
Dear Ed,

If you replace the last two lines with:

run("Analyze Particles...", "include add");

The whole is now part of your selection.

Best wishes

Kees


Dr Ir K.R. Straatman
Senior Experimental Officer
Advanced Imaging Facility
Centre for Core Biotechnology Services
University of Leicester
www.le.ac.uk/advanced-imaging-facility


-----Original Message-----
From: Ed Siefker <[hidden email]>
Sent: 04 December 2018 21:41
To: [hidden email]
Subject: Fill ROI holes does not work.

How do I close holes in a selection?  Image->Selection->Fill ROI Holes does not work.

e.g. create an image with this code:

newImage("Untitled", "8-bit black", 1024, 1024, 1); makeOval(252, 293, 390, 376); setForegroundColor(255, 255, 255); run("Fill", "slice"); setForegroundColor(0, 0, 0); makeOval(402, 430, 148, 143); run("Fill", "slice"); run("Select None");

Then create a selection from that image:


run("Auto Threshold", "method=Shanbhag white"); run("Create Selection"); roiManager("Add");

From here, Fill ROI Holes does nothing.  How do I fill this hole?
Thanks
-Ed

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

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