Package ij

Examples of ij.ImagePlus


            }
            MedianCut mc =
                    new MedianCut((int[]) ip.getPixels(), ip.getWidth(), ip
                            .getHeight());
            ip = mc.convertToByte(256);
            ImagePlus imp = new ImagePlus("temp", ip);
            FileInfo fi = imp.getFileInfo();
            byte pixels[] = (byte[]) imp.getProcessor().getPixels();
            GifEncoder ge =
                    new GifEncoder(fi.width,
                                   fi.height,
                                   pixels,
                                   fi.reds,
View Full Code Here


     * @param aImage A BufferedImage instance to be serialized
     * @param aOutStream OutputStream to output the image to
     * @throws FormatIOException
     */
    public void write(BufferedImage aImage, OutputStream aOutStream) throws FormatIOException {
        ImagePlus imagePlus = new ImagePlus("tempTif", aImage);
        TiffEncoder encoder = new TiffEncoder(imagePlus.getFileInfo());
        BufferedOutputStream bufStream = new BufferedOutputStream(aOutStream);
        DataOutputStream out = new DataOutputStream(bufStream);

        try {
            encoder.write(out);
View Full Code Here

     */
    public BufferedImage open(InputStream input) throws FormatIOException {
        Opener o = new Opener();
        BufferedImage bi = null;
        // Most of the time we're dealing with TIF so try direct
        ImagePlus imp = o.openTiff(input, "tif");

        // Otherwise, we'll just stay in ImageJ but just provide a file path
        if (imp == null) {
            if (LOGGER.isInfoEnabled()) {
                LOGGER.info("Creating temp image");
View Full Code Here

     * @param input absolute file path for image file
     * @return a BufferedImage instance for source image file
     * @throws FormatIOException
     */
    public BufferedImage open(String input) throws FormatIOException {
        ImagePlus ip;

        try {
            ip = JAIReader.read(new File(input))[0];
        } catch (Exception e) {
            LOGGER.error(e.getMessage(), e);
View Full Code Here

            LOGGER.debug("Getting image dimensions from: {}", file);
        }

        final ImageRecord dim = new ImageRecord(file);
        final Opener o = new Opener();
        final ImagePlus imp = o.openImage(file);
        if (imp == null) {
            return null;
        }
        ImageProcessor ip = imp.getProcessor();
        final int width = ip.getWidth();
        final int height = ip.getHeight();

        if (LOGGER.isDebugEnabled()) {
            LOGGER.debug("{} (width: {} | height: {})", file, Integer.toString(width), Integer.toString(height));
View Full Code Here

TOP

Related Classes of ij.ImagePlus

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.