congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
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

  • Creating JSON documents from java classes using gson
  • onCreateOptionsMenu (Activity)
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • ObjectMapper (com.fasterxml.jackson.databind)
    ObjectMapper provides functionality for reading and writing JSON, either to and from basic POJOs (Pl
  • VirtualMachine (com.sun.tools.attach)
    A Java virtual machine. A VirtualMachine represents a Java virtual machine to which this Java vir
  • Point (java.awt)
    A point representing a location in (x,y) coordinate space, specified in integer precision.
  • SocketTimeoutException (java.net)
    This exception is thrown when a timeout expired on a socket read or accept operation.
  • TreeMap (java.util)
    Walk the nodes of the tree left-to-right or right-to-left. Note that in descending iterations, next
  • Reflections (org.reflections)
    Reflections one-stop-shop objectReflections scans your classpath, indexes the metadata, allows you t
  • Top 12 Jupyter Notebook extensions
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

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