Package ij.gui

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


    }
    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

    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

    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

    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

            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

    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

TOP

Related Classes of ij.gui.Roi

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.