public ShowHistogram(long[] histogram, int histMin) { super(NewImage.createByteImage("Histogram", WIN_WIDTH, WIN_HEIGHT, 1, NewImage.FILL_WHITE)); this.histogram = new double[histogram.length]; for(int i=0;i<histogram.length;i++) this.histogram[i] = histogram[i]; this.histMin = histMin; this.binSize = 1; showHistogram(0.0, 0.0); }
/** Displays a histogram using the title "Histogram of ImageName". */ public ShowHistogram(double[] histogram, double histMin, double binSize) { super(NewImage.createByteImage("Histogram", WIN_WIDTH, WIN_HEIGHT, 1, NewImage.FILL_WHITE)); this.histogram = histogram; this.histMin = histMin; this.binSize = binSize; showHistogram(0.0, 0.0); }
public static ImagePlus createImage(String title, int width, int height, int nSlices, int bitDepth, int options) { ImagePlus imp = null; switch (bitDepth) { case 8: imp = createByteImage(title, width, height, nSlices, options); break; case 16: imp = createShortImage(title, width, height, nSlices, options); break; case 32: imp = createFloatImage(title, width, height, nSlices, options); break; case 24: imp = createRGBImage(title, width, height, nSlices, options); break; default: throw new IllegalArgumentException("Invalid bitDepth: "+bitDepth); } return imp; }
public static ImagePlus createImage(String title, int width, int height, int nSlices, int bitDepth, int options) { ImagePlus imp = null; switch (bitDepth) { case 8: imp = createByteImage(title, width, height, nSlices, options); break; case 16: imp = createShortImage(title, width, height, nSlices, options); break; case 32: imp = createFloatImage(title, width, height, nSlices, options); break; case 24: imp = createRGBImage(title, width, height, nSlices, options); break; default: throw new IllegalArgumentException("Invalid bitDepth: "+bitDepth); } return imp; }
void createHistogramImage(String title) { if (title == null) title = "Histogram Plot"; hist_img = NewImage.createByteImage(title,width,height,1,0); ip = hist_img.getProcessor(); ip.setValue(BACKGROUND); ip.fill(); }
public static ImagePlus generateBlobImage(Blob b){ Rectangle r = b.getOuterContour().getBounds(); r.setBounds(r.x, r.y, (int)r.getWidth()+1, (int)r.getHeight()+1); ImagePlus help = NewImage.createByteImage("", r.width+2, r.height+2, 1, NewImage.FILL_WHITE); ImageProcessor ip = help.getProcessor(); b.draw(ip, Blob.DRAW_HOLES, -(r.x-1), -(r.y-1)); help.setProcessor(ip); return help; }
private ImagePlus duplicateImage(ImageProcessor iProcessor){ int w=iProcessor.getWidth(); int h=iProcessor.getHeight(); ImagePlus iPlus=NewImage.createByteImage("Image", w, h, 1, NewImage.FILL_BLACK); ImageProcessor imageProcessor=iPlus.getProcessor(); imageProcessor.copyBits(iProcessor, 0,0, Blitter.COPY); return iPlus; }
private void fitEllipse(){ if(fittedEllipse==null){ fittedEllipse = new EllipseFitter(); Rectangle r = outerContour.getBounds(); ImagePlus help = NewImage.createByteImage("", r.width+1, r.height+1, 1, NewImage.FILL_WHITE); ByteProcessor ip = (ByteProcessor) help.getProcessor(); ip.setColor(Color.black); Polygon p = new Polygon(outerContour.xpoints, outerContour.ypoints, outerContour.npoints); p.translate(-r.x, -r.y); ip.resetRoi(); ip.setRoi(p); fittedEllipse.fit(ip, null); } }
final ImagePlus imp = NewImage.createByteImage("Noise", 200, 200, nFrames, NewImage.FILL_BLACK);
int h=ip.getHeight(); ImagePlus overlay = NewImage.createByteImage("Difference Image", w,h,numStacks-numDiff, NewImage.FILL_BLACK); ImageProcessor over_ip = overlay.getProcessor(); for (int i =1;i<=numStacks-numDiff;i++){