@Override public ImageProcessor createProcessor(int width, int height) { record("createProcessor", new Object[] {new Integer(width), new Integer(height)}, new Class[] {int.class, int.class}); return proc.createProcessor(width, height); }
@Override public ImageProcessor createProcessor(int width, int height) { record("createProcessor", new Object[] {new Integer(width), new Integer(height)}, new Class[] {int.class, int.class}); return proc.createProcessor(width, height); }
final public ImageProcessor createMappedImage( final ImageProcessor source ) { Rectangle boundingBox = transform.getBoundingBox(); final ImageProcessor target = source.createProcessor( boundingBox.width, boundingBox.height ); map( source, target ); return target; }
final public ImageProcessorWithMasks createMappedMaskedImage( final ImageProcessor source, final ImageProcessor mask ) { Rectangle boundingBox = transform.getBoundingBox(); final ImageProcessor targetMask = mask == null ? null : mask.createProcessor( boundingBox.width, boundingBox.height ); final ImageProcessorWithMasks target = new ImageProcessorWithMasks( source.createProcessor( boundingBox.width, boundingBox.height ), targetMask, null ); map( new ImageProcessorWithMasks( source, mask, null ), target ); return target; }
/** Rotates the entire image 90 degrees clockwise. Returns a new ImageProcessor that represents the rotated image. */ public ImageProcessor rotateRight() { int width2 = height; int height2 = width; ImageProcessor ip2 = createProcessor(width2, height2); int[] arow = new int[width]; for (int row=0; row<height; row++) { getRow(0, row, arow, width); ip2.putColumn(width2-row-1, 0, arow, height2); } return ip2; }
final public ImageProcessorWithMasks createMappedMaskedImageInterpolated( final ImageProcessor source, final ImageProcessor mask ) { Rectangle boundingBox = transform.getBoundingBox(); final ImageProcessor targetMask = mask == null ? null : mask.createProcessor( boundingBox.width, boundingBox.height ); final ImageProcessorWithMasks target = new ImageProcessorWithMasks( source.createProcessor( boundingBox.width, boundingBox.height ), targetMask, null ); mapInterpolated( new ImageProcessorWithMasks( source, mask, null ), target ); return target; } }
/** Rotates the entire image 90 degrees clockwise. Returns a new ImageProcessor that represents the rotated image. */ public ImageProcessor rotateRight() { int width2 = height; int height2 = width; ImageProcessor ip2 = createProcessor(width2, height2); int[] arow = new int[width]; for (int row=0; row<height; row++) { getRow(0, row, arow, width); ip2.putColumn(width2-row-1, 0, arow, height2); } return ip2; }
final public ImageProcessor createInverseMappedImage( final ImageProcessor source ) { final ImageProcessor target = source.createProcessor( ( int )transform.getWidth(), ( int )transform.getHeight() ); mapInverse( source, target ); return target; }
final public ImageProcessor createInverseMappedImageInterpolated( final ImageProcessor source ) { final ImageProcessor target = source.createProcessor( ( int )transform.getWidth(), ( int )transform.getHeight() ); mapInverseInterpolated( source, target ); return target; }
final public ImageProcessor createMappedImageInterpolated( final ImageProcessor source ) { Rectangle boundingBox = transform.getBoundingBox(); final ImageProcessor target = source.createProcessor( boundingBox.width, boundingBox.height ); source.setInterpolationMethod( ImageProcessor.BILINEAR ); mapInterpolated( source, target ); return target; }
ImageProcessor createNewImage(ImageProcessor ip1, ImageProcessor ip2) { int width = Math.min(ip1.getWidth(), ip2.getWidth()); int height = Math.min(ip1.getHeight(), ip2.getHeight()); ImageProcessor ip3 = ip1.createProcessor(width, height); if (floatResult) { ip1 = ip1.convertToFloat(); ip3 = ip3.convertToFloat(); } ip3.insert(ip1, 0, 0); return ip3; }
ImageProcessor createNewImage(ImageProcessor ip1, ImageProcessor ip2) { int width = Math.min(ip1.getWidth(), ip2.getWidth()); int height = Math.min(ip1.getHeight(), ip2.getHeight()); ImageProcessor ip3 = ip1.createProcessor(width, height); if (floatResult) { ip1 = ip1.convertToFloat(); ip3 = ip3.convertToFloat(); } ip3.insert(ip1, 0, 0); return ip3; }
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" ); }
ImageProcessor createNewImage(ImageProcessor ip1, ImageProcessor ip2) { int width = Math.min(ip1.getWidth(), ip2.getWidth()); int height = Math.min(ip1.getHeight(), ip2.getHeight()); ImageProcessor ip3 = ip1.createProcessor(width, height); if (floatResult) { ip1 = ip1.convertToFloat(); ip3 = ip3.convertToFloat(); } ip3.insert(ip1, 0, 0); return ip3; }
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 ImageProcessor expandImage(ImageProcessor ipOld, int wNew, int hNew, int xOff, int yOff) { ImageProcessor ipNew = ipOld.createProcessor(wNew, hNew); if (zeroFill) ipNew.setValue(0.0); else ipNew.setColor(Toolbar.getBackgroundColor()); ipNew.fill(); ipNew.insert(ipOld, xOff, yOff); return ipNew; }
public ImageProcessor expandImage(ImageProcessor ipOld, int wNew, int hNew, int xOff, int yOff) { ImageProcessor ipNew = ipOld.createProcessor(wNew, hNew); if (zeroFill) ipNew.setValue(0.0); else ipNew.setColor(Toolbar.getBackgroundColor()); ipNew.fill(); ipNew.insert(ipOld, xOff, yOff); return ipNew; }
ImageProcessor expand(ImageProcessor ip, boolean hasEdgePixels) { if (hasEdgePixels) { ImageProcessor ip2 = ip.createProcessor(ip.getWidth()+2, ip.getHeight()+2); if (foreground==0) { ip2.setColor(255); ip2.fill(); } ip2.insert(ip, 1, 1); //new ImagePlus("ip2", ip2).show(); return ip2; } else return ip; }
ImageProcessor expand(ImageProcessor ip, boolean hasEdgePixels) { if (hasEdgePixels) { ImageProcessor ip2 = ip.createProcessor(ip.getWidth()+2, ip.getHeight()+2); if (foreground==0) { ip2.setColor(255); ip2.fill(); } ip2.insert(ip, 1, 1); //new ImagePlus("ip2", ip2).show(); return ip2; } else return ip; }
public static void addFrames(ImagePlus imp, int slice, int num) { ImageStack stack = imp.getStack(); int w = imp.getWidth(), h = imp.getHeight(); ImageProcessor frame = stack.getProcessor(slice). createProcessor(w, h); frame.setValue(0); frame.fill(); for(int n = 0; n < num; n++) stack.addSlice("", frame, slice + n); // causes the change from image window to stack window imp.setStack(null, stack); } }