Package net.imagej.display

Examples of net.imagej.display.ImageDisplay


  @Test
  public final void testExtractMask() {
    Dataset dataset = getDatasetService().create(new long [] { 15, 25 }, "Foo", new AxisType [] { Axes.X, Axes.Y }, 8, true, false);
    Display<?> display = getDisplayService().createDisplay(getImageDisplayService().createDataView(dataset));
    assertTrue(display instanceof ImageDisplay);
    ImageDisplay iDisplay = (ImageDisplay)display;
    RectangleOverlay o = new RectangleOverlay(context.getContext());
    o.setOrigin(5, 0);
    o.setOrigin(16, 1);
    o.setExtent(6, 0);
    o.setExtent(7, 1);
View Full Code Here


      }
    };
    Dataset dataset = getDatasetService().create(new long [] { 30, 30 }, "Foo", new AxisType [] { Axes.X, Axes.Y }, 8, true, false);
    Display<?> display = getDisplayService().createDisplay(getImageDisplayService().createDataView(dataset));
    assertTrue(display instanceof ImageDisplay);
    ImageDisplay iDisplay = (ImageDisplay)display;
    getOverlayService().addOverlays(iDisplay, Collections.singletonList((Overlay)o));
    for (DataView v:iDisplay) {
      v.setSelected(true);
    }
    Img<BitType> mask = OverlayUtils.extractMask(iDisplay);
View Full Code Here

  public void testNoOverlay() {
    // Make sure that extractMask returns null if no overlay.
    Dataset dataset = getDatasetService().create(new long [] { 30, 30 }, "Foo", new AxisType [] { Axes.X, Axes.Y }, 8, true, false);
    Display<?> display = getDisplayService().createDisplay(getImageDisplayService().createDataView(dataset));
    assertTrue(display instanceof ImageDisplay);
    ImageDisplay iDisplay = (ImageDisplay)display;
    for (DataView v:iDisplay) {
      v.setSelected(true);
    }
    assertNull(OverlayUtils.extractMask(iDisplay));
  }
View Full Code Here

  @Test
  public void testDeselectedOverlay() {
    Dataset dataset = getDatasetService().create(new long [] { 15, 25 }, "Foo", new AxisType [] { Axes.X, Axes.Y }, 8, true, false);
    Display<?> display = getDisplayService().createDisplay(getImageDisplayService().createDataView(dataset));
    assertTrue(display instanceof ImageDisplay);
    ImageDisplay iDisplay = (ImageDisplay)display;
    RectangleOverlay o = new RectangleOverlay(context.getContext());
    o.setOrigin(5, 0);
    o.setOrigin(3, 1);
    o.setExtent(6, 0);
    o.setExtent(7, 1);
View Full Code Here

  @Test
  public void testTwoOverlays() {
    Dataset dataset = getDatasetService().create(new long [] { 30, 30 }, "Foo", new AxisType [] { Axes.X, Axes.Y }, 8, true, false);
    Display<?> display = getDisplayService().createDisplay(getImageDisplayService().createDataView(dataset));
    assertTrue(display instanceof ImageDisplay);
    ImageDisplay iDisplay = (ImageDisplay)display;
    final ArrayList<Overlay> oo = new ArrayList<Overlay>();
    for (double [][] coords:new double [][][] {
        { { 5, 6}, { 3, 7 }},
        { { 1, 4}, { 14, 5}}
    }) {
View Full Code Here

TOP

Related Classes of net.imagej.display.ImageDisplay

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.