@Test public void testViewMeta() { final AxisType[] expectedTypes = { W_TYPE, Axes.CHANNEL, Axes.TIME }; final Iterator<long[]> expectedPositions = Stream.of(new long[] { 0, 0, 0 }, new long[] { 1, 0, 0 }, new long[] { 0, 1, 0 }, new long[] { 1, 1, 0 }, new long[] { 0, 0, 1 }, new long[] { 1, 0, 1 }, new long[] { 0, 1, 1 }, new long[] { 1, 1, 1 }).iterator(); final Iterator<String> expectedStrings = Stream.of( "W: 0, Channel: 1, Time: 1", "W: 1, Channel: 1, Time: 1", "W: 0, Channel: 2, Time: 1", "W: 1, Channel: 2, Time: 1", "W: 0, Channel: 1, Time: 2", "W: 1, Channel: 1, Time: 2", "W: 0, Channel: 2, Time: 2", "W: 1, Channel: 2, Time: 2").iterator(); final Img<ByteType> img = ArrayImgs.bytes(2, 2, 2, 2, 2, 2); final ImgPlus<ByteType> imgPlus = new ImgPlus<>(img, "", X_AXIS, Y_AXIS, Z_AXIS, W_AXIS, C_AXIS, T_AXIS); final List<Subspace<ByteType>> subspaces = HyperstackUtils.split3DSubspaces( imgPlus).collect(Collectors.toList()); subspaces.forEach(subspace -> { assertArrayEquals(expectedTypes, subspace.getAxisTypes().toArray()); assertArrayEquals(expectedPositions.next(), subspace.getPosition() .toArray()); assertEquals(expectedStrings.next(), subspace.toString()); }); }
public static <T extends RealType<T> & NativeType<T>> Stream<Subspace<T>> split3DSubspaces(final ImgPlus<T> hyperStack) { return splitSubspaces(hyperStack, Arrays.asList(Axes.X, Axes.Y, Axes.Z)); }
HyperstackUtils { public static <T extends RealType<T> & NativeType<T>> Stream<Subspace<T>> split3DSubspaces(final ImgPlus<T> hyperStack) { return splitSubspaces(hyperStack, Arrays.asList(Axes.X, Axes.Y, Axes.Z)); } }
HyperstackUtils { public static <T extends RealType<T> & NativeType<T>> Stream<Subspace<T>> split3DSubspaces(final ImgPlus<T> hyperStack) { return splitSubspaces(hyperStack, Arrays.asList(Axes.X, Axes.Y, Axes.Z)); } private  HyperstackUtils(); }
HyperstackUtils { public static <T extends RealType<T> & NativeType<T>> Stream<Subspace<T>> split3DSubspaces(final ImgPlus<T> hyperStack) { return splitSubspaces(hyperStack, Arrays.asList(Axes.X, Axes.Y, Axes.Z)); } private  HyperstackUtils(); static Stream<Subspace<T>> split3DSubspaces(final ImgPlus<T> hyperStack); static Stream<Subspace<T>> splitSubspaces(final ImgPlus<T> hyperStack,
			final Collection<AxisType> subspaceTypes); }
HyperstackUtils { public static <T extends RealType<T> & NativeType<T>> Stream<Subspace<T>> split3DSubspaces(final ImgPlus<T> hyperStack) { return splitSubspaces(hyperStack, Arrays.asList(Axes.X, Axes.Y, Axes.Z)); } private  HyperstackUtils(); static Stream<Subspace<T>> split3DSubspaces(final ImgPlus<T> hyperStack); static Stream<Subspace<T>> splitSubspaces(final ImgPlus<T> hyperStack,
			final Collection<AxisType> subspaceTypes);  }