Package ij.plugin.frame

Examples of ij.plugin.frame.RoiManager


    }
    catch(OutOfMemoryError e) {IJ.outOfMemory("Paint");}
    }
   
    void showAllROIs(Graphics g) {
    RoiManager rm=RoiManager.getInstance();
    if (rm==null) return;
    initGraphics(g, null);
    Hashtable rois = rm.getROIs();
    java.awt.List list = rm.getList();
    int n = list.getItemCount();
    if (labelRects==null || labelRects.length!=n)
      labelRects = new Rectangle[n];
    for (int i=0; i<n; i++) {
      String label = list.getItem(i);
View Full Code Here


      "run('To Selection');\n";
    new MacroRunner(macro, x+" "+y);
  }

    boolean roiManagerSelect(int x, int y) {
    RoiManager rm=RoiManager.getInstance();
    if (rm==null) return false;
    Hashtable rois = rm.getROIs();
    java.awt.List list = rm.getList();
    int n = list.getItemCount();
    if (labelRects==null || labelRects.length!=n) return false;
    for (int i=0; i<n; i++) {
      if (labelRects[i]!=null && labelRects[i].contains(x,y)) {
        //rm.select(i);
View Full Code Here

    } else
      roi.draw(g);
    }
   
    void drawAllROIs(Graphics g) {
    RoiManager rm=RoiManager.getInstance();
    if (rm==null) {
      rm = Interpreter.getBatchModeRoiManager();
      if (rm!=null && rm.getList().getItemCount()==0)
        rm = null;
    }
    if (rm==null) {
      //if (showAllList!=null)
      //  overlay = showAllList;
      showAllROIs = false;
      repaint();
      return;
    }
    initGraphics(g);
    Hashtable rois = rm.getROIs();
    java.awt.List list = rm.getList();
    boolean drawLabels = rm.getDrawLabels();
    currentRoi = null;
    int n = list.getItemCount();
      if (IJ.debugMode) IJ.log("paint: drawing "+n+" \"Show All\" ROIs");
    if (labelRects==null || labelRects.length!=n)
      labelRects = new Rectangle[n];
View Full Code Here

        handleRoiMouseDown(e);
    }
  }
 
    boolean roiManagerSelect(int x, int y) {
    RoiManager rm=RoiManager.getInstance();
    if (rm==null) return false;
    Hashtable rois = rm.getROIs();
    java.awt.List list = rm.getList();
    int n = list.getItemCount();
    if (labelRects==null || labelRects.length!=n) return false;
    boolean stackMode = imp!=null && imp.getStackSize()>1 && Prefs.showAllSliceOnly;
    for (int i=0; i<n; i++) {
      if (labelRects[i]!=null && labelRects[i].contains(x,y)) {
View Full Code Here

 
  /** Return the ROI Manager "Show All" list as an overlay. */
  public Overlay getShowAllList() {
    if (!showAllROIs) return null;
    if (showAllList!=null) return showAllList;
    RoiManager rm=RoiManager.getInstance();
    if (rm==null) return null;
    Roi[] rois = rm.getRoisAsArray();
    if (rois.length==0) return null;
    Overlay overlay = new Overlay();
    for (int i=0; i<rois.length; i++)
      overlay.add((Roi)rois[i].clone());
    return overlay;
View Full Code Here

  public WaitForUserDialog(String title, String text) {
    super(getFrame(), title, false);
    label = new MultiLineLabel(text, 175);
    if (!IJ.isLinux()) label.setFont(new Font("SansSerif", Font.PLAIN, 14));
    if (IJ.isMacOSX()) {
      RoiManager rm = RoiManager.getInstance();
      if (rm!=null) rm.runCommand("enable interrupts");
    }
        GridBagLayout gridbag = new GridBagLayout(); //set up the layout
        GridBagConstraints c = new GridBagConstraints();
        setLayout(gridbag);
        c.insets = new Insets(6, 6, 0, 6);
View Full Code Here

  }

  void hide() {
    ImagePlus imp = IJ.getImage();
    imp.setHideOverlay(true);
    RoiManager rm = RoiManager.getInstance();
    if (rm!=null) rm.runCommand("show none");
  }
View Full Code Here

  void show() {
    ImagePlus imp = IJ.getImage();
    imp.setHideOverlay(false);
    if (imp.getOverlay()==null) {
      RoiManager rm = RoiManager.getInstance();
      if (rm!=null && rm.getCount()>1) {
        if (!IJ.isMacro()) rm.toFront();
        rm.runCommand("show all with labels");
      }
    }
  }
View Full Code Here

  }

  void remove() {
    ImagePlus imp = WindowManager.getCurrentImage();
    if (imp!=null) imp.setOverlay(null);
    RoiManager rm = RoiManager.getInstance();
    if (rm!=null) rm.runCommand("show none");
  }
View Full Code Here

    imp2.show();
  }
 
  void fromRoiManager() {
    ImagePlus imp = IJ.getImage();
    RoiManager rm = RoiManager.getInstance();
    if (rm==null) {
      IJ.error("ROI Manager is not open");
      return;
    }
    Roi[] rois = rm.getRoisAsArray();
    if (rois.length==0) {
      IJ.error("ROI Manager is empty");
      return;
    }
    Overlay overlay = new Overlay();
    for (int i=0; i<rois.length; i++) {
      Roi roi = (Roi)rois[i].clone();
      if (!Prefs.showAllSliceOnly)
        roi.setPosition(0);
      overlay.add(roi);
    }
    imp.setOverlay(overlay);
    ImageCanvas ic = imp.getCanvas();
    if (ic!=null) ic.setShowAllROIs(false);
    rm.setEditMode(imp, false);
    imp.killRoi();
  }
View Full Code Here

TOP

Related Classes of ij.plugin.frame.RoiManager

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.