Package net.imagej.display

Examples of net.imagej.display.OverlayView


  public static Img<BitType> extractMask(ImageDisplay display) {
    Img<BitType> mask = null;
    for (DataView view:display) {
      if (! (view instanceof OverlayView)) continue;
      if (! view.isSelected()) continue;
      OverlayView oView = (OverlayView)view;
      if (mask == null) {
        mask = createBitMask(display);
      }
      Overlay overlay = oView.getData();
      /*
       * The view can have an offset. Since there are two ways
       * of handling the ROI, we offset the image instead of the view.
       *
       * We also will attempt to make the axes conform to what's
       * expected by CP.
       */
      RandomAccessibleInterval<BitType> adapter = mask;
      long [] offset = new long[display.numDimensions()];
      AxisType [] dAxes = new AxisType [] { Axes.Y, Axes.X };
       
      for (int j=0; j<dAxes.length; j++) {
        int i = overlay.dimensionIndex(dAxes[j]);
        offset[j] = display.getLongPosition(dAxes[j]) - oView.getLongPosition(dAxes[j]);
        if (i != j) {
          /*
           * Perform an axis permutation.
           */
          adapter = Views.permute(adapter, j, i);
View Full Code Here

TOP

Related Classes of net.imagej.display.OverlayView

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.