Package qupath.lib.images.servers
Class PixelCalibration
java.lang.Object
qupath.lib.images.servers.PixelCalibration
Class used to represent pixel sizes.
 
Currently only 'pixel' and 'µm' units are supported.
- 
Nested Class SummaryNested Classes
- 
Field SummaryFields
- 
Method SummaryModifier and TypeMethodDescriptioncreateScaledInstance(double scaleX, double scaleY) Get a scaled instance of this PixelCalibration, multiplying pixel sizes for x and y by the specified scale values.createScaledInstance(double scaleX, double scaleY, double scaleZ) Get a scaled instance of this PixelCalibration, multiplying pixel sizes for x, y and z by the specified scale values.booleanGet an average ofgetPixelWidth()andgetPixelHeight().doubleGet the average of the pixel width and height in microns if possible, or Double.NaN if the pixel size is not available.static PixelCalibrationGet the default PixelCalibration.Get the numeric value representing the pixel height, in the stored units.doubleGet the pixel height in microns, or Double.NaN if this is unknown.Get a String representation of the preferred pixel height unit.Get the numeric value representing the pixel width, in the stored units.doubleGet the pixel width in microns, or Double.NaN if this is unknown.Get a String representation of the preferred pixel width unit.doublegetTimepoint(int ind) Get the time for the specified time point, or Double.NaN if this is unknown.Get the time unit for a time series.Get the numeric value representing the z-spacing, in the stored units.doubleGet the z-spacing in microns, or Double.NaN if this is unknown.Get a String representation of the preferred z-spacing unit.inthashCode()booleanReturns true if the pixel width and height information in microns is known.booleanReturns true if the z-spacing is known in microns.intGet the number of known time points.toString()booleanReturns true if the units for pixel width and height are the same.booleanReturns true if the units for pixel width, height and z-spacing are the same.
- 
Field Details- 
PIXELString to represent 'pixel' units. This is the default when no pixel size calibration is known.- See Also:
 
- 
MICROMETERString to represent 'micrometer' units.
- 
Z_SLICEString to represent 'z-slice' units.- See Also:
 
 
- 
- 
Method Details- 
createScaledInstanceGet a scaled instance of this PixelCalibration, multiplying pixel sizes for x and y by the specified scale values. Units are kept the same.- Parameters:
- scaleX-
- scaleY-
- Returns:
 
- 
createScaledInstanceGet a scaled instance of this PixelCalibration, multiplying pixel sizes for x, y and z by the specified scale values. Units are kept the same.- Parameters:
- scaleX-
- scaleY-
- scaleZ-
- Returns:
 
- 
getTimeUnitGet the time unit for a time series.- Returns:
 
- 
nTimepointspublic int nTimepoints()Get the number of known time points.- Returns:
 
- 
getTimepointpublic double getTimepoint(int ind) Get the time for the specified time point, or Double.NaN if this is unknown.- Parameters:
- ind-
- Returns:
 
- 
hasPixelSizeMicronspublic boolean hasPixelSizeMicrons()Returns true if the pixel width and height information in microns is known.- Returns:
 
- 
hasZSpacingMicronspublic boolean hasZSpacingMicrons()Returns true if the z-spacing is known in microns.- Returns:
 
- 
getAveragedPixelSizeMicronspublic double getAveragedPixelSizeMicrons()Get the average of the pixel width and height in microns if possible, or Double.NaN if the pixel size is not available.- Returns:
 
- 
getZSpacingMicronspublic double getZSpacingMicrons()Get the z-spacing in microns, or Double.NaN if this is unknown.- Returns:
 
- 
getPixelWidthMicronspublic double getPixelWidthMicrons()Get the pixel width in microns, or Double.NaN if this is unknown.- Returns:
 
- 
getPixelHeightMicronspublic double getPixelHeightMicrons()Get the pixel height in microns, or Double.NaN if this is unknown.- Returns:
 
- 
getPixelWidthUnitGet a String representation of the preferred pixel width unit.- Returns:
- See Also:
 
- 
unitsMatch2Dpublic boolean unitsMatch2D()Returns true if the units for pixel width and height are the same.- Returns:
 
- 
unitsMatch3Dpublic boolean unitsMatch3D()Returns true if the units for pixel width, height and z-spacing are the same.- Returns:
 
- 
getPixelHeightUnitGet a String representation of the preferred pixel height unit.- Returns:
- See Also:
 
- 
getZSpacingUnitGet a String representation of the preferred z-spacing unit.- Returns:
- See Also:
 
- 
getAveragedPixelSizeGet an average ofgetPixelWidth()andgetPixelHeight(). No check is made to ensure that these are returned in the same units; rather, the numbers are simply averaged.- Returns:
 
- 
getPixelWidthGet the numeric value representing the pixel width, in the stored units.- Returns:
- See Also:
 
- 
getPixelHeightGet the numeric value representing the pixel height, in the stored units.- Returns:
- See Also:
 
- 
getZSpacingGet the numeric value representing the z-spacing, in the stored units.- Returns:
- See Also:
 
- 
toString
- 
getDefaultInstanceGet the default PixelCalibration. This isn't terribly informative, giving pixel sizes in pixel units.- Returns:
 
- 
hashCodepublic int hashCode()
- 
equals
 
-