public class UnitConverter extends Object
Constructor and Description |
---|
UnitConverter(Resolution resolution) |
Modifier and Type | Method and Description |
---|---|
double |
fromPhysicalArea(double value)
Converts from physical-area to pixels.
|
double |
fromPhysicalArea(double value,
String unitType)
Converts from physical-area to pixels.
|
double |
fromPhysicalDistance(double value)
Converts from physical-distance to voxels.
|
double |
fromPhysicalDistance(double value,
DirectionVector direction)
Converts from physical-distance to voxels.
|
double |
fromPhysicalVolume(double value)
Converts from physical-volume to voxels.
|
double |
fromPhysicalVolume(double value,
String unitType)
Converts from physical-volume to voxels.
|
double |
toPhysicalArea(double value)
Converts an area from square voxels to square meters.
|
double |
toPhysicalArea(double value,
String unitType)
Converts an area from square voxels to physical units.
|
double |
toPhysicalDistance(double value,
DirectionVector direction)
Converts a distance from voxels to meters.
|
double |
toPhysicalDistance(double value,
DirectionVector direction,
String unitType)
Converts a distance from voxels to physical units.
|
double |
toPhysicalVolume(double value)
Converts a volume from cubic voxels to cubic meters.
|
double |
toPhysicalVolume(double value,
String unitType)
Converts a volume from cubic voxels to physical units.
|
public UnitConverter(Resolution resolution)
public double toPhysicalArea(double value)
value
- the area in square voxelspublic double toPhysicalArea(double value, String unitType)
value
- the area in square voxelsunitType
- unit-type to convert to ala SpatialUnits
.unitType
).public double toPhysicalVolume(double value)
value
- the volume in cubic voxelspublic double toPhysicalVolume(double value, String unitType)
value
- the volume in cubic voxelsunitType
- unit-type to convert to ala SpatialUnits
.unitType
).public double toPhysicalDistance(double value, DirectionVector direction)
value
- the distance in voxelsdirection
- the direction in which the distance is measuredpublic double toPhysicalDistance(double value, DirectionVector direction, String unitType)
value
- the distance in voxelsdirection
- the direction in which the distance is measuredunitType
- unit-type to convert to ala SpatialUnits
.unitType
).public double fromPhysicalVolume(double value)
The physical unit-type is assumed to be cubic-meters.
value
- the value in physical unitspublic double fromPhysicalVolume(double value, String unitType)
value
- the value in physical unitsunitType
- unit-type of value ala SpatialUnits
public double fromPhysicalArea(double value)
The physical unit-type is assumed to be square-meters.
value
- the value in physical unitspublic double fromPhysicalArea(double value, String unitType)
value
- the value in physical unitsunitType
- physical-unit type ala SpatialUnits
public double fromPhysicalDistance(double value, DirectionVector direction)
The physical unit-type is assumed to be meters.
value
- the value in physical unitsdirection
- the direction in which the distance is measuredpublic double fromPhysicalDistance(double value)
The physical unit-type is assumed to be meters, and the direction of the distance is assumed to be along the X axis.
value
- the value in physical unitsCopyright © 2010–2023 Owen Feehan, ETH Zurich, University of Zurich, Hoffmann-La Roche. All rights reserved.