/** Returns an 8-bit version of this image as a ByteProcessor. 16-bit and 32-bit * pixel data are scaled from min-max to 0-255. */ public ByteProcessor convertToByteProcessor() { return convertToByteProcessor(true); }
/** Returns an 8-bit version of this image as a ByteProcessor. 16-bit and 32-bit * pixel data are scaled from min-max to 0-255. */ public ByteProcessor convertToByteProcessor() { return convertToByteProcessor(true); }
/** * Applies an overlay of a binary image mask onto a grayscale or color * image, using the specified color. Both images must have the same size. * * @param refImage * the original image used as background * @param mask * the binary mask image * @param color * the color used to display overlay * @return a new ImagePlus instance containing a 2D color image */ public final static ImageProcessor binaryOverlay(ImageProcessor refImage, ImageProcessor mask, Color color) { if (refImage instanceof ColorProcessor) { return binaryOverlayRGB(refImage, mask, color); } else { if (!(refImage instanceof ByteProcessor)) { refImage = refImage.convertToByteProcessor(); } return binaryOverlayGray8(refImage, mask, color); } }
return new ImageData( pai.target.convertToByteProcessor(true), pai.getMask(), 1.0, 1.0 ); pai.target.resize( s_width, s_height ).convertToByteProcessor(true), alpha, 1/K,
final ArrayImg< UnsignedByteType, ByteArray > image2 = ArrayImgs.unsignedBytes( ( byte[] )imp1.getProcessor().convertToByteProcessor().getPixels(), imp1.getWidth(), imp1.getHeight() ); final ArrayImg< UnsignedShortType, ShortArray > image3 = ArrayImgs.unsignedShorts( ( short[] )imp1.getProcessor().convertToShortProcessor().getPixels(), imp1.getWidth(), imp1.getHeight() ); final ArrayImg< ARGBType, IntArray > image4 = ArrayImgs.argbs( ( int[] )imp1.getProcessor().getPixels(), imp1.getWidth(), imp1.getHeight() );