ij.gui.Overlay.size()方法的使用及代码示例

x33g5p2x  于2022-01-08 转载在 其他  
字(6.1k)|赞(0)|评价(0)|浏览(130)

本文整理了Java中ij.gui.Overlay.size()方法的一些代码示例,展示了Overlay.size()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Overlay.size()方法的具体详情如下:
包路径:ij.gui.Overlay
类名称:Overlay
方法名:size

Overlay.size介绍

[英]Returns the number of ROIs in this Overlay.
[中]返回此覆盖中的ROI数。

代码示例

代码示例来源:origin: imagej/ImageJA

/**
* @deprecated
* replaced by ImagePlus.getOverlay()
*/
public Vector getDisplayList() {
  if (overlay==null) return null;
  Vector displayList = new Vector();
  for (int i=0; i<overlay.size(); i++)
    displayList.add(overlay.get(i));
  return displayList;
}

代码示例来源:origin: net.imagej/ij

/**
* @deprecated
* replaced by ImagePlus.getOverlay()
*/
public Vector getDisplayList() {
  if (overlay==null) return null;
  Vector displayList = new Vector();
  for (int i=0; i<overlay.size(); i++)
    displayList.add(overlay.get(i));
  return displayList;
}

代码示例来源:origin: sc.fiji/Simple_Neurite_Tracer

private void removeMIPfromOverlay(final Overlay overlay) {
  if (overlay != null && overlay.size() > 0) {
    for (int i = overlay.size() - 1; i >= 0; i--) {
      final String roiName = overlay.get(i).getName();
      if (roiName != null && roiName.equals(OVERLAY_IDENTIFIER)) {
        overlay.remove(i);
        return;
      }
    }
  }
}

代码示例来源:origin: ca.mcgill/Sholl_Analysis

private synchronized static void removeShollROIs(final Overlay overlay, final String key, final String property) {
  if (overlay == null || overlay.size() == 0)
    return;
  for (int i = overlay.size() - 1; i >= 0; i--) {
    final String prpty = overlay.get(i).getProperty(key);
    if (prpty != null && prpty.contains(property))
      overlay.remove(i);
  }
}

代码示例来源:origin: net.imagej/ij

public void mouseReleased(ImagePlus imp, MouseEvent e) {
  if (mode==RESIZING) {
    if (overlay!=null && overlay.size()>0 && CIRCLE_NAME.equals(overlay.get(overlay.size()-1).getName())) {
      overlay.remove(overlay.size()-1);
      imp.setOverlay(overlay);
    }
    overlay = null;
    if (e.isShiftDown()) {
      setWidth(width);
      Prefs.set(widthKey, width);
    }
  }
}

代码示例来源:origin: ca.mcgill/Sholl_Analysis

public void assignProperty(String property) {
  for (int i =0; i < overlay.size(); i++)
    overlay.get(i).setProperty(PROP, property);
}

代码示例来源:origin: net.imagej/ij

public String toString() {
  return "Overlay[size="+size()+" "+(scalableLabels?"scale":"")+" "+Colors.colorToString(getLabelColor())+"]";
}

代码示例来源:origin: imagej/ImageJA

public void mouseReleased(ImagePlus imp, MouseEvent e) {
  if (mode==RESIZING) {
    if (overlay!=null && overlay.size()>0 && CIRCLE_NAME.equals(overlay.get(overlay.size()-1).getName())) {
      overlay.remove(overlay.size()-1);
      imp.setOverlay(overlay);
    }
    overlay = null;
    if (e.isShiftDown()) {
      setWidth(width);
      Prefs.set(widthKey, width);
    }
  }
}

代码示例来源:origin: net.imagej/ij

/** Removes all ROIs that have the specified name. */
public void remove(String name) {
  if (name==null) return;
  for (int i=size()-1; i>=0; i--) {
    if (name.equals(get(i).getName()))
      remove(i);
  }
}

代码示例来源:origin: imagej/ImageJA

/** Removes all ROIs that have the specified name. */
public void remove(String name) {
  if (name==null) return;
  for (int i=size()-1; i>=0; i--) {
    if (name.equals(get(i).getName()))
      remove(i);
  }
}

代码示例来源:origin: sc.fiji/fiji-lib

protected void drawOverlay(Graphics g) {
  if (imp!=null && imp.getHideOverlay())
    return;
  Overlay overlay = imp.getOverlay();
  if (overlay==null)
    return;
  int n = overlay.size();
  for (int i=0; i<n; i++) {
    Roi roi = overlay.get(i);
    drawRoi(g, roi);
  }
}

代码示例来源:origin: net.imagej/ij

double overlaySetFillColor(Overlay overlay) {
  interp.getLeftParen();
  Color color = getColor();
  interp.getRightParen();
  if (overlay==null)
    overlay = offscreenOverlay;
  if (overlay==null)
    interp.error("No overlay");
  int size = overlay.size();
  if (size>0)
    overlay.get(size-1).setFillColor(color);
  return Double.NaN;
}

代码示例来源:origin: net.imagej/ij

public void mouseReleased(ImagePlus imp, MouseEvent e) {
  if (mode == RESIZED) {
    Overlay overlay = imp.getOverlay();
    overlay.remove(overlay.size()-1); //delete brush resizing circle
    imp.setOverlay(overlay);
    Prefs.set(WIDTH_KEY, width);
    if (gd!=null)
      options.setWidth(width);
  } else if (newPath)		// allow drawing a single dot
    mouseDragged(imp, e);
}

代码示例来源:origin: imagej/ImageJA

double overlaySetFillColor(Overlay overlay) {
  interp.getLeftParen();
  Color color = getColor();
  interp.getRightParen();
  if (overlay==null)
    overlay = offscreenOverlay;
  if (overlay==null)
    interp.error("No overlay");
  int size = overlay.size();
  if (size>0)
    overlay.get(size-1).setFillColor(color);
  return Double.NaN;
}

代码示例来源:origin: imagej/ImageJA

public void mouseReleased(ImagePlus imp, MouseEvent e) {
  if (mode == RESIZED) {
    Overlay overlay = imp.getOverlay();
    overlay.remove(overlay.size()-1); //delete brush resizing circle
    imp.setOverlay(overlay);
    Prefs.set(WIDTH_KEY, width);
    if (gd!=null)
      options.setWidth(width);
  } else if (newPath)		// allow drawing a single dot
    mouseDragged(imp, e);
}

代码示例来源:origin: net.imagej/ij

void addRoi(ImagePlus imp, Roi roi){
  Overlay overlay = imp.getOverlay();
  if (overlay==null || overlay.size()==0) {
    if (offscreenOverlay==null)
      offscreenOverlay = new Overlay();
    overlay = offscreenOverlay;
  }
  if (defaultColor!=null)
    roi.setStrokeColor(defaultColor);        
  roi.setStrokeWidth(getProcessor().getLineWidth());
  overlay.add(roi);
}

代码示例来源:origin: imagej/ImageJA

void addRoi(ImagePlus imp, Roi roi){
  Overlay overlay = imp.getOverlay();
  if (overlay==null || overlay.size()==0) {
    if (offscreenOverlay==null)
      offscreenOverlay = new Overlay();
    overlay = offscreenOverlay;
  }
  if (defaultColor!=null)
    roi.setStrokeColor(defaultColor);        
  roi.setStrokeWidth(getProcessor().getLineWidth());
  overlay.add(roi);
}

代码示例来源:origin: net.imagej/ij

public void setOverlay(Overlay overlay) {
  if (overlay==null) {
    overlayTemplate = null;
    return;
  }
  reset();
  overlayTemplate = overlay.create();
  setEditMode(null, false);
  for (int i=0; i<overlay.size(); i++)
    add(overlay.get(i), i+1);
  setEditMode(null, true);
  runCommand("show all");
}

代码示例来源:origin: imagej/ImageJA

public void setOverlay(Overlay overlay) {
  if (overlay==null) {
    overlayTemplate = null;
    return;
  }
  reset();
  overlayTemplate = overlay.create();
  setEditMode(null, false);
  for (int i=0; i<overlay.size(); i++)
    add(overlay.get(i), i+1);
  setEditMode(null, true);
  runCommand("show all");
}

代码示例来源:origin: net.imagej/ij

void toRoiManager() {
  ImagePlus imp = IJ.getImage();
  Overlay overlay = imp.getOverlay();
  if (overlay==null) {
    IJ.error("Overlay required");
    return;
  }
  RoiManager rm = RoiManager.getInstance2();
  if (rm==null)
    rm = new RoiManager();
  if (overlay.size()>=4 && overlay.get(3).getPosition()!=0)
    Prefs.showAllSliceOnly = true;
  rm.setOverlay(overlay);
  imp.setOverlay(null);
}

相关文章