Examples of ImageProcessor


Examples of ij.process.ImageProcessor

  void writeRGBVirtualStack(OutputStream out, VirtualStack virtualStackthrows IOException {
    showProgressBar = false;
    boolean flip = "FlipTheseImages".equals(fi.fileName);
    for (int i=1; i<=fi.nImages; i++) {
      IJ.showStatus("Writing: " + i + "/" + fi.nImages);
      ImageProcessor ip = virtualStack.getProcessor(i);
      if (flip) ip.flipVertical();
      int[] pixels = (int[])ip.getPixels();
      writeRGBImage(out, pixels);
      IJ.showProgress((double)i/fi.nImages);
    }
  }
View Full Code Here

Examples of ij.process.ImageProcessor

  private BufferedImage open(ImagePlus imp) throws FormatIOException {
    if (imp == null) {
      logger.error("Null ImagePlus Object.");
      throw new FormatIOException("Null ImagePlus Object.");
    }
    ImageProcessor ip = imp.getProcessor();
    int width = ip.getWidth();
    int height = ip.getHeight();
    Image img = ip.createImage();
    imp.flush();
    imp = null;
    ip = null;
   
    BufferedImage bImg = new BufferedImage(width, height, BufferedImage.TYPE_3BYTE_BGR);
View Full Code Here

Examples of ij.process.ImageProcessor

    *    Gets Color lookup Table from 8 bit ImagePlus
    */
    void Process8bitCLT(ImagePlus image){
           colorDepth = 8;
            //setTransparent(false);
            ImageProcessor ip = image.getProcessor();
            ip = ip.convertToByte(true);      
            ColorModel cm = ip.getColorModel();
            indexedPixels = (byte[])(ip.getPixels());
            IndexColorModel m = (IndexColorModel)cm;
            int mapSize = m.getMapSize();
            if (transIndex>=mapSize) {
                setTransparent(false);
                transIndex = 0;
View Full Code Here

Examples of ij.process.ImageProcessor

    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());
    ip = null;
    return dim;
  }
View Full Code Here

Examples of ij.process.ImageProcessor

                g.setColor(new Color(100, 100, 100));
                g.drawString(wmText, x + 2, y + 2);
                g.setColor(new Color(240, 240, 240));
                g.drawString(wmText, x, y);
            }
            ImageProcessor ip = new ImagePlus("temp", img).getProcessor();
            // if the inputMimeType is image/gif, need to convert to RGB in any case
            if (inputMimeType.equals("image/gif")) {
                ip = ip.convertToRGB();
                alreadyConvertedToRGB = true;
            }
            // causes scale() and resize() to do bilinear interpolation
            ip.setInterpolate(true);
            if (!op.equals("convert")) {
                if (op.equals("resize")) {
                    ip = resize(ip, newWidth);
                } else if (op.equals("zoom")) {
                    ip = zoom(ip, zoomAmt);
View Full Code Here

Examples of ij.process.ImageProcessor

        if (imp == null) {
            LOGGER.error("Null ImagePlus Object.");
            throw new FormatIOException("Null ImagePlus Object.");
        }

        ImageProcessor ip = imp.getProcessor();
        int width = ip.getWidth();
        int height = ip.getHeight();
        Image img = ip.createImage();
        imp.flush();
        imp = null;
        ip = null;

        BufferedImage bImg = new BufferedImage(width, height, BufferedImage.TYPE_3BYTE_BGR);
View Full Code Here

Examples of ij.process.ImageProcessor

        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

Examples of jsky.image.ImageProcessor

        double x = p.x, y = p.y;

        int width = _imageDisplay.getImageWidth(),
                height = _imageDisplay.getImageHeight();

        ImageProcessor imageProcessor = _imageDisplay.getImageProcessor();
        boolean flipY = (imageProcessor.getFlipY() != imageProcessor.getReverseY());
        if (imageProcessor.isInvertedYAxis())
            flipY = !flipY;
        if (flipY)
            y = height - c - y;

        if (imageProcessor.getFlipX())
            x = width - c - x;

        p.setLocation(x, y);
    }
View Full Code Here

Examples of jsky.image.ImageProcessor

     *
     * @param p the point to rotate
     * @param factor set to 1 to rotate, -1 to undo the rotation
     */
    public void rotate(Point2D.Double p, int factor) {
        ImageProcessor imageProcessor = _imageDisplay.getImageProcessor();

        // angle is in rad
        double angle = imageProcessor.getAngle() * -factor;
        if (angle == 0.0)
            return;

        double cx = _imageDisplay.getImageWidth() / 2.0;
        double cy = _imageDisplay.getImageHeight() / 2.0;
View Full Code Here

Examples of jsky.image.ImageProcessor

     *
     * @param pane the Diva GraphicsPane to use (contains the layers used to display the
     *             image and graphics)
     */
    public DivaMainImageDisplay(GraphicsPane pane) {
        super(pane, new ImageProcessor(), "Main Image");

        _historyList = new ImageHistoryList(this);
        setDownloadState(false);
        updateEnabledStates();

View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.