/** Returns the ResultsTable used by the Measure command. This table must be displayed in the "Results" window. */ public static ResultsTable getResultsTable() { return Analyzer.getResultsTable(); }
/** Filters an image by any method except 'despecle' or 'remove outliers'. * @param ip The ImageProcessor that should be filtered (all 4 types supported) * @param radius Determines the kernel size, see Process>Filters>Show Circular Masks. * Must not be negative. No checking is done for large values that would * lead to excessive computing times. * @param filterType May be MEAN, MIN, MAX, VARIANCE, or MEDIAN. */ public void rank(ImageProcessor ip, double radius, int filterType) { rank(ip, radius, filterType, 0, 50f); }
/** Depracated. For compatibility with previous ImageJ versions */ public void subtractRGBBackround(ColorProcessor ip, int ballRadius) { rollingBallBrightnessBackground(ip, (double)ballRadius, false, lightBackground, false, true, true); } /** Depracated. For compatibility with previous ImageJ versions */
/** 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); } }
@Override public ImageProcessor process(ImageProcessor ip) { RankFilters rf = new RankFilters(); rf.rank(ip, radius, RankFilters.MEDIAN); return ip; }
/** Gaussian Filtering of an ImageProcessor * @param ip The ImageProcessor to be filtered. * @param sigma Standard deviation of the Gaussian (pixels) * * @see ij.process.ImageProcessor#blurGaussian(double) */ public void blurGaussian(ImageProcessor ip, double sigma) { double accuracy = (ip instanceof ByteProcessor||ip instanceof ColorProcessor)?0.002:0.0002; blurGaussian(ip, sigma, sigma, accuracy); }
private void init() { int p = Analyzer.getPrecision(); if (p>precision) precision = (short)p; for (int i=0; i<decimalPlaces.length; i++) decimalPlaces[i] = AUTO_FORMAT; }
/** Converts a y-coordinate in pixels to physical units (e.g. mm), taking into account the invertY and global "Invert Y Coordinates" flags. */ public double getY(double y, int imageHeight) { if (invertY || (Analyzer.getMeasurements()&Measurements.INVERT_Y)!=0) { if (yOrigin!=0.0) return (yOrigin-y)*pixelHeight; else return (imageHeight-y-1)*pixelHeight; } else return (y-yOrigin)*pixelHeight; }
/** Do watershed segmentation based on the EDM of the * foreground objects (nonzero pixels) in an 8-bit image. * Particles are segmented by their shape; segmentation * lines added are background pixels (value = 0); */ public void toWatershed (ImageProcessor ip) { FloatProcessor floatEdm = makeFloatEDM(ip, 0, false); ByteProcessor maxIp = maxFinder.findMaxima(floatEdm, MAXFINDER_TOLERANCE, ImageProcessor.NO_THRESHOLD, MaximumFinder.SEGMENTED, false, true); if (maxIp != null) ip.copyBits(maxIp, 0, 0, Blitter.AND); }
private int[] makeCachePointers(int[] lineRadii, int cacheWidth) { int kRadius = kRadius(lineRadii); int kHeight = kHeight(lineRadii); int[] cachePointers = new int[2*kHeight]; for (int i=0; i<kHeight; i++) { cachePointers[2*i] = i*cacheWidth+kRadius + lineRadii[2*i]; cachePointers[2*i+1] = i*cacheWidth+kRadius + lineRadii[2*i+1]; } return cachePointers; }
/** Adds point x, y at the end of the list */ public void append(int x, int y) { if (last-first>=2 && collinear(this.x[last-2], this.y[last-2], this.x[last-1], this.y[last-1], x , y)) { this.x[last-1] = x; //replace previous point this.y[last-1] = y; } else { needs(0, 1); //new point this.x[last] = x; this.y[last] = y; last++; } }
public static int[] findMinima(double[] xx, double tolerance, int edgeMode) { int len = xx.length; double[] negArr = new double[len]; for (int jj = 0; jj < len; jj++) negArr[jj] = -xx[jj]; int[] minPositions = findMaxima(negArr, tolerance, edgeMode); return minPositions; }
/** Convolves the image <code>ip</code> with a kernel of width <code>kw</code> and height <code>kh</code>. */ public void convolveFloat1D(FloatProcessor ip, float[] kernel, int kw, int kh) { convolveFloat1D(ip, kernel, kw, kh, normalize?getScale(kernel):1.0); }
void drawLabel(ImageProcessor ip) { int count = Analyzer.getCounter(); if (count>0 && roi!=null) drawLabel(imp, ip, count, roi.getBounds()); }
/** This method is invoked for each slice or color channel. It filters * an image by enhancing high-frequency components. Since this * PlugInFilter specifies the CONVERT_TO_FLOAT and SNAPHOT * flags, 'ip' is always a FloatProcessor with a valid snapshot. * @param ip The image, slice or channel to filter */ public void run(ImageProcessor ip) { sharpenFloat((FloatProcessor)ip, sigma, (float)weight); }
/** Prepare the progress bar. * Without calling it or if nPasses=0, no progress bar will be shown. * @param nPasses Number of images that this EDM will process. */ public void setNPasses (int nPasses) { this.nPasses = nPasses; progressDone = 0; if (USES_MAX_FINDER[processType]) maxFinder.setNPasses(nPasses); }
/** * Returns minimum positions of array xx, sorted with decreasing strength */ public static int[] findMinima(double[] xx, double tolerance, boolean excludeEdges ) { int edgeMode = (excludeEdges) ? 1 : 0; return findMinima(xx, tolerance, edgeMode); }
LutWindow(ImagePlus imp, ImageCanvas ic, ImageProcessor ip) { super(imp, ic); this.ip = ip; addPanel(); }
public String getTitle() { if (title==null && this==Analyzer.getResultsTable()) title = "Results"; return title; }
/** Converts a y-coodinate in physical units to pixels, taking into account the 'invertY' flag. */ public double getRawY(double y, int imageHeight) { if (invertY || (Analyzer.getMeasurements()&Measurements.INVERT_Y)!=0) { if (yOrigin!=0.0) return yOrigin-y/pixelHeight; else return imageHeight -y/pixelHeight - 1; } else return y/pixelHeight + yOrigin; }