AxisUtils { public static <S extends AnnotatedSpace<A>, A extends TypedAxis> boolean hasTimeDimensions(final S space) { return axisStream(space).anyMatch(a -> a.type() == Axes.TIME); } private  AxisUtils(); static long countSpatialDimensions(final S space); static Optional<String> getSpatialUnit(final S space, final UnitService unitService); static boolean hasChannelDimensions(final S space); static boolean hasSpatialDimensions(final S space); static boolean hasTimeDimensions(final S space); static boolean isSpatialCalibrationsIsotropic(final S space, final double tolerance,
			final UnitService unitService);  }
@Test public void testHasTimeDimensions() { final DefaultLinearAxis xAxis = new DefaultLinearAxis(Axes.X); final DefaultLinearAxis yAxis = new DefaultLinearAxis(Axes.Y); final DefaultLinearAxis tAxis = new DefaultLinearAxis(Axes.TIME); final Img<DoubleType> img = ArrayImgs.doubles(1, 1, 1); final ImgPlus<DoubleType> imgPlus = new ImgPlus<>(img, "Test image", xAxis, yAxis, tAxis); final boolean result = AxisUtils.hasTimeDimensions(imgPlus); assertTrue("Should be true when image has time dimensions", result); }
@Test(expected = NullPointerException.class) public void testHasTimeDimensionsThrowsNPEIfSpaceNull() { AxisUtils.hasTimeDimensions(null); }