Package ij.io

Examples of ij.io.Opener


        try {
            IOUtils.copy(istream, out);
        } finally {
            IOUtils.closeQuietly(out);
        }
        Opener op = new Opener();
        ImagePlus ip = op.openImage(tmp.getPath());
        if (ip == null ) {
            return false;
        }
        int type = op.getFileType(tmp.getPath());
        tmp.delete();
        ImageProcessor processor = ip.getProcessor();
        if (ip.getWidth() > ip.getHeight()) {
            processor = processor.resize(size, ip.getHeight()*size/ip.getWidth());
        } else {
View Full Code Here


                IOUtils.copy(is, os);
            } finally {
                IOUtils.closeQuietly(os);
                IOUtils.closeQuietly(is);
            }
            Opener op = new Opener();
            ImagePlus ip = op.openImage(tmp.getPath());
            return new ImageJImage(node.getPath(), ip, op.getFileType(tmp.getPath()));
        } finally {
            IOUtils.closeQuietly(os);
            FileUtils.deleteQuietly(tmp);
        }
    }
View Full Code Here

   * @param input an InputStream consisting of an image bitstream
   * @return a BufferedImage instance for source image InputStream
   * @throws FormatIOException
   */
  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) {
      logger.info("Creating temp image");
      File path = IOUtils.createTempImage(input);
      bi = open(path.getAbsolutePath());
View Full Code Here

   * Attempt to determine if file is a TIFF using the file header.
   * @param file
   * @return true if the file is a TIFF
   */
  public final static boolean checkIfTiff(String file) {
    return new Opener().getFileType(file) == Opener.TIFF;
  }
View Full Code Here

    return dim;
  }
 
  private static ImageRecord setUsingImageJ(String file) {
    ImageRecord dim = new ImageRecord(file);
    Opener o = new Opener();
    ImagePlus imp = o.openImage(file);
    if (imp == null)
      return null;
    ImageProcessor ip = imp.getProcessor();
    dim.setWidth(ip.getWidth());
    dim.setHeight(ip.getHeight());
View Full Code Here

     *
     * @param file
     * @return true if the file is a TIFF
     */
    public final static boolean checkIfTiff(String file) {
        return new Opener().getFileType(file) == Opener.TIFF;
    }
View Full Code Here

     * @param input an InputStream consisting of an image bitstream
     * @return a BufferedImage instance for source image InputStream
     * @throws FormatIOException
     */
    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

        if (LOGGER.isDebugEnabled()) {
            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();
View Full Code Here

TOP

Related Classes of ij.io.Opener

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.