Examples of Roi


Examples of com.lightcrafts.mediax.jai.ROI

            if (property == null ||
                property.equals(java.awt.Image.UndefinedProperty) ||
                !(property instanceof ROI)) {
                return java.awt.Image.UndefinedProperty;
            }
            ROI srcROI = (ROI)property;

            // Determine the effective source bounds.
            Rectangle srcBounds = new Rectangle(src.getMinX(),
            src.getMinY(),
            src.getWidth(),
            src.getHeight());

            // If necessary, clip the ROI to the effective source bounds.
            if(!srcBounds.contains(srcROI.getBounds())) {
                srcROI = srcROI.intersect(new ROIShape(srcBounds));
            }

            // Retrieve the scale factors and translation values.
            float sx = pb.getFloatParameter(0);
            float sy = pb.getFloatParameter(1);

            // Create an equivalent transform.
            AffineTransform transform =
                new AffineTransform(sx, 0.0, 0.0, sy, 0.0, 0.0);

            // Create the scaled ROI.
            ROI dstROI = srcROI.transform(transform);

            // Retrieve the destination bounds.
            Rectangle dstBounds = op.getBounds();

            // If necessary, clip the warped ROI to the destination bounds.
            if(!dstBounds.contains(dstROI.getBounds())) {
                dstROI = dstROI.intersect(new ROIShape(dstBounds));
            }

            // Return the warped and possibly clipped ROI.
            return dstROI;
        }
View Full Code Here

Examples of com.lightcrafts.mediax.jai.ROI

        ColorQuantizerType algorithm =
            (ColorQuantizerType)paramBlock.getObjectParameter(0);
        int maxColorNum = paramBlock.getIntParameter(1);
        int upperBound = paramBlock.getIntParameter(2);
        ROI roi= (ROI)paramBlock.getObjectParameter(3);
        int xPeriod = paramBlock.getIntParameter(4);
        int yPeriod = paramBlock.getIntParameter(5);

        // check if 3-band byte-type image
  SampleModel sm = source.getSampleModel();
View Full Code Here

Examples of com.lightcrafts.mediax.jai.ROI

        if (!MediaLibAccessor.isMediaLibCompatible(args)) {
            return null;
        }

  RenderedImage source = args.getRenderedSource(0);
  ROI roi = (ROI)args.getObjectParameter(0);
        int xPeriod = args.getIntParameter(1);
        int yPeriod = args.getIntParameter(2);
 
        int xStart = source.getMinX()// default values
        int yStart = source.getMinY();

        int maxWidth = source.getWidth();
        int maxHeight = source.getHeight();

        if (roi != null &&
            !roi.contains(xStart, yStart, maxWidth, maxHeight)) {
            return null;
        }

  // mediaLib supports only a sampling period of 1
  if ((xPeriod != 1) || (yPeriod != 1)) {
View Full Code Here

Examples of com.lightcrafts.mediax.jai.ROI

        int yStart = src.getMinY();

        int maxWidth = src.getWidth();
        int maxHeight = src.getHeight();

        ROI roi = (ROI)args.getObjectParameter(0);
        int xPeriod = args.getIntParameter(1);
        int yPeriod = args.getIntParameter(2);
        int[] numBins = (int[])args.getObjectParameter(3);
        double[] lowValue = (double[])args.getObjectParameter(4);
        double[] highValue = (double[])args.getObjectParameter(5);
View Full Code Here

Examples of com.lightcrafts.mediax.jai.ROI

      if (property == null ||
    property.equals(java.awt.Image.UndefinedProperty) ||
    !(property instanceof ROI)) {
    return null;
      }
      ROI srcROI = (ROI)property;

      // Determine the effective source bounds.
      Rectangle srcBounds = null;
      PlanarImage dst = op.getRendering();
      if(dst instanceof WarpOpImage && !((OpImage)dst).hasExtender(0)) {
    WarpOpImage warpIm = (WarpOpImage)dst;
    srcBounds =
        new Rectangle(src.getMinX() + warpIm.getLeftPadding(),
          src.getMinY() + warpIm.getTopPadding(),
          src.getWidth() - warpIm.getWidth() + 1,
          src.getHeight() - warpIm.getHeight() + 1);
      } else {
    srcBounds = new Rectangle(src.getMinX(),
            src.getMinY(),
            src.getWidth(),
            src.getHeight());
      }

      // If necessary, clip the ROI to the effective source bounds.
      if(!srcBounds.contains(srcROI.getBounds())) {
    srcROI = srcROI.intersect(new ROIShape(srcBounds));
      }

      // Retrieve the scale factors
      float sx = 1.0F/pb.getIntParameter(1);
      float sy = 1.0F/pb.getIntParameter(2);

      // Create an equivalent transform.
      AffineTransform transform =
    new AffineTransform(sx, 0.0, 0.0, sy, 0, 0);

      // Create the scaled ROI.
      ROI dstROI = srcROI.transform(transform);

      // Retrieve the destination bounds.
      Rectangle dstBounds = op.getBounds();

      // If necessary, clip the warped ROI to the destination bounds.
      if(!dstBounds.contains(dstROI.getBounds())) {
    dstROI = dstROI.intersect(new ROIShape(dstBounds));
      }

      // Return the warped and possibly clipped ROI.
      return dstROI;
  } else {
View Full Code Here

Examples of com.lightcrafts.mediax.jai.ROI

                !(property instanceof ROI)) {
                return java.awt.Image.UndefinedProperty;
            }

            // Return undefined also if source ROI is empty.
            ROI srcROI = (ROI)property;
            if (srcROI.getBounds().isEmpty()) {
                return java.awt.Image.UndefinedProperty;
            }

            // Retrieve the Interpolation object.
            Interpolation interp = (Interpolation)pb.getObjectParameter(1);

            // Determine the effective source bounds.
            Rectangle srcBounds = null;
            PlanarImage dst = op.getRendering();
            if (dst instanceof GeometricOpImage &&
                ((GeometricOpImage)dst).getBorderExtender() == null) {
                srcBounds =
                    new Rectangle(src.getMinX() + interp.getLeftPadding(),
                                  src.getMinY() + interp.getTopPadding(),
                                  src.getWidth() - interp.getWidth() + 1,
                                  src.getHeight() - interp.getHeight() + 1);
            } else {
                srcBounds = new Rectangle(src.getMinX(),
            src.getMinY(),
            src.getWidth(),
            src.getHeight());
            }

            // If necessary, clip the ROI to the effective source bounds.
            if(!srcBounds.contains(srcROI.getBounds())) {
                srcROI = srcROI.intersect(new ROIShape(srcBounds));
            }

            // Set the nearest neighbor interpolation object.
            Interpolation interpNN = interp instanceof InterpolationNearest ?
                interp :
                Interpolation.getInstance(Interpolation.INTERP_NEAREST);

            // Retrieve the Warp object.
            Warp warp = (Warp)pb.getObjectParameter(0);

            // Create the warped ROI.
            ROI dstROI = new ROI(JAI.create("warp", srcROI.getAsImage(),
                                            warp, interpNN));

            // Retrieve the destination bounds.
            Rectangle dstBounds = op.getBounds();

            // If necessary, clip the warped ROI to the destination bounds.
            if(!dstBounds.contains(dstROI.getBounds())) {
                dstROI = dstROI.intersect(new ROIShape(dstBounds));
            }

            // Return the warped and possibly clipped ROI.
            return dstROI;
        }
View Full Code Here

Examples of com.lightcrafts.mediax.jai.ROI

                                                       il);

                PlanarImage constImage = JAI.create("constant", pb, rh);

                // Compute a complement ROI.
                ROI complementROI =
                    (new ROIShape(ti.getBounds())).subtract(roi);;

                // Fill the background.
                int maxTileY = ti.getMaxTileY();
                int maxTileX = ti.getMaxTileX();
View Full Code Here

Examples of echiquier.pieces.Roi

    plateau.put(new Position(2, 0), new Fou(Couleur.BLANC));
    plateau.put(new Position(5, 0), new Fou(Couleur.BLANC));
    plateau.put(new Position(2, 7), new Fou(Couleur.NOIR));
    plateau.put(new Position(5, 7), new Fou(Couleur.NOIR));

    plateau.put(new Position(3, 0), new Roi(Couleur.BLANC));
    plateau.put(new Position(3, 7), new Roi(Couleur.NOIR));

    plateau.put(new Position(4, 0), new Reine(Couleur.BLANC));
    plateau.put(new Position(4, 7), new Reine(Couleur.NOIR));
  }
View Full Code Here

Examples of ij.gui.Roi

    } else {
      IJ.error("RankFilters","Argument missing or undefined: "+arg);
      return DONE;
    }
        if (isMultiStepFilter(filterType) && imp!=null) {  //composite filter: 'open maxima' etc:
            Roi roi = imp.getRoi();
            if (roi!=null && !roi.getBounds().contains(new Rectangle(imp.getWidth(), imp.getHeight())))
                //Roi < image? (actually tested: NOT (Roi>=image))
                flags |= SNAPSHOT;          //snapshot for resetRoiBoundary
        }
    return flags;
  }
View Full Code Here

Examples of ij.gui.Roi

    }
    this.pfr = pfr;
    flags = IJ.setupDialog(imp, flags)//ask whether to process all slices of stack (if a stack)
    if ((flags&DOES_STACKS)!=0) {
        int size = imp.getWidth() * imp.getHeight();
        Roi roi = imp.getRoi();
        if (roi != null) {
            Rectangle roiRect = roi.getBounds();
            size = roiRect.width * roiRect.height;
            }
            double workToDo = size*(double)radius;  //estimate computing time (arb. units)
            if (filterType==MEAN || filterType==VARIANCE) workToDo *= 0.5;
            else if (filterType==MEDIAN) workToDo *= radius*0.5;
 
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.