Flood Fill

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

Flood Fill

meastwood98
Hi all,

Im writing a plug-in for imageJ using Java, Im wanting to simply flood fill a circle with a certain color, i tried using the IJ.setForegroundColor(); and then IJ.floodFill(); commands but the second one came up with an error. Can anyone tell me how to do this, i think this should be easier than it is proving to be!

THank you in advance,
Mark
Reply | Threaded
Open this post in threaded view
|

Re: Flood Fill

Wayne Rasband
> Im writing a plug-in for imageJ using Java, Im wanting to simply flood
> fill a circle with a certain color, i tried using the
> IJ.setForegroundColor();
> and then IJ.floodFill(); commands but the second one came up with
> an error. Can anyone tell me how to do this, i think this should be
> easier than it is proving to be!

The IJ class does not have a floodFill() method. The easy way to do
this would be to write a macro. In a plugin, you can use the
FloodFiller class. For an example, download the ImageJ source and look
at the floodFill() method in ij/macro/Functions.java.

-wayne
Reply | Threaded
Open this post in threaded view
|

Re: Flood Fill

meastwood98
Ok, how do i use the FloodFill() class within a imageJ plugin? Im not very experieced and im not sure what you mean? could you give me an example?

thanks
mark

Wayne Rasband wrote
> Im writing a plug-in for imageJ using Java, Im wanting to simply flood
> fill a circle with a certain color, i tried using the
> IJ.setForegroundColor();
> and then IJ.floodFill(); commands but the second one came up with
> an error. Can anyone tell me how to do this, i think this should be
> easier than it is proving to be!

The IJ class does not have a floodFill() method. The easy way to do
this would be to write a macro. In a plugin, you can use the
FloodFiller class. For an example, download the ImageJ source and look
at the floodFill() method in ij/macro/Functions.java.

-wayne
Reply | Threaded
Open this post in threaded view
|

Re: Flood Fill

Gabriel Landini
On Thursday 14 February 2008 19:38:28 meastwood98 wrote:
> Ok, how do i use the FloodFill() class within a imageJ plugin? Im not very
> experieced and im not sure what you mean? could you give me an example?


I have used in my Binary Reconstruct plugin:

FloodFiller ff = new FloodFiller(ip);
ff.fill8(x, y);

Cheers,

G.