vitrio 0.1.4
High-throughput image I/O for Cryo-Electron Microscopy (CryoEM)
Loading...
Searching...
No Matches
Public Member Functions | Static Public Attributes | Friends | List of all members
vitrio::image_location Class Reference

Address of an image file, or of one image or volume of a stack. More...

#include <vitrio/image_location.hpp>

Public Member Functions

 image_location (std::string key, std::size_t index_in_stack=no_stack_index)
 Construct a location from its components.
 
 image_location () noexcept
 Construct a location with an empty key and no index.
 
 image_location (const image_location &other)
 
 image_location (image_location &&other) noexcept
 
image_location & operator= (const image_location &other)
 
image_location & operator= (image_location &&other) noexcept
 
std::size_t hash () const noexcept
 Get the hash value for this location.
 
const std::string & get_key () const noexcept
 Get the key of the file.
 
std::size_t get_index_in_stack () const noexcept
 Get the index of the image or volume within the stack.
 
bool has_index_in_stack () const noexcept
 Check whether this addresses one image or volume of its file rather than the file as a whole.
 

Static Public Attributes

static constexpr std::size_t no_stack_index
 Index addressing the file as a whole rather than one image or volume of it.
 

Friends

bool operator== (const image_location &lhs, const image_location &rhs) noexcept
 
bool operator!= (const image_location &lhs, const image_location &rhs) noexcept
 
bool operator< (const image_location &lhs, const image_location &rhs) noexcept
 
bool operator<= (const image_location &lhs, const image_location &rhs) noexcept
 
bool operator> (const image_location &lhs, const image_location &rhs) noexcept
 
bool operator>= (const image_location &lhs, const image_location &rhs) noexcept
 
std::ostream & operator<< (std::ostream &os, const image_location &location)
 

Detailed Description

Address of an image file, or of one image or volume of a stack.

The pair of the key of a file and a zero based index along the axis the file stacks along, its slowest. The index no_stack_index addresses the file as a whole instead, which is how a file holding a single image or volume is named.

The key is what a provider is asked for the file with. It is often the path of the file, and it is held as a plain string.

See also
parse_image_location

Constructor & Destructor Documentation

◆ image_location()

vitrio::image_location::image_location ( std::string  key,
std::size_t  index_in_stack = no_stack_index 
)
explicit

Construct a location from its components.

Parameters
keyKey of the file, such as its path.
index_in_stackZero based index of the image or volume along the slowest axis of the file, or no_stack_index to address the whole file.

Member Function Documentation

◆ get_index_in_stack()

std::size_t vitrio::image_location::get_index_in_stack ( ) const
noexcept

Get the index of the image or volume within the stack.

Returns
std::size_t The zero based index along the slowest axis of the file, or no_stack_index when the location addresses the file as a whole.

◆ get_key()

const std::string & vitrio::image_location::get_key ( ) const
noexcept

Get the key of the file.

Returns
const std::string& Reference to the stored key. The reference is valid for the lifetime of this image_location and is invalidated by assignment to or destruction of the object.

◆ has_index_in_stack()

bool vitrio::image_location::has_index_in_stack ( ) const
noexcept

Check whether this addresses one image or volume of its file rather than the file as a whole.

Returns
true It carries an index along the slowest axis of the file.
false Its index in the stack is no_stack_index.

◆ hash()

std::size_t vitrio::image_location::hash ( ) const
noexcept

Get the hash value for this location.

Returns
std::size_t The hash value.

Member Data Documentation

◆ no_stack_index

constexpr std::size_t vitrio::image_location::no_stack_index
staticconstexpr
Initial value:
=
std::numeric_limits<std::size_t>::max()

Index addressing the file as a whole rather than one image or volume of it.


The documentation for this class was generated from the following file: