本文整理了Java中ij.gui.Overlay.remove()
方法的一些代码示例,展示了Overlay.remove()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Overlay.remove()
方法的具体详情如下:
包路径:ij.gui.Overlay
类名称:Overlay
方法名:remove
[英]Removes the ROI with the specified index from this Overlay.
[中]从此覆盖中移除具有指定索引的ROI。
代码示例来源:origin: ca.mcgill/Sholl_Analysis
public void removeShells() {
if (!shellsAdded)
return;
for (final Roi shell : shells)
overlay.remove(shell);
shellsAdded = false;
}
代码示例来源:origin: ca.mcgill/Sholl_Analysis
public void removePoints() {
if (!pointsAdded)
return;
for (final Roi point : points)
overlay.remove(point);
pointsAdded = false;
}
代码示例来源:origin: net.imagej/ij
void hideRangeArrows() {
if (imp == null || rangeArrowRois==null) return;
Overlay ovly = imp.getOverlay();
if (ovly == null) return;
for (Roi roi : rangeArrowRois)
ovly.remove(roi);
ic.repaint();
rangeArrowsVisible = false;
activeRangeArrow = -1;
}
代码示例来源:origin: imagej/ImageJA
void hideRangeArrows() {
if (imp == null || rangeArrowRois==null) return;
Overlay ovly = imp.getOverlay();
if (ovly == null) return;
for (Roi roi : rangeArrowRois)
ovly.remove(roi);
ic.repaint();
rangeArrowsVisible = false;
activeRangeArrow = -1;
}
代码示例来源:origin: sc.fiji/TrackMate_
@Override
public void clean()
{
super.clean();
final Overlay overlay = imp.getOverlay();
if ( null != overlay )
{
for ( final Roi roi : roiList )
{
overlay.remove( roi );
}
}
}
}
代码示例来源: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: fiji/TrackMate
@Override
public void clean()
{
super.clean();
final Overlay overlay = imp.getOverlay();
if ( null != overlay )
{
for ( final Roi roi : roiList )
{
overlay.remove( roi );
}
}
}
}
代码示例来源: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 removeOutline() {
Overlay overlay = imp.getOverlay();
if (overlay==null) return;
int index = getIndex(overlay, TITLE);
if (index>=0) {
overlay.remove(index);
imp.setOverlay(overlay);
}
}
代码示例来源: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: imagej/ImageJA
private void removeOutline() {
Overlay overlay = imp.getOverlay();
if (overlay==null) return;
int index = getIndex(overlay, TITLE);
if (index>=0) {
overlay.remove(index);
imp.setOverlay(overlay);
}
}
代码示例来源: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: sc.fiji/Descriptor_based_registration
protected void removeColoredOverlays( final ImagePlus imp, int num, final Color color )
{
final Overlay o = imp.getOverlay();
// nothing there
if ( o == null )
return;
for ( int i = o.size() - 1; i >=0 && num > 0; --i )
{
if ( o.get( i ).getStrokeColor().equals( color ) )
{
o.remove( i );
num--;
}
}
imp.updateAndDraw();
}
代码示例来源:origin: net.imagej/ij
/** Removes ROIs having positions outside of the
* interval defined by firstSlice and lastSlice.
* Marcel Boeglin, September 2013
*/
public void crop(int firstSlice, int lastSlice) {
for (int i=size()-1; i>=0; i--) {
Roi roi = get(i);
int position = roi.getPosition();
if (position>0) {
if (position<firstSlice || position>lastSlice)
remove(i);
else
roi.setPosition(position-firstSlice+1);
}
}
}
代码示例来源:origin: imagej/ImageJA
/** Removes ROIs having positions outside of the
* interval defined by firstSlice and lastSlice.
* Marcel Boeglin, September 2013
*/
public void crop(int firstSlice, int lastSlice) {
for (int i=size()-1; i>=0; i--) {
Roi roi = get(i);
int position = roi.getPosition();
if (position>0) {
if (position<firstSlice || position>lastSlice)
remove(i);
else
roi.setPosition(position-firstSlice+1);
}
}
}
代码示例来源: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
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
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
private void showToolSize(int deltaWidth, ImagePlus imp) {
if (deltaWidth !=0) {
width = oldWidth + deltaWidth;
if (width<1) width=1;
Roi circle = new OvalRoi(xStart-width/2, yStart-width/2, width, width);
circle.setName(CIRCLE_NAME);
circle.setStrokeColor(Color.red);
overlay = imp.getOverlay();
if (overlay==null)
overlay = new Overlay();
else if (overlay.size()>0 && CIRCLE_NAME.equals(overlay.get(overlay.size()-1).getName()))
overlay.remove(overlay.size()-1);
overlay.add(circle);
imp.setOverlay(overlay);
}
IJ.showStatus((isPencil?"Pencil":"Brush")+" width: "+ width);
}
内容来源于网络,如有侵权,请联系作者删除!