Class UnitConverter
Object
UnitConverter
Converts from voxelized units to different physical measurements of area / volume / distance.
- Author:
- Owen Feehan
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondoublefromPhysicalArea(double value) Converts from physical-area to pixels.doublefromPhysicalArea(double value, String unitType) Converts from physical-area to pixels.doublefromPhysicalDistance(double value) Converts from physical-distance to voxels.doublefromPhysicalDistance(double value, DirectionVector direction) Converts from physical-distance to voxels.doublefromPhysicalVolume(double value) Converts from physical-volume to voxels.doublefromPhysicalVolume(double value, String unitType) Converts from physical-volume to voxels.doubletoPhysicalArea(double value) Converts an area from square voxels to square meters.doubletoPhysicalArea(double value, String unitType) Converts an area from square voxels to physical units.doubletoPhysicalDistance(double value, DirectionVector direction) Converts a distance from voxels to meters.doubletoPhysicalDistance(double value, DirectionVector direction, String unitType) Converts a distance from voxels to physical units.doubletoPhysicalVolume(double value) Converts a volume from cubic voxels to cubic meters.doubletoPhysicalVolume(double value, String unitType) Converts a volume from cubic voxels to physical units.
-
Constructor Details
-
UnitConverter
Creates a newUnitConverterinstance.- Parameters:
resolution- The image-resolution used to resolve physical measurements in different directions.
-
-
Method Details
-
toPhysicalArea
public double toPhysicalArea(double value) Converts an area from square voxels to square meters.- Parameters:
value- the area in square voxels- Returns:
- the area converted into square meters.
-
toPhysicalArea
Converts an area from square voxels to physical units.- Parameters:
value- the area in square voxelsunitType- unit-type to convert to alaSpatialUnits.- Returns:
- the area converted into physical units (of type
unitType).
-
toPhysicalVolume
public double toPhysicalVolume(double value) Converts a volume from cubic voxels to cubic meters.- Parameters:
value- the volume in cubic voxels- Returns:
- the volume converted into cubic meters.
-
toPhysicalVolume
Converts a volume from cubic voxels to physical units.- Parameters:
value- the volume in cubic voxelsunitType- unit-type to convert to alaSpatialUnits.- Returns:
- the volume converted into physical units (of type
unitType).
-
toPhysicalDistance
Converts a distance from voxels to meters.- Parameters:
value- the distance in voxelsdirection- the direction in which the distance is measured- Returns:
- the distance converted into meters.
-
toPhysicalDistance
Converts a distance from voxels to physical units.- Parameters:
value- the distance in voxelsdirection- the direction in which the distance is measuredunitType- unit-type to convert to alaSpatialUnits.- Returns:
- the distance converted into physical units (of type
unitType).
-
fromPhysicalVolume
public double fromPhysicalVolume(double value) Converts from physical-volume to voxels.The physical unit-type is assumed to be cubic-meters.
- Parameters:
value- the value in physical units- Returns:
- the area converted into voxels.
-
fromPhysicalVolume
Converts from physical-volume to voxels.- Parameters:
value- the value in physical unitsunitType- unit-type of value alaSpatialUnits- Returns:
- the area converted into voxels.
-
fromPhysicalArea
public double fromPhysicalArea(double value) Converts from physical-area to pixels.The physical unit-type is assumed to be square-meters.
- Parameters:
value- the value in physical units- Returns:
- the area converted into pixels.
-
fromPhysicalArea
Converts from physical-area to pixels.- Parameters:
value- the value in physical unitsunitType- physical-unit type alaSpatialUnits- Returns:
- the area converted into pixels.
-
fromPhysicalDistance
Converts from physical-distance to voxels.The physical unit-type is assumed to be meters.
- Parameters:
value- the value in physical unitsdirection- the direction in which the distance is measured- Returns:
- the distance converted into voxels.
-
fromPhysicalDistance
public double fromPhysicalDistance(double value) Converts from physical-distance to voxels.The physical unit-type is assumed to be meters, and the direction of the distance is assumed to be along the X axis.
- Parameters:
value- the value in physical units- Returns:
- the distance converted into voxels.
-