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

The shape and data type of the values an image file holds. More...

#include <vitrio/image_descriptor.hpp>

Public Member Functions

 image_descriptor (span< const std::size_t > extents, std::size_t core_rank, numerical_type data_type)
 Construct a descriptor from its components.
 
 image_descriptor (const image_descriptor &other)
 
 image_descriptor (image_descriptor &&other) noexcept
 
image_descriptor & operator= (const image_descriptor &other)
 
image_descriptor & operator= (image_descriptor &&other) noexcept
 
std::size_t hash () const noexcept
 Get the hash value for this descriptor.
 
span< const std::size_t > get_extents () const noexcept
 Get the extents of the file.
 
std::size_t get_core_rank () const noexcept
 Get how many of the extents are one image or volume.
 
numerical_type get_data_type () const noexcept
 Get the data type of the elements.
 

Friends

bool operator== (const image_descriptor &lhs, const image_descriptor &rhs) noexcept
 
bool operator!= (const image_descriptor &lhs, const image_descriptor &rhs) noexcept
 

Detailed Description

The shape and data type of the values an image file holds.

The extents alone do not tell a stack of N images from one volume of N planes, since both are (N,H,W). The core rank does: two for the stack, three for the volume.

How the values are laid out within the extents is not part of it.

See also
get_core_extents

Constructor & Destructor Documentation

◆ image_descriptor()

vitrio::image_descriptor::image_descriptor ( span< const std::size_t >  extents,
std::size_t  core_rank,
numerical_type  data_type 
)

Construct a descriptor from its components.

Parameters
extentsExtents of the file, slowest axis first.
core_rankHow many trailing extents are one image or volume.
data_typeData type of the elements.
Exceptions
std::invalid_argumentIf core_rank is zero or exceeds the rank of extents, or if data_type is unknown.

Member Function Documentation

◆ get_core_rank()

std::size_t vitrio::image_descriptor::get_core_rank ( ) const
noexcept

Get how many of the extents are one image or volume.

Returns
std::size_t The rank of one image or volume. Never zero, and never above the rank of get_extents.

◆ get_data_type()

numerical_type vitrio::image_descriptor::get_data_type ( ) const
noexcept

Get the data type of the elements.

Returns
numerical_type The data type. Never unknown.

◆ get_extents()

span< const std::size_t > vitrio::image_descriptor::get_extents ( ) const
noexcept

Get the extents of the file.

Returns
span<const std::size_t> The extents, slowest axis first. It refers to storage owned by this descriptor.

◆ hash()

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

Get the hash value for this descriptor.

Returns
std::size_t The hash value.

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