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; }
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]);
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;
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);