Tabnine Logo
OverlayService.addOverlays
Code IndexAdd Tabnine to your IDE (free)

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

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

origin: net.imagej/imagej-common

private void attachOverlays(final ImageDisplay inputDisp,
  final ImageDisplay outputDisp, final List<Overlay> overlays)
{
  final RealRect bounds = overlayService.getSelectionBounds(inputDisp);
  final double[] toOrigin = new double[2];
  toOrigin[0] = -bounds.x;
  toOrigin[1] = -bounds.y;
  final List<Overlay> newOverlays = new ArrayList<>();
  for (final Overlay overlay : overlays) {
    if (overlayWithinBounds(overlay, bounds)) {
      // add a reference to existing overlay?
      if (toOrigin[0] == 0 && toOrigin[1] == 0) {
        newOverlays.add(overlay);
      }
      else { // different origins means must create new overlays
        final Overlay newOverlay = overlay.duplicate();
        newOverlay.move(toOrigin);
        newOverlays.add(newOverlay);
      }
    }
  }
  overlayService.addOverlays(outputDisp, newOverlays);
}
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);
}
net.imagej.displayOverlayServiceaddOverlays

Javadoc

Adds the list of Overlays to the given ImageDisplay.

Popular methods of OverlayService

  • removeOverlay
    Removes an Overlay from all ImageDisplays.
  • 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

  • Reading from database using SQL prepared statement
  • findViewById (Activity)
  • scheduleAtFixedRate (Timer)
  • getSupportFragmentManager (FragmentActivity)
  • ServerSocket (java.net)
    This class represents a server-side socket that waits for incoming client connections. A ServerSocke
  • Scanner (java.util)
    A parser that parses a text string of primitive types and strings with the help of regular expressio
  • TimerTask (java.util)
    The TimerTask class represents a task to run at a specified time. The task may be run once or repeat
  • Executor (java.util.concurrent)
    An object that executes submitted Runnable tasks. This interface provides a way of decoupling task s
  • Reference (javax.naming)
  • Logger (org.slf4j)
    The org.slf4j.Logger interface is the main user entry point of SLF4J API. It is expected that loggin
  • Top PhpStorm plugins
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