public final class AxisUtils extends Object
Modifier and Type | Method and Description |
---|---|
static <S extends AnnotatedSpace<A>,A extends TypedAxis> |
countSpatialDimensions(S space)
Counts the number of spatial dimensions in the given space.
|
static <S extends AnnotatedSpace<C>,C extends CalibratedAxis> |
getSpatialUnit(S space,
UnitService unitService)
Returns the common unit of the spatial calibrations of the given space.
|
static <S extends AnnotatedSpace<A>,A extends TypedAxis> |
hasChannelDimensions(S space)
Checks if the given space has a channel dimension.
|
static <S extends AnnotatedSpace<A>,A extends TypedAxis> |
hasSpatialDimensions(S space)
Checks if the given space has any spatial dimensions.
|
static <S extends AnnotatedSpace<A>,A extends TypedAxis> |
hasTimeDimensions(S space)
Checks if the given space has a time dimension.
|
static <S extends AnnotatedSpace<A>,A extends CalibratedAxis> |
isSpatialCalibrationsIsotropic(S space,
double tolerance,
UnitService unitService)
Checks if the spatial axes in the space have the same i.e.
|
public static <S extends AnnotatedSpace<A>,A extends TypedAxis> long countSpatialDimensions(S space)
S
- type of the space.A
- type of axes in the space.space
- an N-dimensional space.public static <S extends AnnotatedSpace<C>,C extends CalibratedAxis> Optional<String> getSpatialUnit(S space, UnitService unitService) throws IllegalArgumentException
The common unit is the unit of the first spatial axis if it can be converted to the units of the other axes.
S
- type of the space.C
- type of axis in the spacespace
- an n-dimensional space with calibrated axes.unitService
- an UnitService
to convert axis calibrations.IllegalArgumentException
- if space has no spatial axes.public static <S extends AnnotatedSpace<A>,A extends TypedAxis> boolean hasChannelDimensions(S space)
S
- type of the space.A
- type of axes in the space.space
- an N-dimensional space.public static <S extends AnnotatedSpace<A>,A extends TypedAxis> boolean hasSpatialDimensions(S space)
S
- type of the space.A
- type of axes in the space.space
- an N-dimensional space.public static <S extends AnnotatedSpace<A>,A extends TypedAxis> boolean hasTimeDimensions(S space)
S
- type of the space.A
- type of axes in the space.space
- an N-dimensional space.public static <S extends AnnotatedSpace<A>,A extends CalibratedAxis> boolean isSpatialCalibrationsIsotropic(S space, double tolerance, UnitService unitService) throws IllegalArgumentException
If calibrations are isotropic, then the values returned by
CalibratedAxis.averageScale(double, double)
differ only within the
given tolerance. For example, if X-axis scale = 1.00, Y-axis
scale = 1.02, and tolerance = 0.03, then calibration is
isotropic.
NB if the calibrations of the axes are not in the same unit, the method tries to convert them to the unit of the first spatial axis (x-axis).
S
- type of the spaceA
- type of the axes in the spacespace
- a space with spatial axestolerance
- tolerance for anisotropy in scalingunitService
- service to convert between units of calibrationIllegalArgumentException
- if tolerance is negative or NaN, or
calibration units cannot be convertedCopyright © 2018–2022 BoneJ. All rights reserved.