public void snapshot() { record("snapshot"); proc.snapshot(); }
public void snapshot() { record("snapshot"); proc.snapshot(); }
/** Gaussian Filtering of an ImageProcessor. This method is for compatibility with the * previous code (before 1.38r) and uses a low-accuracy kernel, only slightly better * than the previous ImageJ code. * The 'radius' in this call is different from the one used in ImageJ 1.38r and later. * Therefore, use blurGaussian(ip, sigma, sigma, accuracy), where 'sigma' is equivalent * to the 'sigma (radius)' of the Menu, and accuracy should be 0.02 unless better * accuracy is desired. */ @Deprecated public boolean blur(ImageProcessor ip, double radius) { Rectangle roi = ip.getRoi(); if (roi.height!=ip.getHeight() && ip.getMask()==null) ip.snapshot(); // a snapshot is needed for out-of-Rectangle pixels blurGaussian(ip, 0.4*radius, 0.4*radius, 0.01); return true; }
void applyTable(ImageProcessor ip, int[] lut) { if (updateSelectionOnly) { ImageProcessor mask = ip.getMask(); if (mask!=null) ip.snapshot(); ip.applyTable(lut); if (mask!=null) ip.reset(mask); } else ip.applyTable(lut); }
/** Gaussian Filtering of an ImageProcessor. This method is for compatibility with the * previous code (before 1.38r) and uses a low-accuracy kernel, only slightly better * than the previous ImageJ code. * The 'radius' in this call is different from the one used in ImageJ 1.38r and later. * Therefore, use blurGaussian(ip, sigma, sigma, accuracy), where 'sigma' is equivalent * to the 'sigma (radius)' of the Menu, and accuracy should be 0.02 unless better * accuracy is desired. */ @Deprecated public boolean blur(ImageProcessor ip, double radius) { Rectangle roi = ip.getRoi(); if (roi.height!=ip.getHeight() && ip.getMask()==null) ip.snapshot(); // a snapshot is needed for out-of-Rectangle pixels blurGaussian(ip, 0.4*radius, 0.4*radius, 0.01); return true; }
public MappingThread( final ImageStack source, final ImageProcessor target, final boolean interpolate ) { this.source = source; this.target = target; this.temp = target.createProcessor( target.getWidth(), target.getHeight() ); temp.snapshot(); this.interpolate = interpolate; this.setName( "MappingThread" ); }
public MappingThread( final ImageStack source, final ImageProcessor target, final boolean interpolate ) { this.source = source; this.target = target; this.temp = target.createProcessor( target.getWidth(), target.getHeight() ); temp.snapshot(); this.interpolate = interpolate; this.setName( "MappingThread" ); }
void applyTable(ImageProcessor ip, int[] lut) { if (updateSelectionOnly) { ImageProcessor mask = ip.getMask(); if (mask!=null) ip.snapshot(); ip.applyTable(lut); if (mask!=null) ip.reset(mask); } else ip.applyTable(lut); }
public void startPaste(ImagePlus clipboard) { IJ.showStatus("Pasting..."); IJ.wait(10); this.clipboard = clipboard; imp.getProcessor().snapshot(); updateClipRect(); imp.draw(clipX, clipY, clipWidth, clipHeight); }
public void startPaste(ImagePlus clipboard) { IJ.showStatus("Pasting..."); IJ.wait(10); this.clipboard = clipboard; imp.getProcessor().snapshot(); updateClipRect(); imp.draw(clipX, clipY, clipWidth, clipHeight); }
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(); }
public void mouseReleased(MouseEvent e) { super.mouseReleased(e); Roi roi = imp.getRoi(); if (roi!=null && roi.getType()==Roi.LINE) { Undo.setup(Undo.FILTER, imp); imp.getProcessor().snapshot(); roi.drawPixels(); imp.updateAndDraw(); imp.deleteRoi(); } }
public void mouseReleased(MouseEvent e) { super.mouseReleased(e); Roi roi = imp.getRoi(); if (roi!=null && roi.getType()==Roi.LINE) { Undo.setup(Undo.FILTER, imp); imp.getProcessor().snapshot(); roi.drawPixels(); imp.updateAndDraw(); imp.deleteRoi(); } }
@Override final protected void init() { window.addMouseWheelListener( this ); final ImageProcessor ip = imp.getProcessor(); min = ip.getMin(); max = ip.getMax(); ip.snapshot(); if ( imp.getType() == ImagePlus.GRAY32 ) ip.setMinAndMax( ( min - max ) / 2.0, ( max - min ) / 2.0 ); else if ( imp.getType() == ImagePlus.GRAY16 ) ip.setMinAndMax( 32767 - ( max - min ) / 2.0, 32767 + ( max - min ) / 2.0 ); dom = DifferenceOfMean.create( ip ); dp = -1 * dpScale; }
@Override final protected void init() { window.addMouseWheelListener( this ); final ImageProcessor ip = imp.getProcessor(); min = ip.getMin(); max = ip.getMax(); ip.snapshot(); if ( imp.getType() == ImagePlus.GRAY32 ) ip.setMinAndMax( ( min - max ) / 2.0, ( max - min ) / 2.0 ); else if ( imp.getType() == ImagePlus.GRAY16 ) ip.setMinAndMax( 32767 - ( max - min ) / 2.0, 32767 + ( max - min ) / 2.0 ); dom = DifferenceOfMean.create( ip ); dp = -1 * dpScale; }
/** * Handles a histogram the following way: create snapshot, log data, reset the * display range, apply the Fire LUT and finally store it as an iText PDF image. * Afterwards the image is reset to its orignal state again */ @Override public void handleHistogram(Histogram2D<T> histogram, String name) { RandomAccessibleInterval<LongType> image = histogram.getPlotImage(); ImagePlus imp = ImageJFunctions.wrapFloat( image, name ); // make a snapshot to be able to reset after modifications imp.getProcessor().snapshot(); imp.getProcessor().log(); imp.updateAndDraw(); imp.getProcessor().resetMinAndMax(); IJ.run(imp,"Fire", null); addImageToList(imp, name); // reset the imp from the log scaling we applied earlier imp.getProcessor().reset(); }
@Override public void run( final String arg ) { ij = IJ.getInstance(); imp = IJ.getImage(); window = imp.getWindow(); canvas = imp.getCanvas(); canvas.addKeyListener( this ); window.addKeyListener( this ); canvas.addMouseMotionListener( this ); canvas.addMouseListener( this ); ij.addKeyListener( this ); init(); imp.getProcessor().snapshot(); Toolbar.getInstance().setTool( Toolbar.LINE ); painter = new PaintThread(); painter.start(); }
@Override public void run( String arg ) { ij = IJ.getInstance(); imp = IJ.getImage(); window = imp.getWindow(); canvas = imp.getCanvas(); canvas.addKeyListener( this ); window.addKeyListener( this ); canvas.addMouseMotionListener( this ); canvas.addMouseListener( this ); ij.addKeyListener( this ); init(); imp.getProcessor().snapshot(); Toolbar.getInstance().setTool( Toolbar.RECTANGLE ); painter = new PaintThread(); painter.start(); }
@Override public void run( String arg ) { ij = IJ.getInstance(); imp = IJ.getImage(); window = imp.getWindow(); canvas = imp.getCanvas(); canvas.addKeyListener( this ); window.addKeyListener( this ); canvas.addMouseMotionListener( this ); canvas.addMouseListener( this ); ij.addKeyListener( this ); init(); imp.getProcessor().snapshot(); Toolbar.getInstance().setTool( Toolbar.RECTANGLE ); painter = new PaintThread(); painter.start(); }
@Override public void run( final String arg ) { ij = IJ.getInstance(); imp = IJ.getImage(); window = imp.getWindow(); canvas = imp.getCanvas(); canvas.addKeyListener( this ); window.addKeyListener( this ); canvas.addMouseMotionListener( this ); canvas.addMouseListener( this ); ij.addKeyListener( this ); init(); imp.getProcessor().snapshot(); Toolbar.getInstance().setTool( Toolbar.LINE ); painter = new PaintThread(); painter.start(); }