Esempio n. 1
0
  @Test
  public void testStackedFile() throws ScanFileHolderException {
    ILazyDataset image =
        new TIFFImageLoader(TestFileFolder + "untitled1020.TIF").loadFile().getLazyDataset(0);
    Assert.assertArrayEquals("Shape not equal", new int[] {3, 2048, 2048}, image.getShape());

    IDataset d = image.getSlice(new Slice(1));
    Assert.assertArrayEquals("Shape not equal", new int[] {1, 2048, 2048}, d.getShape());
    Assert.assertEquals("Type is int32", Integer.class, d.elementClass());

    d = image.getSlice(new Slice(1, 3), new Slice(1));
    Assert.assertArrayEquals("Shape not equal", new int[] {2, 1, 2048}, d.getShape());
    Assert.assertEquals("Type is int32", Integer.class, d.elementClass());

    d = image.getSlice(new Slice(1, 3), new Slice(null, null, 4), new Slice(2, 25));
    Assert.assertArrayEquals("Shape not equal", new int[] {2, 512, 23}, d.getShape());
    Assert.assertEquals("Type is int32", Integer.class, d.elementClass());
  }