@Test public void testGetUnitHeader() { final String unit = "mm"; final char exponent = '³'; final DefaultLinearAxis axis = new DefaultLinearAxis(Axes.X, unit); final Img<DoubleType> img = ArrayImgs.doubles(10); final ImgPlus<DoubleType> imgPlus = new ImgPlus<>(img, "Test image", axis); final String result = ResultUtils.getUnitHeader(imgPlus, unitService, exponent); assertEquals("Unexpected unit header", "(" + unit + exponent + ")", result); }
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);  }