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

x33g5p2x  于2022-01-26 转载在 其他  
字(5.7k)|赞(0)|评价(0)|浏览(133)

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

Overlay.get介绍

[英]Returns the ROI with the specified index or null if the index is invalid.
[中]返回具有指定索引的ROI,如果索引无效,则返回null。

代码示例

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

/** Returns the ROI with the specified name or null if not found. */
public Roi get(String name) {
  int index = getIndex(name);
  if (index==-1)
    return null;
  else
    return get(index);   		
}

代码示例来源: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: 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: imagej/ImageJA

/** Returns the ROI with the specified name or null if not found. */
public Roi get(String name) {
  int index = getIndex(name);
  if (index==-1)
    return null;
  else
    return get(index);   		
}

代码示例来源: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 void run(String arg) {
  imp = IJ.getImage();
  Overlay overlay = imp.getOverlay();
  int index = overlay!=null?overlay.getIndex(GRID):-1;
  if (index>=0)
    gridOnEntry = overlay.get(index);
  if (showDialog() && !isMacro)
    saveSettings();
}

代码示例来源: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

public void run(String arg) {
  imp = IJ.getImage();
  Overlay overlay = imp.getOverlay();
  int index = overlay!=null?overlay.getIndex(GRID):-1;
  if (index>=0)
    gridOnEntry = overlay.get(index);
  if (showDialog() && !isMacro)
    saveSettings();
}

代码示例来源: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: net.imagej/ij

private void handleDoubleClickInOverlayList(String s) {
  ImagePlus imp = WindowManager.getCurrentImage();
  if (imp==null)
    return;
  Overlay overlay = imp.getOverlay();
  if (overlay==null)
    return;
  String[] columns = s.split("\t");
  int index = (int)Tools.parseDouble(columns[0]);
  Roi roi = overlay.get(index);
  imp.setRoi(roi);
}

代码示例来源: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: imagej/ImageJA

private void handleDoubleClickInOverlayList(String s) {
  ImagePlus imp = WindowManager.getCurrentImage();
  if (imp==null)
    return;
  Overlay overlay = imp.getOverlay();
  if (overlay==null)
    return;
  String[] columns = s.split("\t");
  int index = (int)Tools.parseDouble(columns[0]);
  Roi roi = overlay.get(index);
  imp.setRoi(roi);
}

代码示例来源: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: 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: 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: 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

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");
}

相关文章