Posted by
Michael Schmid on
URL: http://imagej.273.s1.nabble.com/new-version-of-Fast-Filters-plugin-tp3684966p5013167.html
Hi anonymous? Louise?,
if you want to use a PlugInFilter or ExtendedPlugInFilter in your own plugin or program, you have a two possibilities:
(1) With ImageJ, use it via IJ.run(imp, "Fast_Filters", "options...");
You get the command with Plugins>Macros>Record in 'Java' mode
(2) See whether there is a public method that you can use. The Fast Filters plugin offers a method
filterFloat(ImageProcessor ip, int type, int radius, boolean xDirection,
int extraX, int extraY, int maxThreads)
For this, you have to convert the image to a FloatProcessor if it isn't one
ImageProcessor.toFloat(int channelNumber, FloatProcessor fp);
convert it back after processing, and care that the ImageProcessor has the correct selection. Also, it will do only elementary steps; you will have to call it for each direction (x&y) and additionally call it again with different 'type' for actions like "eliminate maxima" (first MIN, then MAX).
In principle, you could also write your own program that does essentially the same as the PlugInFilterRunner of ImageJ, i.e., calling the PlugInFilter's setup, showDialog, and run(ip); methods; and do everything that is demanded by the flags returned by the setup and showDialog methods. But that's a rather nasty hack, and difficult to get it right.
Michael
________________________________________________________________
On Jun 15, 2015, at 13:19, justelouise wrote:
> Hi,
>
> I've tried using the plugin in my own java program. However, the results are
> different compared to output when using the ImageJ software. Any ideas?
>
> Thanks!
--
ImageJ mailing list:
http://imagej.nih.gov/ij/list.html