http://imagej.273.s1.nabble.com/Problem-with-median-filter-in-version-1-45j-tp3684048p3684049.html
This bug is fixed in the ImageJ 1.45k daily build.
> public class test_smoothStack implements PlugIn {
> public void run(String arg) {
> long time1= System.currentTimeMillis();
> ImagePlus img = WindowManager.getCurrentImage();
>
> smoothStack( img, 1.1213, "median" );
>
> long time2= System.currentTimeMillis();
> IJ.log("time to run= "+ (time2- time1) );
>
> IJ.log("done");
>
>
> } ////------------------------------------- END RUN
> --------------------------------------------------------------------
>
>
> //XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
> // Method to perform a smoothing (mean or median of surrounding pixels) on
> a stack.
> // The strength of the smoothing (radius) must be passed.
> public void smoothStack( ImagePlus img, double smoothRadius, String method)
> {
> int mode= 0;
> ImageStack stack= img.getStack();
> ImageProcessor ip;
> RankFilters RF= new RankFilters();
> if ( method== "median") {
> mode= 4;
> } else if (method== "mean") {
> mode= 0;
> } else {
> IJ.log("error in smoothStack method; choosing 'mean' as mode and
> continuing");
> }
>
> for (int slice= 1; slice<= stack.getSize(); slice++) { // for all slices
> ip = stack.getProcessor(slice);
> RF.rank( ip, smoothRadius, mode); // perform filter with mean or median,
> with radius smoothRadius
> }
> img.setStack(null, stack); // update img
> }
>
> }
>
> --
> View this message in context:
http://imagej.588099.n2.nabble.com/Problem-with-median-filter-in-version-1-45j-tp6532622p6532622.html> Sent from the ImageJ mailing list archive at Nabble.com.