/** Displays a histogram using the specified title, number of bins, histogram range and yMax. */ public HistogramWindow(String title, ImagePlus imp, int bins, double histMin, double histMax, int yMax) { super(NewImage.createRGBImage(title, WIN_WIDTH, WIN_HEIGHT, 1, NewImage.FILL_WHITE)); this.yMax = yMax; showHistogram(imp, bins, histMin, histMax); }
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; }
/** Creates a new image. * @param title image name * @param width image width in pixels * @param height image height in pixels * @param depth number of stack images * @param bitdepth 8, 16, 32 (float) or 24 (RGB) */ public static ImagePlus createImage(String title, int width, int height, int depth, int bitdepth) { return NewImage.createImage(title, width, height, depth, bitdepth, NewImage.FILL_BLACK); }
store_ip=store.getProcessor(); } else {store=NewImage.createShortImage("Storage",50,50,1,NewImage.FILL_BLACK); store_ip=store.getProcessor(); store.show(); } else { overlay = NewImage.createRGBImage("Overlay image", w,h,1, NewImage.FILL_BLACK); inv_ip = overlay.getProcessor(); int bd=imp.getBitDepth();
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); }
/** * @deprecated * Short images are always unsigned. */ public static ImagePlus createUnsignedShortImage(String title, int width, int height, int slices, int options) { return createShortImage(title, width, height, slices, options); }
BGR[channel][i]=in[i]; imBGR[channel]= NewImage.createFloatImage(""+channel, width, height, 1, NewImage.FILL_BLACK); imProcBGR[channel]= imBGR[channel].getProcessor(); imProcBGR[channel].setPixels(BGR[channel]);
/** 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); }
/** * @deprecated * Short images are always unsigned. */ public static ImagePlus createUnsignedShortImage(String title, int width, int height, int slices, int options) { return createShortImage(title, width, height, slices, options); }
final ImagePlus imp = ij.gui.NewImage.createFloatImage( "Point", 128, 128, 32, ij.gui.NewImage.FILL_BLACK ); final float[] px = ( float[] ) imp.getStack().getPixels( 16 ); px[ 128 * 128 / 2 + 64 ] = 1e3f;
/** Displays a histogram using the specified title, number of bins and histogram range. Currently, the number of bins must be 256 and the histogram range range must be the same as the image range expect for 32 bit images. */ public HistogramWindow(String title, ImagePlus imp, int bins, double histMin, double histMax) { super(NewImage.createRGBImage(title, WIN_WIDTH, WIN_HEIGHT, 1, NewImage.FILL_WHITE)); showHistogram(imp, bins, histMin, histMax); }
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(); }
/** Creates a new image. * @param title image name * @param width image width in pixels * @param height image height in pixels * @param depth number of stack images * @param bitdepth 8, 16, 32 (float) or 24 (RGB) */ public static ImagePlus createImage(String title, int width, int height, int depth, int bitdepth) { return NewImage.createImage(title, width, height, depth, bitdepth, NewImage.FILL_BLACK); }
ImagePlus impLine = NewImage.createShortImage("imLine",sizeTemp,sizeTemp,1,NewImage.FILL_BLACK); ImageProcessor ipLine = impLine.getProcessor(); double rotationAngle = 180/nAngles; ImagePlus impLineRotated = NewImage.createShortImage("imLineRot",sizeTemp, sizeTemp ,1,NewImage.FILL_BLACK); ImageProcessor ipLineRotated = impLineRotated.getProcessor();
ImagePlus heightMap = NewImage.createFloatImage("HM_" + stackTitle, stack.getWidth(), stack.getHeight(), numChannelsToDo * Dimensions[4], NewImage.FILL_BLACK); ImageStack heightMapStack = heightMap.getStack(); heightMap.setCalibration(myCal); heightMap.setDimensions(numChannelsToDo, 1, Dimensions[4]); ImagePlus qrMap = NewImage.createFloatImage("QR_" + stackTitle, stack.getWidth(), stack.getHeight(), numChannelsToDo * Dimensions[4], NewImage.FILL_BLACK); ImageStack qrMapStack = qrMap.getStack(); qrMap.setCalibration(myCal); qrMap.setDimensions(numChannelsToDo, 1, Dimensions[4]); ImagePlus qrSharpness = NewImage.createFloatImage("QRS_" + stackTitle, stack.getWidth(), stack.getHeight(), numChannelsToDo * Dimensions[4], NewImage.FILL_BLACK); ImageStack qrSharpnessStack = qrSharpness.getStack(); qrSharpness.setCalibration(myCal);
/** Displays a histogram using the specified title and ImageStatistics. */ public HistogramWindow(String title, ImagePlus imp, ImageStatistics stats) { super(NewImage.createRGBImage(title, WIN_WIDTH, WIN_HEIGHT, 1, NewImage.FILL_WHITE)); //IJ.log("HistogramWindow: "+stats.histMin+" "+stats.histMax+" "+stats.nBins); this.yMax = stats.histYMax; showHistogram(imp, stats); }
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; }
/** Creates a new imagePlus. <code>Type</code> should contain "8-bit", "16-bit", "32-bit" or "RGB". In addition, it can contain "white", "black" or "ramp". <code>Width</code> and <code>height</code> specify the width and height of the image in pixels. <code>Depth</code> specifies the number of stack slices. */ public static ImagePlus createImage(String title, String type, int width, int height, int depth) { type = type.toLowerCase(Locale.US); int bitDepth = 8; if (type.contains("16")) bitDepth = 16; if (type.contains("24")||type.contains("rgb")) bitDepth = 24; if (type.contains("32")) bitDepth = 32; int options = NewImage.FILL_WHITE; if (bitDepth==16 || bitDepth==32) options = NewImage.FILL_BLACK; if (type.contains("white")) options = NewImage.FILL_WHITE; else if (type.contains("black")) options = NewImage.FILL_BLACK; else if (type.contains("ramp")) options = NewImage.FILL_RAMP; else if (type.contains("noise") || type.contains("random")) options = NewImage.FILL_NOISE; options += NewImage.CHECK_AVAILABLE_MEMORY; return NewImage.createImage(title, width, height, depth, bitDepth, options); }
ImagePlus impLine = NewImage.createShortImage("imLine",sizeTemp,sizeTemp,1,NewImage.FILL_BLACK); ImageProcessor ipLine = impLine.getProcessor(); double rotationAngle = 180/nAngles; ImagePlus impLineRotated = NewImage.createShortImage("imLineRot",sizeTemp, sizeTemp ,1,NewImage.FILL_BLACK); ImageProcessor ipLineRotated = impLineRotated.getProcessor();