Package ij.plugin.frame

Examples of ij.plugin.frame.RoiManager


    Overlay overlay = imp.getOverlay();
    if (overlay==null) {
      IJ.error("Overlay required");
      return;
    }
    RoiManager rm = RoiManager.getInstance();
    if (rm==null) {
      if (Macro.getOptions()!=null && Interpreter.isBatchMode())
        rm = Interpreter.getBatchModeRoiManager();
      if (rm==null) {
        Frame frame = WindowManager.getFrame("ROI Manager");
        if (frame==null)
          IJ.run("ROI Manager...");
        frame = WindowManager.getFrame("ROI Manager");
        if (frame==null || !(frame instanceof RoiManager))
          return;
        rm = (RoiManager)frame;
      }
    }
    if (overlay.size()>=4 && overlay.get(3).getPosition()!=0)
      Prefs.showAllSliceOnly = true;
    rm.runCommand("reset");
    for (int i=0; i<overlay.size(); i++)
      rm.add(imp, overlay.get(i), i);
    rm.setEditMode(imp, true);
    if (rm.getCount()==overlay.size())
      imp.setOverlay(null);
  }
View Full Code Here


    }
    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

    Roi roi = imp.getRoi();
    if (roi==null) return;
    frame = WindowManager.getFrame("ROI Manager");
    if (frame==null || !(frame instanceof RoiManager))
      IJ.error("ROI Manager not found");
    RoiManager rm = (RoiManager)frame;
    boolean altDown= IJ.altKeyDown();
    IJ.setKeyUp(IJ.ALL_KEYS);
    if (altDown) IJ.setKeyDown(KeyEvent.VK_SHIFT);
    rm.runCommand("add");
    IJ.setKeyUp(IJ.ALL_KEYS);
  }
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.