@Override public ImageProcessor process(ImageProcessor ip) { ip.resetMinAndMax(); return ip; }
public int setup(String arg, ImagePlus imp) { if (arg.equals("final")) { imp.getProcessor().resetMinAndMax(); return DONE; } else return flags; }
public static void ArrayToFloatProcessor(ImageProcessor ip, double[] pixels, int width, int height) { float[] data = new float[width * height]; int count = 0; for (int y = 0; y < height; y++) for (int x = 0; x < width; x++) data[count] = (float)pixels[count++]; ip.setPixels(data); ip.resetMinAndMax(); }
public static void ArrayToFloatProcessor(ImageProcessor ip, float[] pixels, int width, int height) { float[] data = new float[width * height]; int count = 0; for (int y = 0; y < height; y++) for (int x = 0; x < width; x++) data[count] = (float)pixels[count++]; ip.setPixels(data); ip.resetMinAndMax(); }
public static void FloatArrayToFloatProcessor(ImageProcessor ip, FloatArray2D pixels) { float[] data = new float[pixels.width * pixels.height]; int count = 0; for (int y = 0; y < pixels.height; y++) for (int x = 0; x < pixels.width; x++) data[count] = pixels.data[count++]; ip.setPixels(data); ip.resetMinAndMax(); }
public int setup(String arg, ImagePlus imp) { if (arg.equals("final")) { imp.getProcessor().resetMinAndMax(); return DONE; } else return flags; }
/** Background for any image type */ public void run(ImageProcessor ip) { if (isRGB && !separateColors) rollingBallBrightnessBackground((ColorProcessor)ip, radius, createBackground, lightBackground, useParaboloid, doPresmooth, true); else rollingBallBackground(ip, radius, createBackground, lightBackground, useParaboloid, doPresmooth, true); if (previewing && (ip instanceof FloatProcessor || ip instanceof ShortProcessor)) { ip.resetMinAndMax(); } }
/** Converts a binary image into a 8-bit grayscale Euclidean Distance Map * (EDM). Each foreground (nonzero) pixel in the binary image is * assigned a value equal to its distance from the nearest * background (zero) pixel. */ public void toEDM (ImageProcessor ip) { ip.setPixels(0, makeFloatEDM(ip, 0, false)); ip.resetMinAndMax(); }
private void save16BitImage(ImageProcessor ip, String path) { ip.resetMinAndMax(); int max = (int)ip.getMax(); if (max<256) max=256; try { DataOutputStream output = new DataOutputStream(new BufferedOutputStream(new FileOutputStream(path))); output.writeBytes("P5\n# Written by ImageJ PNM Writer\n" + ip.getWidth() + " " + ip.getHeight() + "\n"+max+"\n"); for (int i=0; i<ip.getPixelCount(); i++) output.writeShort(ip.get(i)); output.close(); } catch(IOException e) { IJ.handleException(e); } }
/** Converts a binary image into a 8-bit grayscale Euclidean Distance Map * (ImageJ_EDM). Each foreground (nonzero) pixel in the binary image is * assigned a value equal to its distance from the nearest * background (zero) pixel. */ public void toEDM (ImageProcessor ip) { ip.setPixels(0, makeFloatEDM(ip, 0, false)); ip.resetMinAndMax(); }
/** Converts a binary image into a 8-bit grayscale Euclidean Distance Map * (EDM). Each foreground (nonzero) pixel in the binary image is * assigned a value equal to its distance from the nearest * background (zero) pixel. */ public void toEDM (ImageProcessor ip) { ip.setPixels(0, makeFloatEDM(ip, 0, false)); ip.resetMinAndMax(); }
/** Background for any image type */ public void run(ImageProcessor ip) { if (isRGB && !separateColors) rollingBallBrightnessBackground((ColorProcessor)ip, radius, createBackground, lightBackground, useParaboloid, doPresmooth, true); else rollingBallBackground(ip, radius, createBackground, lightBackground, useParaboloid, doPresmooth, true); if (previewing && (ip instanceof FloatProcessor || ip instanceof ShortProcessor)) { ip.resetMinAndMax(); } }
public void resetDisplayRange() { if (imageType==GRAY16 && default16bitDisplayRange>=8 && default16bitDisplayRange<=16 && !(getCalibration().isSigned16Bit())) ip.setMinAndMax(0, Math.pow(2,default16bitDisplayRange)-1); else ip.resetMinAndMax(); }
public void resetDisplayRange() { if (imageType==GRAY16 && default16bitDisplayRange>=8 && default16bitDisplayRange<=16 && !(getCalibration().isSigned16Bit())) ip.setMinAndMax(0, Math.pow(2,default16bitDisplayRange)-1); else ip.resetMinAndMax(); }
private void resetMinAndMax(ImageProcessor ip) { if (ip.getBitDepth()!=8 && (!noReset || mode==OVER_UNDER)) { ImageStatistics stats = ip.getStats(); if (ip.getMin()!=stats.min || ip.getMax()!=stats.max) { ip.resetMinAndMax(); ContrastAdjuster.update(); } else ip.resetMinAndMax(); } }
private void resetMinAndMax(ImageProcessor ip) { if (ip.getBitDepth()!=8 && (!noReset || mode==OVER_UNDER)) { ImageStatistics stats = ip.getStats(); if (ip.getMin()!=stats.min || ip.getMax()!=stats.max) { ip.resetMinAndMax(); ContrastAdjuster.update(); } else ip.resetMinAndMax(); } }
protected void toggleLogarithmic(boolean enabled) { if (imp == null) return; ImageProcessor ip = imp.getProcessor(); if (enabled) { ip.snapshot(); ip.log(); ip.resetMinAndMax(); } else ip.reset(); imagePanel.repaint(); }
private void applyMacro(ImageProcessor ip) { if (macro2==null) return; macro = macro2; ip.setSliceNumber(pfr.getSliceNumber()); boolean showProgress = pfr.getSliceNumber()==1 && !Interpreter.isBatchMode(); applyMacro(ip, macro, showProgress); if (pfr.getSliceNumber()==1) ip.resetMinAndMax(); }
private void applyMacro(ImageProcessor ip) { if (macro2==null) return; macro = macro2; ip.setSliceNumber(pfr.getSliceNumber()); boolean showProgress = pfr.getSliceNumber()==1 && !Interpreter.isBatchMode(); applyMacro(ip, macro, showProgress); if (pfr.getSliceNumber()==1) ip.resetMinAndMax(); }
PatchIntensityRange( final Patch patch ) { this.patch = patch; a = patch.getMax() - patch.getMin(); final ImageProcessor ip = patch.getImageProcessor(); ip.resetMinAndMax(); min = ( ip.getMin() - patch.getMin() ) / a; max = ( ip.getMax() - patch.getMin() ) / a; ip.setMinAndMax( patch.getMin(), patch.getMax() ); } }