public void setBackgroundValue(double value) { record("setBackgroundValue", new Double(value), double.class); proc.setBackgroundValue(value); }
public void setBackgroundValue(double value) { record("setBackgroundValue", new Double(value), double.class); proc.setBackgroundValue(value); }
Garten() { ip = new ColorProcessor( colW * (cols+1) + 2 * xIndent, rowH * (rows+1) + 2 * yIndent); ip.setBackgroundValue((double)0); image = new ImagePlus("Progress", ip); }
public void draw(Graphics g) { Graphics2D g2d = (Graphics2D)g; double mag = getMagnification(); int sx2 = screenX(x+width); int sy2 = screenY(y+height); Composite saveComposite = null; if (composite!=null) { saveComposite = g2d.getComposite(); g2d.setComposite(composite); } Image img2 = img; if (angle!=0.0) { ImageProcessor ip = new ColorProcessor(img); ip.setInterpolate(true); ip.setBackgroundValue(0.0); ip.rotate(angle); if (zeroTransparent) ip = makeZeroTransparent(ip, true); img2 = ip.createImage(); } g.drawImage(img2, screenX(x), screenY(y), sx2, sy2, 0, 0, img.getWidth(null), img.getHeight(null), null); if (composite!=null) g2d.setComposite(saveComposite); if (isActiveOverlayRoi() && !overlay) super.draw(g); }
public void draw(Graphics g) { Graphics2D g2d = (Graphics2D)g; double mag = getMagnification(); int sx2 = screenX(x+width); int sy2 = screenY(y+height); Composite saveComposite = null; if (composite!=null) { saveComposite = g2d.getComposite(); g2d.setComposite(composite); } Image img2 = img; if (angle!=0.0) { ImageProcessor ip = new ColorProcessor(img); ip.setInterpolate(true); ip.setBackgroundValue(0.0); ip.rotate(angle); if (zeroTransparent) ip = makeZeroTransparent(ip, true); img2 = ip.createImage(); } g.drawImage(img2, screenX(x), screenY(y), sx2, sy2, 0, 0, img.getWidth(null), img.getHeight(null), null); if (composite!=null) g2d.setComposite(saveComposite); if (isActiveOverlayRoi() && !overlay) super.draw(g); }
Color bgc = Toolbar.getBackgroundColor(); if (bitDepth==8) ip.setBackgroundValue(ip.getBestIndex(bgc)); else if (bitDepth==24) ip.setBackgroundValue(bgc.getRGB()); } else ip.setBackgroundValue(0); ip.rotate(angle); if (!gd.wasOKed())
Color bgc = Toolbar.getBackgroundColor(); if (bitDepth==8) ip.setBackgroundValue(ip.getBestIndex(bgc)); else if (bitDepth==24) ip.setBackgroundValue(bgc.getRGB()); } else ip.setBackgroundValue(0); ip.rotate(angle); if (!gd.wasOKed())
/** Moves the image or selection vertically or horizontally by a specified number of pixels. Positive x values move the image or selection to the right, negative values move it to the left. Positive y values move the image or selection down, negative values move it up. */ public void translate(double xOffset, double yOffset) { ImageProcessor ip2 = this.duplicate(); ip2.setBackgroundValue(0.0); boolean integerOffsets = xOffset==(int)xOffset && yOffset==(int)yOffset; if (integerOffsets || interpolationMethod==NONE) { for (int y=roiY; y<(roiY + roiHeight); y++) { for (int x=roiX; x<(roiX + roiWidth); x++) putPixel(x, y, ip2.getPixel(x-(int)xOffset, y-(int)yOffset)); } } else { if (interpolationMethod==BICUBIC && (this instanceof ColorProcessor)) ((ColorProcessor)this).filterRGB(ColorProcessor.RGB_TRANSLATE, xOffset, yOffset); else { for (int y=roiY; y<(roiY + roiHeight); y++) { for (int x=roiX; x<(roiX + roiWidth); x++) putPixel(x, y, ip2.getPixelInterpolated(x-xOffset, y-yOffset)); } } } }
if (interpolationMethod==BICUBIC) { ip2 = new ByteProcessor(getWidth(), getHeight(), pixels2, null); ip2.setBackgroundValue(getBackgroundValue());
/** Moves the image or selection vertically or horizontally by a specified number of pixels. Positive x values move the image or selection to the right, negative values move it to the left. Positive y values move the image or selection down, negative values move it up. */ public void translate(double xOffset, double yOffset) { ImageProcessor ip2 = this.duplicate(); ip2.setBackgroundValue(0.0); boolean integerOffsets = xOffset==(int)xOffset && yOffset==(int)yOffset; if (integerOffsets || interpolationMethod==NONE) { for (int y=roiY; y<(roiY + roiHeight); y++) { for (int x=roiX; x<(roiX + roiWidth); x++) putPixel(x, y, ip2.getPixel(x-(int)xOffset, y-(int)yOffset)); } } else { if (interpolationMethod==BICUBIC && (this instanceof ColorProcessor)) ((ColorProcessor)this).filterRGB(ColorProcessor.RGB_TRANSLATE, xOffset, yOffset); else { for (int y=roiY; y<(roiY + roiHeight); y++) { for (int x=roiX; x<(roiX + roiWidth); x++) putPixel(x, y, ip2.getPixelInterpolated(x-xOffset, y-yOffset)); } } } }
ImageProcessor ip = impB.getProcessor(); ip.setInterpolationMethod(ImageProcessor.BILINEAR); ip.setBackgroundValue(0);
ImageProcessor ip = impB.getProcessor(); ip.setInterpolationMethod(ImageProcessor.BILINEAR); ip.setBackgroundValue(0);
if (interpolationMethod==BICUBIC) { ip2 = new ByteProcessor(getWidth(), getHeight(), pixels2, null); ip2.setBackgroundValue(getBackgroundValue());
bimp.setRoi(roi); ip.setValue(0); ip.setBackgroundValue(0); IJ.run(bimp, "Clear Outside", "");
void process(int command) { String s = ""; ImageProcessor ip2 = stack.getProcessor(1); switch (command) { case FLIPH: case FLIPV: s="Flip: "; break; case SCALE: s="Scale: "; break; case SCALE_WITH_FILL: s="Scale: "; ip2.setBackgroundValue(fillValue); break; case INVERT: s="Invert: "; break; case APPLY_TABLE: s="Apply: "; break; } if (ip==null) ip = ip2; ip2.setRoi(this.ip.getRoi()); ip2.setInterpolate(this.ip.getInterpolate()); for (int i=1; i<=nSlices; i++) { showStatus(s,i,nSlices); ip2.setPixels(stack.getPixels(i)); if (nSlices==1 && i==1 && command==SCALE) ip2.snapshot(); switch (command) { case FLIPH: ip2.flipHorizontal(); break; case FLIPV: ip2.flipVertical(); break; case SCALE: case SCALE_WITH_FILL: ip2.scale(xScale, yScale); break; case INVERT: ip2.invert(); break; case APPLY_TABLE: ip2.applyTable(table); break; } IJ.showProgress((double)i/nSlices); } IJ.showProgress(1.0); }
void process(int command) { String s = ""; ImageProcessor ip2 = stack.getProcessor(1); switch (command) { case FLIPH: case FLIPV: s="Flip: "; break; case SCALE: s="Scale: "; break; case SCALE_WITH_FILL: s="Scale: "; ip2.setBackgroundValue(fillValue); break; case INVERT: s="Invert: "; break; case APPLY_TABLE: s="Apply: "; break; } if (ip==null) ip = ip2; ip2.setRoi(this.ip.getRoi()); ip2.setInterpolate(this.ip.getInterpolate()); for (int i=1; i<=nSlices; i++) { showStatus(s,i,nSlices); ip2.setPixels(stack.getPixels(i)); if (nSlices==1 && i==1 && command==SCALE) ip2.snapshot(); switch (command) { case FLIPH: ip2.flipHorizontal(); break; case FLIPV: ip2.flipVertical(); break; case SCALE: case SCALE_WITH_FILL: ip2.scale(xScale, yScale); break; case INVERT: ip2.invert(); break; case APPLY_TABLE: ip2.applyTable(table); break; } IJ.showProgress((double)i/nSlices); } IJ.showProgress(1.0); }
public void processOpenButton() { // Convert to mask ImagePlus image = cc.getImage(); ImageProcessor ip = image.getProcessor(); ImageProcessor newip = new ByteProcessor( ip.getWidth(), ip.getHeight()); newip.setBackgroundValue(0); newip.setRoi(image.getRoi()); newip.setValue(255); newip.fill(newip.getMask()); // open newip.erode(); newip.dilate(); // convert back to selection newip.setThreshold(255, 255, ImageProcessor.NO_LUT_UPDATE); ImagePlus tmp = new ImagePlus(" ", newip); ThresholdToSelection ts = new ThresholdToSelection(); ts.setup("", tmp); ts.run(newip); newip.resetThreshold(); image.setRoi(tmp.getRoi()); }
public void processCloseButton() { // Convert to mask ImagePlus image = cc.getImage(); ImageProcessor ip = image.getProcessor(); ImageProcessor newip = new ByteProcessor( ip.getWidth(), ip.getHeight()); newip.setBackgroundValue(0); newip.setRoi(image.getRoi()); newip.setValue(255); newip.fill(newip.getMask()); // open newip.dilate(); newip.erode(); // convert back to selection newip.setThreshold(255, 255, ImageProcessor.NO_LUT_UPDATE); ImagePlus tmp = new ImagePlus(" ", newip); ThresholdToSelection ts = new ThresholdToSelection(); ts.setup("", tmp); ts.run(newip); newip.resetThreshold(); image.setRoi(tmp.getRoi()); }
else ip.setInterpolationMethod(ImageProcessor.NONE); ip.setBackgroundValue(bgValue); imp.startTiming(); try {
else ip.setInterpolationMethod(ImageProcessor.NONE); ip.setBackgroundValue(bgValue); imp.startTiming(); try {