Fill holes of circles on edge

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

Fill holes of circles on edge

jmcginnity
Hi,
I wish to fill circles that intersect the edge of the image.  I've tried Fill Holes but this only fills holes that are completely bounded.  Is there a macro that enables a hole to be filled where one of its edges is the edge of the window?  Please see the image below which shows some doughnut shapes on the edges that I would like to fill.
Image showing unfilled holes on edges

Thanks,

Justin
Reply | Threaded
Open this post in threaded view
|

Re: Fill holes of circles on edge

CARL Philippe (LBP)
Hi Justin,
Please try:
Process->Binary->Fill_Holes
Best regards,
Philippe

-----Message d'origine-----
De : ImageJ Interest Group [mailto:[hidden email]] De la part de
jmcginnity
Envoyé : mardi 14 janvier 2014 16:43
À : [hidden email]
Objet : Fill holes of circles on edge

Hi,
I wish to fill circles that intersect the edge of the image.  I've tried
Fill Holes but this only fills holes that are completely bounded.  Is there
a macro that enables a hole to be filled where one of its edges is the edge
of the window?  Please see the image below which shows some doughnut shapes
on the edges that I would like to fill.
<http://imagej.1557.x6.nabble.com/file/n5006118/Slice1a.jpg>

Thanks,

Justin



--
View this message in context:
http://imagej.1557.x6.nabble.com/Fill-holes-of-circles-on-edge-tp5006118.htm
l
Sent from the ImageJ mailing list archive at Nabble.com.

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

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

Re: Fill holes of circles on edge

Michael Schmid
In reply to this post by jmcginnity
Hi Justin,

you can try this macro:

w=getWidth();
h=getHeight();
run("Invert");
run("Canvas Size...", "width="+(w+1)+" height="+(h+1)+" position=Top-Left");
run("Invert");
run("Fill Holes");
run("Canvas Size...", "width=&w height=&h position=Top-Left zero");
run("Invert");
run("Canvas Size...", "width="+(w+1)+" height="+(h+1)+" position=Bottom-Right");
run("Invert");
run("Fill Holes");
run("Canvas Size...", "width=&w height=&h position=Bottom-Right zero");


Michael
________________________________________________________________
On Jan 14, 2014, at 16:43, jmcginnity wrote:

> Hi,
> I wish to fill circles that intersect the edge of the image.  I've tried
> Fill Holes but this only fills holes that are completely bounded.  Is there
> a macro that enables a hole to be filled where one of its edges is the edge
> of the window?  Please see the image below which shows some doughnut shapes
> on the edges that I would like to fill.
> <http://imagej.1557.x6.nabble.com/file/n5006118/Slice1a.jpg>
>
> Thanks,
>
> Justin
>
>
>
> --
> View this message in context: http://imagej.1557.x6.nabble.com/Fill-holes-of-circles-on-edge-tp5006118.html
> Sent from the ImageJ mailing list archive at Nabble.com.
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html

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

Re: Fill holes of circles on edge

jmcginnity
Hi Michael,

Thanks.  It works really well.

with appreciation,

Justin
Reply | Threaded
Open this post in threaded view
|

RE: Fill holes of circles on edge

jmcginnity

 

 

From: jmcginnity [via ImageJ] [mailto:ml-node+[hidden email]]
Sent: Wednesday, 15 January 2014 12:11 PM
To: Justin McGinnity
Subject: Re: Fill holes of circles on edge

 

Hi Michael,

Thanks.  It works really well.

with appreciation,

Justin


If you reply to this email, your message will be added to the discussion below:

http://imagej.1557.x6.nabble.com/Fill-holes-of-circles-on-edge-tp5006118p5006127.html

To unsubscribe from Fill holes of circles on edge, click here.
NAML

Reply | Threaded
Open this post in threaded view
|

Re: Fill holes of circles on edge

Ferhat Buke
In reply to this post by Michael Schmid
  Hello Michael
 Your code works perfectly so thank you for sharing. Although if an area that needs to be filled is touching to the "bottom left" or "top right" corner of the image simultaneously, it escapes filling. A workarround is obviously adding 2 more Canvas expansions to include Top Right and Bottom Left as well but then it becomes too much work just to fill maximum two empty areas.

 Cheers & Thanks
 Ferhat