congrats Icon
New! Tabnine Pro 14-day free trial
Start a free trial
Tabnine Logo
OverlayService.removeOverlay
Code IndexAdd Tabnine to your IDE (free)

How to use
removeOverlay
method
in
net.imagej.display.OverlayService

Best Java code snippets using net.imagej.display.OverlayService.removeOverlay (Showing top 3 results out of 315)

origin: net.imagej/imagej-deprecated

@Override
public void removeThreshold(final ImageDisplay display) {
  final ThresholdOverlay overlay = thresholdMap().get(display);
  if (overlay != null) {
    overlayService.removeOverlay(display, overlay);
    thresholdMap().remove(display);
  }
}
origin: net.imagej/imagej-legacy

/**
 * Updates the given {@link ImageDisplay} to contain {@link Overlay}s
 * corresponding to all the given {@link ImagePlus}'s Rois (both the active
 * Roi and the Rois stored in ImageJ 1.x's current Overlay).
 */
@Override
public void updateDisplay(final ImageDisplay display, final ImagePlus imp) {
  final List<Overlay> overlaysToRemove = overlayService.getOverlays(display);
  for (final Overlay overlay : overlaysToRemove) {
    overlayService.removeOverlay(display, overlay);
  }
  /*
  if (fullySelected(display, imp)) {
    for (DataView view : display)
      view.setSelected(true);
  }
  else {
  */
  final List<Overlay> overlays = getOverlays(imp);
  overlayService.addOverlays(display, overlays);
  // }
  setModernThreshold(display, imp);
}
origin: net.imagej/imagej-ui-swing

private void delete() {
  if (overlayService.getOverlayInfo().getOverlayInfoCount() == 0) return;
  List<Overlay> overlaysToDelete = new LinkedList<>();
  final int[] selectedIndices = overlayService.getOverlayInfo().selectedIndices();
  if (selectedIndices.length == 0) {
    final int result =
      JOptionPane.showConfirmDialog(
        this, "Delete all overlays?", "Delete All", JOptionPane.YES_NO_OPTION);
    if (result != JOptionPane.YES_OPTION) return;
    for (int i = 0; i < overlayService.getOverlayInfo().getOverlayInfoCount(); i++) {
      overlaysToDelete.add(overlayService.getOverlayInfo().getOverlayInfo(i).getOverlay());
    }
  }
  else {
    for (int i = 0; i < selectedIndices.length; i++) {
      int index = selectedIndices[i];
      overlaysToDelete.add(overlayService.getOverlayInfo().getOverlayInfo(index).getOverlay());
    }
  }
  for (Overlay overlay : overlaysToDelete) {
    // NB - removeOverlay() can indirectly change our infoList contents.
    // Thus we first collect overlays from the infoList and then delete
    // them all afterwards to avoid interactions.
    overlayService.removeOverlay(overlay);
  }
}

net.imagej.displayOverlayServiceremoveOverlay

Javadoc

Removes an Overlay from the given ImageDisplay.

Popular methods of OverlayService

  • addOverlays
    Adds the list of Overlays to the given ImageDisplay.
  • getActiveOverlay
    Returns the active overlay associated with a display
  • getDefaultSettings
  • getOverlays
    Gets a list of Overlays linked to the given ImageDisplay. If selectedOnly is true then it will gathe
  • divideCompositeOverlay
    Divides a CompositeOverlay into its constituent parts and registers each part with the appropriate d
  • drawOverlay
    Draws the outline of a given overlay in a display using the set of channel information provided.
  • fillOverlay
    Draws and fills the outline of a given overlay in a display using the set of channel information pro
  • getFirstDisplay
    Returns the first display associated with an overlay
  • getOverlayInfo
    Returns the overlay info list associated with this service. There is one list per ImageJ context. It
  • getSelectionBounds
    Gets the bounding box for the selected overlays in the given ImageDisplay.

Popular in Java

  • Start an intent from android
  • setScale (BigDecimal)
  • compareTo (BigDecimal)
  • onRequestPermissionsResult (Fragment)
  • FileOutputStream (java.io)
    An output stream that writes bytes to a file. If the output file exists, it can be replaced or appen
  • SocketException (java.net)
    This SocketException may be thrown during socket creation or setting options, and is the superclass
  • MessageFormat (java.text)
    Produces concatenated messages in language-neutral way. New code should probably use java.util.Forma
  • StringTokenizer (java.util)
    Breaks a string into tokens; new code should probably use String#split.> // Legacy code: StringTo
  • Vector (java.util)
    Vector is an implementation of List, backed by an array and synchronized. All optional operations in
  • Scheduler (org.quartz)
    This is the main interface of a Quartz Scheduler. A Scheduler maintains a registry of org.quartz.Job
  • Top 17 Free Sublime Text Plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now