Struct openslide::properties::Properties
source · pub struct Properties { /* private fields */ }
Expand description
This struct defines an inferface to the various properties of the various formats.
These properties are also available as a HashMap<String, String>
which can be obtained with
the OpenSlide::get_properties()
method. However, this way of interacting with the property
values is not ideal, hence this struct. Motivation:
- Get the values with fitting types in stead of Strings, ready to be used straight away.
- Every property is easier to document.
- More convenient naming (arguable).
Many formats implements openslide properties (openslide.<property>
in the HashMap returned by
the OpenSlide::get_properties()
method), and many formats also implements some Tiff
properties (openslide.<property>
in the HashMap returned by the OpenSlide::get_properties()
method). Then there are properties that are unique to each format (it may be the same
properties, but with different naming conventions etc.). This interface gives the programmer
access to all (known) properties (if some exists and are not implemented here, this is a bug).
If some property does not exist for some slide, the method for this property returns None
.
What properties that are available to each slide is somewhat arbitrary (or, at least unknown to
the author of this library per now), so in order to discover available properties, you can
print the result of the OpenSlide::get_properties()
method, or use the
Properties::print_available()
method (recommended).
Implementations§
source§impl Properties
impl Properties
sourcepub fn new(property_map: &HashMap<String, String>) -> Self
pub fn new(property_map: &HashMap<String, String>) -> Self
Initialises a new Properties
struct.
This is done by submitting a property_map, which is obtained from the
OpenSlide::get_properties()
method, but this is abstracted away from the user, and
happens automatically when defining an OpenSlide
struct.
sourcepub fn print_available(&self)
pub fn print_available(&self)
Print available properties (key, value) (where the value is not None
).
OpenSlide properties
sourcepub fn quickhash_1(&self) -> Option<String>
pub fn quickhash_1(&self) -> Option<String>
Quickhash 1
sourcepub fn objective_power(&self) -> Option<u32>
pub fn objective_power(&self) -> Option<u32>
Objective power
sourcepub fn level_count(&self) -> Option<u32>
pub fn level_count(&self) -> Option<u32>
Number of zoom levels
sourcepub fn levels(&self) -> Option<Vec<LevelProperties>>
pub fn levels(&self) -> Option<Vec<LevelProperties>>
Vector of level-dependent properties. The position in the returned vector corresponds to the zoom level.
Tiff properties
pub fn image_description(&self) -> Option<String>
pub fn software(&self) -> Option<String>
pub fn date_time(&self) -> Option<String>
pub fn make(&self) -> Option<String>
sourcepub fn x_resolution(&self) -> Option<f32>
pub fn x_resolution(&self) -> Option<f32>
Resolution in the x direction
sourcepub fn y_resolution(&self) -> Option<f32>
pub fn y_resolution(&self) -> Option<f32>
Resolution in the y direction
sourcepub fn resolution_unit(&self) -> Option<String>
pub fn resolution_unit(&self) -> Option<String>
Resolution unit (e.g. centimeter or inch)
Aperio properties
sourcepub fn scan_scope_id(&self) -> Option<String>
pub fn scan_scope_id(&self) -> Option<String>
ScanScope id
sourcepub fn icc_profile(&self) -> Option<String>
pub fn icc_profile(&self) -> Option<String>
ICC profile
sourcepub fn original_height(&self) -> Option<u32>
pub fn original_height(&self) -> Option<u32>
Slide height
sourcepub fn original_width(&self) -> Option<u32>
pub fn original_width(&self) -> Option<u32>
Slide width
pub fn top(&self) -> Option<f32>
pub fn left(&self) -> Option<f32>
sourcepub fn line_camera_skew(&self) -> Option<f32>
pub fn line_camera_skew(&self) -> Option<f32>
Line camera skew
sourcepub fn line_area_x_offset(&self) -> Option<f32>
pub fn line_area_x_offset(&self) -> Option<f32>
Line area offset in horizontal(?) direction
sourcepub fn line_area_y_offset(&self) -> Option<f32>
pub fn line_area_y_offset(&self) -> Option<f32>
Line area offset in vertical(?) direction
sourcepub fn focus_offset(&self) -> Option<f32>
pub fn focus_offset(&self) -> Option<f32>
Focus offset
pub fn app_mag(&self) -> Option<u32>
sourcepub fn stripe_width(&self) -> Option<u32>
pub fn stripe_width(&self) -> Option<u32>
Scan stripe width
pub fn filtered(&self) -> Option<u32>
Trait Implementations§
source§impl Clone for Properties
impl Clone for Properties
source§fn clone(&self) -> Properties
fn clone(&self) -> Properties
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more