@Test(expected = NullPointerException.class) public void testGetUnitHeaderThrowsNPEIfUnitServiceNull() { final Img<DoubleType> img = ArrayImgs.doubles(10); final ImgPlus<DoubleType> imgPlus = new ImgPlus<>(img, "Test image", new DefaultLinearAxis(Axes.X, "mm")); ResultUtils.getUnitHeader(imgPlus, null, '³'); }
public static <S extends AnnotatedSpace<CalibratedAxis>> String getUnitHeader( final S space, final UnitService unitService, final char exponent) { final Optional<String> unit = AxisUtils.getSpatialUnit(space, unitService); if (!unit.isPresent()) { return ""; } final String unitHeader = unit.get(); if (unitHeader.isEmpty()) { return ""; } return "(" + unitHeader + exponent + ")"; }
ResultUtils { public static <S extends AnnotatedSpace<CalibratedAxis>> String getUnitHeader( final S space, final UnitService unitService, final char exponent) { final Optional<String> unit = AxisUtils.getSpatialUnit(space, unitService); if (!unit.isPresent()) { return ""; } final String unitHeader = unit.get(); if (unitHeader.isEmpty()) { return ""; } return "(" + unitHeader + exponent + ")"; } }
ResultUtils { public static <S extends AnnotatedSpace<CalibratedAxis>> String getUnitHeader( final S space, final UnitService unitService, final char exponent) { final Optional<String> unit = AxisUtils.getSpatialUnit(space, unitService); if (!unit.isPresent()) { return ""; } final String unitHeader = unit.get(); if (unitHeader.isEmpty()) { return ""; } return "(" + unitHeader + exponent + ")"; } private  ResultUtils(); }
ResultUtils { public static <S extends AnnotatedSpace<CalibratedAxis>> String getUnitHeader( final S space, final UnitService unitService, final char exponent) { final Optional<String> unit = AxisUtils.getSpatialUnit(space, unitService); if (!unit.isPresent()) { return ""; } final String unitHeader = unit.get(); if (unitHeader.isEmpty()) { return ""; } return "(" + unitHeader + exponent + ")"; } private  ResultUtils(); static char getExponent(final S space); static String getSizeDescription(final S space); static String getUnitHeader(
		final S space, final UnitService unitService, final char exponent); static String getUnitHeader(final ImagePlus imagePlus); static long toConventionalIndex(final AxisType type,
		final long index); }
ResultUtils { public static <S extends AnnotatedSpace<CalibratedAxis>> String getUnitHeader( final S space, final UnitService unitService, final char exponent) { final Optional<String> unit = AxisUtils.getSpatialUnit(space, unitService); if (!unit.isPresent()) { return ""; } final String unitHeader = unit.get(); if (unitHeader.isEmpty()) { return ""; } return "(" + unitHeader + exponent + ")"; } private  ResultUtils(); static char getExponent(final S space); static String getSizeDescription(final S space); static String getUnitHeader(
		final S space, final UnitService unitService, final char exponent); static String getUnitHeader(final ImagePlus imagePlus); static long toConventionalIndex(final AxisType type,
		final long index);  }