/** Since most computing time is spent in GaussianBlur, forward the * information about the number of passes to Gaussian Blur. The * ProgressBar will be handled by GaussianBlur. */ public void setNPasses(int nPasses) { if (gb == null) gb = new GaussianBlur(); gb.setNPasses(nPasses); } }
/** Since most computing time is spent in GaussianBlur, forward the * information about the number of passes to Gaussian Blur. The * ProgressBar will be handled by GaussianBlur. */ public void setNPasses(int nPasses) { if (gb == null) gb = new GaussianBlur(); gb.setNPasses(nPasses); } }
public static void blur(ImagePlus imp, double sigmaX, double sigmaY, double sigmaZ) { imp.deleteRoi(); ImageStack stack = imp.getStack(); if (sigmaX>0.0 || sigmaY>0.0) { GaussianBlur gb = new GaussianBlur(); int channels = stack.getProcessor(1).getNChannels(); gb.setNPasses(channels*imp.getStackSize()); for (int i=1; i<=imp.getStackSize(); i++) { ImageProcessor ip = stack.getProcessor(i); double accuracy = (imp.getBitDepth()==8||imp.getBitDepth()==24)?0.002:0.0002; gb.blurGaussian(ip, sigmaX, sigmaY, accuracy); } } if (sigmaZ>0.0) { if (imp.isHyperStack()) blurHyperStackZ(imp, sigmaZ); else blurZ(stack, sigmaZ); imp.updateAndDraw(); } }
public static void blur(ImagePlus imp, double sigmaX, double sigmaY, double sigmaZ) { imp.deleteRoi(); ImageStack stack = imp.getStack(); if (sigmaX>0.0 || sigmaY>0.0) { GaussianBlur gb = new GaussianBlur(); int channels = stack.getProcessor(1).getNChannels(); gb.setNPasses(channels*imp.getStackSize()); for (int i=1; i<=imp.getStackSize(); i++) { ImageProcessor ip = stack.getProcessor(i); double accuracy = (imp.getBitDepth()==8||imp.getBitDepth()==24)?0.002:0.0002; gb.blurGaussian(ip, sigmaX, sigmaY, accuracy); } } if (sigmaZ>0.0) { if (imp.isHyperStack()) blurHyperStackZ(imp, sigmaZ); else blurZ(stack, sigmaZ); imp.updateAndDraw(); } }