Examples of ROI


Examples of ij.gui.Roi

    GeneralPath path = new GeneralPath(GeneralPath.WIND_EVEN_ODD);
    for (int i = 0; i < polygons.size(); i++)
      path.append((Polygon)polygons.get(i), false);

    ShapeRoi shape = new ShapeRoi(path);
    Roi roi = shape!=null?shape.shapeToRoi():null; // try to convert to non-composite ROI
    IJ.showProgress(1,1);
    if (roi!=null)
      return roi;
    else
      return shape;
View Full Code Here

Examples of ij.gui.Roi

    ShapeRoi s1, s2;
    if (roi instanceof ShapeRoi)
      s1 = (ShapeRoi)roi;
    else
      s1 = new ShapeRoi(roi);
    s2 = new ShapeRoi(new Roi(0,0, width, height));
    setRoi(s1.xor(s2));
    fill(getMask());
    setMask(m);
    setRoi(r);
  }
View Full Code Here

Examples of ij.gui.Roi

    if (n==0) return null;
    if (Orthogonal_Views.isOrthoViewsImage(imp))
      return null;
    byte[][] array = new byte[n][];
    for (int i=0; i<overlay.size(); i++) {
      Roi roi = overlay.get(i);
      array[i] = RoiEncoder.saveAsByteArray(roi);
    }
    return array;
  }
View Full Code Here

Examples of ij.gui.Roi

            return;
        }

        Roi.setColor(color);

        Roi roi = null;
        Roi roi1 = null;
        Roi roi2 = null;
        String name1 = name + "_H";
        String name2 = name + "_V";

        if (roiMap.containsKey(name)) {
            roi = roiMap.get(name);
            imagePlus.deleteRoi(roi);
            roiMap.remove(name);
            roi = null;
        }

        // In case of cross
        if (roiMap.containsKey(name1)) {
            roi1 = roiMap.get(name1);
            imagePlus.deleteRoi(roi1);
            roiMap.remove(name1);
            roi1 = null;
        }

        // In case of cross
        if (roiMap.containsKey(name2)) {
            roi2 = roiMap.get(name2);
            imagePlus.deleteRoi(roi2);
            roiMap.remove(name2);
            roi2 = null;
        }

        switch (shape) {

            case NONE:
                System.out.println("REMOVE ROI : " + name);
                break;

            case RECTANGLE:
                roi = new Roi(x, y, width, height);
                break;
            case OVAL:
                roi = new OvalRoi(x, y, width, height);
                break;
            case CROSS:
View Full Code Here

Examples of ij.gui.Roi

    GeneralPath path = new GeneralPath(GeneralPath.WIND_EVEN_ODD);
    for (int i = 0; i < polygons.size(); i++)
      path.append((Polygon)polygons.get(i), false);

    ShapeRoi shape = new ShapeRoi(path);
    Roi roi = shape!=null?shape.shapeToRoi():null; // try to convert to non-composite ROI
    IJ.showProgress(1,1);
    if (roi!=null)
      return roi;
    else
      return shape;
View Full Code Here

Examples of javax.media.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 javax.media.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);
  boolean saveLocations = ((Boolean)args.getObjectParameter(3)).booleanValue();
  int maxRuns = args.getIntParameter(4);
 
        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;
  }

        return new MlibExtremaOpImage(source,
              roi,
View Full Code Here

Examples of javax.media.jai.ROI

           dataType == DataBuffer.TYPE_DOUBLE) {
            return null;
        }

        // Return null if ROI is non-null and not equals to source bounds.
        ROI roi = (ROI)args.getObjectParameter(0);
        if(roi != null &&
           !roi.equals(new Rectangle(src.getMinX(), src.getMinY(),
                                     src.getWidth(), src.getHeight()))) {
            return null;
        }

        // Get the non-ROI parameters.
View Full Code Here

Examples of javax.media.jai.ROI

            if(roiProperty == null ||
               roiProperty == java.awt.Image.UndefinedProperty ||
               !(roiProperty instanceof ROI)) {
                return java.awt.Image.UndefinedProperty;
            }
            ROI roi = (ROI)roiProperty;

            // Determine the effective destination bounds.
            Rectangle dstBounds = null;
            PlanarImage dst = op.getRendering();
            if(dst instanceof AreaOpImage &&
               ((AreaOpImage)dst).getBorderExtender() == null) {
                AreaOpImage aoi = (AreaOpImage)dst;
                dstBounds =
                    new Rectangle(aoi.getMinX() + aoi.getLeftPadding(),
                                  aoi.getMinY() + aoi.getTopPadding(),
                                  aoi.getWidth() -
                                  aoi.getLeftPadding() -
                                  aoi.getRightPadding(),
                                  aoi.getHeight() -
                                  aoi.getTopPadding() -
                                  aoi.getBottomPadding());
            } else {
                dstBounds = dst.getBounds();
            }

            // If necessary, clip the ROI to the destination bounds.
            // XXX Is this desirable?
            if(!dstBounds.contains(roi.getBounds())) {
                roi = roi.intersect(new ROIShape(dstBounds));
            }

            return roi;
        }
View Full Code Here

Examples of javax.media.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
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.