Posted by
Michael Schmid on
URL: http://imagej.273.s1.nabble.com/new-version-of-Fast-Filters-plugin-tp3684966p5013192.html
Hi Louise (?),
as I said, you can simply call
IJ.run(imp, "Fast_Filters", "filter=minimum x=10 y=10 preprocessing=none offset=0");
and it would do exactly the same as if you run it manually.
Otherwise you can use (for floating point images) e.g.
ImageProcessor ip = imp.getProcessor();
int radius = 10;
int maxThreads = Runtime.getRuntime().availableProcessors();
filterFloat(ip, /*type=*/3, radius, /*xDirection=*/true,
/*extraX=*/0, /*extraY=*/radius, /*maxThreads=*/2);
filterFloat(ip, /*type=*/3, radius, /*xDirection=*/false,
/*extraX=*/0, /*extraY=*/0, maxThreads);
So you see, using the filterFloat method is much more cumbersome, and this does not include conversion from/to float yet and does not process all slices of a stack if desired. It will be even worse if you want to subtract the result or you need a 'composite' action such as "eliminate maxima" or "background from maxima".
So for sure, it is much easier to use IJ.run. You can also have variable parameters in it, e.g.
int radius = 10;
IJ.run(imp, "Fast_Filters", "filter=minimum x="+radius+" y="+radius+" preprocessing=none offset=0");
By the way, for proper use of the filterFloat method, the constants for 'type' such as MEAN, MIN, MAX should be defined as public in the FastFilters plugin. Seems that I have forgotten to do this; if I find time, I'll correct it.
Michael
________________________________________________________________
On Jun 16, 2015, at 16:01, justelouise wrote:
--
ImageJ mailing list:
http://imagej.nih.gov/ij/list.html