ome-files  0.5.0
Namespaces | Classes | Typedefs | Enumerations | Functions | Variables
ome::files Namespace Reference

OME-Files image reading and writing. More...

Namespaces

 detail
 Implementation details.
 
 in
 Reader implementations.
 
 tiff
 TIFF file format (libtiff wrapper).
 

Classes

class  CoreMetadata
 Core metadata values. More...
 
struct  FileInfo
 Basic metadata for a file. More...
 
class  FormatException
 Exception thrown for file format operation errors. More...
 
class  FormatHandler
 Interface for all biological file format readers and writers. More...
 
class  FormatReader
 Interface for all biological file format readers. More...
 
class  FormatWriter
 Interface for all biological file format writers. More...
 
class  MetadataConfigurable
 Metadata configuration interface. More...
 
class  MetadataMap
 Metadata key-value map using a restricted set of value types. More...
 
class  MetadataOptions
 Metadata options. More...
 
class  Modulo
 A subdimension of Z, C, or T. More...
 
class  PixelBuffer
 Buffer for a specific pixel type. More...
 
class  PixelBufferBase
 Base class for all PixelBuffer types. More...
 
struct  PixelEndianProperties
 Map the given PixelPropertiesType and Endian enums to the corresponding endian-specific language type. More...
 
struct  PixelEndianProperties< P, ENDIAN_BIG >
 Properties of big endian pixels. More...
 
struct  PixelEndianProperties< P, ENDIAN_LITTLE >
 Properties of little endian pixels. More...
 
struct  PixelEndianProperties< P, ENDIAN_NATIVE >
 Properties of native endian pixels. More...
 
struct  PixelProperties
 Map a given PixelPropertiesType enum to the corresponding language types. More...
 
struct  PixelProperties<::ome::xml::model::enums::PixelType::BIT >
 Properties of BIT pixels. More...
 
struct  PixelProperties<::ome::xml::model::enums::PixelType::COMPLEXDOUBLE >
 Properties of COMPLEXDOUBLE pixels. More...
 
struct  PixelProperties<::ome::xml::model::enums::PixelType::COMPLEXFLOAT >
 Properties of COMPLEXFLOAT pixels. More...
 
struct  PixelProperties<::ome::xml::model::enums::PixelType::DOUBLE >
 Properties of DOUBLE pixels. More...
 
struct  PixelProperties<::ome::xml::model::enums::PixelType::FLOAT >
 Properties of FLOAT pixels. More...
 
struct  PixelProperties<::ome::xml::model::enums::PixelType::INT16 >
 Properties of INT16 pixels. More...
 
struct  PixelProperties<::ome::xml::model::enums::PixelType::INT32 >
 Properties of INT32 pixels. More...
 
struct  PixelProperties<::ome::xml::model::enums::PixelType::INT8 >
 Properties of INT8 pixels. More...
 
struct  PixelProperties<::ome::xml::model::enums::PixelType::UINT16 >
 Properties of UINT16 pixels. More...
 
struct  PixelProperties<::ome::xml::model::enums::PixelType::UINT32 >
 Properties of UINT32 pixels. More...
 
struct  PixelProperties<::ome::xml::model::enums::PixelType::UINT8 >
 Properties of UINT8 pixels. More...
 
struct  PixelPropertiesBase
 Properties common to all pixel types. More...
 
struct  PlaneRegion
 A rectangular region. More...
 
class  TileBuffer
 Tile pixel data buffer. More...
 
class  TileCache
 Tile cache. More...
 
class  TileCoverage
 Tile coverage cache. More...
 
class  UnknownFormatException
 Exception thrown for unrecognized or unsupported data streams or filenames. More...
 
class  UnsupportedCompressionException
 Exception thrown for unsupported compression types. More...
 
class  VariantPixelBuffer
 Buffer for all pixel types. More...
 
struct  Version
 Release version. More...
 

Typedefs

typedef std::size_t dimension_size_type
 Size type for image dimensions.
 
typedef uint32_t pixel_size_type
 Size type for pixel bit depths.
 
typedef uint64_t storage_size_type
 Size type for storage size.
 

Enumerations

enum  Domain {
  UNKNOWN_DOMAIN, HCS_DOMAIN, LM_DOMAIN, EM_DOMAIN,
  SPM_DOMAIN, SEM_DOMAIN, FLIM_DOMAIN, MEDICAL_DOMAIN,
  HISTOLOGY_DOMAIN, GEL_DOMAIN, ASTRONOMY_DOMAIN, GRAPHICS_DOMAIN
}
 Imaging domain. More...
 
enum  DomainCollection {
  NON_GRAPHICS_DOMAINS, NON_HCS_DOMAINS, NON_SPECIAL_DOMAINS, ALL_DOMAINS,
  HCS_ONLY_DOMAINS
}
 Imaging domain collections.
 
enum  Dimensions {
  DIM_SPATIAL_X = 0, DIM_SPATIAL_Y = 1, DIM_SPATIAL_Z = 2, DIM_TEMPORAL_T = 3,
  DIM_CHANNEL = 4, DIM_SUBCHANNEL = 5, DIM_MODULO_Z = 6, DIM_MODULO_T = 7,
  DIM_MODULO_C = 8
}
 Dimensions. More...
 
enum  EndianType { ENDIAN_BIG, ENDIAN_LITTLE, ENDIAN_NATIVE }
 Endianness. More...
 

Functions

template<class charT , class traits >
std::basic_ostream< charT, traits > & operator<< (std::basic_ostream< charT, traits > &os, const CoreMetadata &core)
 Output CoreMetadata to output stream. More...
 
template<class charT , class traits >
std::basic_ostream< charT, traits > & operator<< (std::basic_ostream< charT, traits > &os, const FileInfo &info)
 Output FileInfo to output stream. More...
 
const std::string & getDomain (Domain domain)
 Get the string corresponding to a particular Domain. More...
 
const std::vector< std::string > & getDomainCollection (DomainCollection domains)
 Get the strings corresponding to a particular Domain collection. More...
 
dimension_size_type getIndex (const std::string &order, dimension_size_type zSize, dimension_size_type cSize, dimension_size_type tSize, dimension_size_type num, dimension_size_type z, dimension_size_type c, dimension_size_type t)
 Get the rasterized index corresponding to the given Z, C and T coordinates (real sizes). More...
 
dimension_size_type getIndex (const std::string &order, dimension_size_type zSize, dimension_size_type cSize, dimension_size_type tSize, dimension_size_type moduloZSize, dimension_size_type moduloCSize, dimension_size_type moduloTSize, dimension_size_type num, dimension_size_type z, dimension_size_type c, dimension_size_type t, dimension_size_type moduloZ, dimension_size_type moduloC, dimension_size_type moduloT)
 Get the rasterized index corresponding to the given Z, C, T, ModuloZ, ModuloC and ModuloT coordinates (effective sizes). More...
 
std::array< dimension_size_type, 3 > getZCTCoords (const std::string &order, dimension_size_type zSize, dimension_size_type cSize, dimension_size_type tSize, dimension_size_type num, dimension_size_type index)
 Get the Z, C and T coordinates (real sizes) corresponding to the given rasterized index value. More...
 
std::array< dimension_size_type, 6 > getZCTCoords (const std::string &order, dimension_size_type zSize, dimension_size_type cSize, dimension_size_type tSize, dimension_size_type moduloZSize, dimension_size_type moduloCSize, dimension_size_type moduloTSize, dimension_size_type num, dimension_size_type index)
 Get the Z, C, T, ModuloZ, ModuloC and ModuloT coordinates (effective sizes) corresponding to the given rasterized index value. More...
 
template<>
MetadataMap::value_typeMetadataMap::get< MetadataMap::value_type > (const key_type &key)
 Get a reference to the value of a particular key from the map. More...
 
template<>
const MetadataMap::value_typeMetadataMap::get< MetadataMap::value_type > (const key_type &key) const
 Get a reference to the value of a particular key from the map. More...
 
std::string createID (std::string const &type, dimension_size_type idx)
 Create an object identifier for a given object type and index. More...
 
std::string createID (std::string const &type, dimension_size_type idx1, dimension_size_type idx2)
 Create an object identifier for a given object type and indices. More...
 
std::string createID (std::string const &type, dimension_size_type idx1, dimension_size_type idx2, dimension_size_type idx3)
 Create an object identifier for a given object type and indices. More...
 
std::string createID (std::string const &type, dimension_size_type idx1, dimension_size_type idx2, dimension_size_type idx3, dimension_size_type idx4)
 Create an object identifier for a given object type and indices. More...
 
std::shared_ptr<::ome::xml::meta::OMEXMLMetadatacreateOMEXMLMetadata (ome::common::xml::dom::Document &document)
 Create OME-XML metadata from DOM Document. More...
 
std::shared_ptr<::ome::xml::meta::OMEXMLMetadatacreateOMEXMLMetadata (const boost::filesystem::path &file)
 Create OME-XML metadata from XML file. More...
 
std::shared_ptr<::ome::xml::meta::OMEXMLMetadatacreateOMEXMLMetadata (const std::string &text)
 Create OME-XML metadata from XML string. More...
 
std::shared_ptr<::ome::xml::meta::OMEXMLMetadatacreateOMEXMLMetadata (std::istream &stream)
 Create OME-XML metadata from XML input stream. More...
 
std::shared_ptr<::ome::xml::meta::OMEXMLMetadatacreateOMEXMLMetadata (const FormatReader &reader, bool doPlane=false, bool doImageName=true)
 Create OME-XML metadata from reader core metadata. More...
 
std::shared_ptr<::ome::xml::meta::MetadataRootcreateOMEXMLRoot (const std::string &document)
 Create OME-XML metadata root from XML document. More...
 
std::shared_ptr<::ome::xml::meta::OMEXMLMetadatagetOMEXMLMetadata (std::shared_ptr<::ome::xml::meta::MetadataRetrieve > &retrieve)
 Get OME-XML metadata from metadata. More...
 
std::string getOMEXML (::ome::xml::meta::OMEXMLMetadata &omexml, bool validate=true)
 Get OME-XML document from OME-XML metadata. More...
 
bool validateOMEXML (const std::string &document)
 Validate an OME-XML document. More...
 
bool validateModel (::ome::xml::meta::Metadata &meta, bool correct)
 Validate a metadata store. More...
 
void fillMetadata (::ome::xml::meta::MetadataStore &store, const FormatReader &reader, bool doPlane=false, bool doImageName=true)
 Fill OME-XML metadata store from reader core metadata. More...
 
void fillMetadata (::ome::xml::meta::MetadataStore &store, const std::vector< std::shared_ptr< CoreMetadata >> seriesList, bool doPlane=false)
 Fill OME-XML metadata store from core metadata. More...
 
void fillAllPixels (::ome::xml::meta::MetadataStore &store, const FormatReader &reader)
 Fill all OME-XML metadata store Pixels elements from reader core metadata. More...
 
void fillPixels (::ome::xml::meta::MetadataStore &store, const FormatReader &reader)
 Fill an OME-XML metadata store Pixels element from reader core metadata. More...
 
void fillPixels (::ome::xml::meta::MetadataStore &store, const CoreMetadata &seriesMetadata, dimension_size_type series)
 Fill an OME-XML metadata store Pixels element from core metadata. More...
 
void addMetadataOnly (::ome::xml::meta::OMEXMLMetadata &omexml, dimension_size_type series, bool resolve=true)
 Add a MetadataOnly element to Pixels for the specified series. More...
 
Modulo getModuloAlongZ (const ::ome::xml::meta::OMEXMLMetadata &omexml, dimension_size_type image)
 Get ModuloAlongZ annotation from OME-XML metadata. More...
 
Modulo getModuloAlongT (const ::ome::xml::meta::OMEXMLMetadata &omexml, dimension_size_type image)
 Get ModuloAlongT annotation from OME-XML metadata. More...
 
Modulo getModuloAlongC (const ::ome::xml::meta::OMEXMLMetadata &omexml, dimension_size_type image)
 Get ModuloAlongC annotation from OME-XML metadata. More...
 
Modulo getModulo (const ::ome::xml::meta::OMEXMLMetadata &omexml, const std::string &tag, dimension_size_type image)
 Get Modulo annotation from OME-XML metadata. More...
 
void verifyMinimum (::ome::xml::meta::MetadataRetrieve &retrieve, dimension_size_type series=0U)
 Verify correctness of minimal amount of metadata in a series. More...
 
void removeBinData (::ome::xml::meta::OMEXMLMetadata &omexml)
 Remove all BinData elements from OME-XML metadata. More...
 
void removeTiffData (::ome::xml::meta::OMEXMLMetadata &omexml)
 Remove all TiffData elements from OME-XML metadata. More...
 
void removeChannels (::ome::xml::meta::OMEXMLMetadata &omexml, dimension_size_type image, dimension_size_type sizeC)
 Remove all but the specified number of valid Channel elements from OME-XML metadata. More...
 
MetadataMap getOriginalMetadata (::ome::xml::meta::OMEXMLMetadata &omexml)
 Get original metadata from OME-XML metadata StructuredAnnotations. More...
 
void fillOriginalMetadata (::ome::xml::meta::OMEXMLMetadata &omexml, const MetadataMap &metadata)
 Create OriginalMetadataAnnotations from MetadataMap. More...
 
std::string getModelVersion ()
 Get the currently-supported OME Data Model version. More...
 
std::string getModelVersion (ome::common::xml::dom::Document &document)
 Get the model version used by an OME-XML document. More...
 
std::string getModelVersion (const std::string &document)
 Get the model version used by an OME-XML document. More...
 
std::string transformToLatestModelVersion (const std::string &document)
 Transform an OME-XML document to the latest model version. More...
 
bool defaultCreationDateEnabled ()
 Check if default creation date is enabled. More...
 
void defaultCreationDateEnabled (bool enabled)
 Enable or disable default creation date. More...
 
void setDefaultCreationDate (::ome::xml::meta::MetadataStore &store, dimension_size_type series, const boost::filesystem::path &id)
 Set the creation data for a series. More...
 
ome::xml::model::enums::DimensionOrder createDimensionOrder (const std::string &order)
 Create a valid DimensionOrder from string. More...
 
storage_size_type pixelSize (const ::ome::xml::meta::MetadataRetrieve &meta, dimension_size_type series)
 Get the total size of pixel data in a series. More...
 
storage_size_type pixelSize (const ::ome::xml::meta::MetadataRetrieve &meta)
 Get the total size of pixel data for all series. More...
 
storage_size_type significantPixelSize (const ::ome::xml::meta::MetadataRetrieve &meta, dimension_size_type series)
 Get the total significant size of pixel data in a series. More...
 
storage_size_type significantPixelSize (const ::ome::xml::meta::MetadataRetrieve &meta)
 Get the total significant size of pixel data for all series. More...
 
void register_module_paths ()
 Register the OME-Files module paths with OME-Common. More...
 
template<class charT , class traits >
std::basic_ostream< charT, traits > & operator<< (std::basic_ostream< charT, traits > &os, const Modulo &modulo)
 Output Modulo to output stream. More...
 
pixel_size_type bytesPerPixel (::ome::xml::model::enums::PixelType pixeltype)
 Get the size of a PixelType, in bytes. More...
 
pixel_size_type bitsPerPixel (::ome::xml::model::enums::PixelType pixeltype)
 Get the size of a PixelType, in bits. More...
 
pixel_size_type significantBitsPerPixel (::ome::xml::model::enums::PixelType pixeltype)
 Get the significant (maximum bits used) size of a PixelType, in bits. More...
 
bool isSigned (::ome::xml::model::enums::PixelType pixeltype)
 Check whether a PixelType is signed. More...
 
bool isInteger (::ome::xml::model::enums::PixelType pixeltype)
 Check whether a PixelType is integer. More...
 
bool isFloatingPoint (::ome::xml::model::enums::PixelType pixeltype)
 Check whether a PixelType is floating point. More...
 
bool isComplex (::ome::xml::model::enums::PixelType pixeltype)
 Check whether a PixelType is complex. More...
 
::ome::xml::model::enums::PixelType pixelTypeFromBytes (pixel_size_type bytes, bool is_signed=false, bool is_integer=true, bool is_complex=false)
 Determine a likely pixel type from its the storage size in bytes. More...
 
::ome::xml::model::enums::PixelType pixelTypeFromBits (pixel_size_type bytes, bool is_signed=false, bool is_integer=true, bool is_complex=false)
 Determine a likely pixel type from its the storage size in bits. More...
 
template<typename T >
void byteswap (T &value)
 Byteswap value to switch endianness. More...
 
template<>
void byteswap (std::complex< float > &value)
 Byteswap value to switch endianness. More...
 
template<>
void byteswap (std::complex< double > &value)
 Byteswap value to switch endianness. More...
 
PlaneRegion operator & (const PlaneRegion &a, const PlaneRegion &b)
 Intersect two regions. More...
 
PlaneRegion operator| (const PlaneRegion &a, const PlaneRegion &b)
 Combine (union) two regions. More...
 
template<class charT , class traits >
std::basic_ostream< charT, traits > & operator<< (std::basic_ostream< charT, traits > &os, const PlaneRegion &region)
 Output PlaneRegion to output stream. More...
 
std::string escapeXML (const std::string &s)
 Replace special characters with XML entities in an XML string. More...
 
std::string sanitizeXML (const std::string &s)
 Filter control codes and invalid sequences in an XML string. More...
 
bool validateXML (const std::string &s, const std::string &loc="XML")
 Validate XML in an XML string. More...
 
template<class charT , class traits >
std::basic_ostream< charT, traits > & operator<< (std::basic_ostream< charT, traits > &os, const Version &version)
 Output Version to output stream. More...
 

Variables

const Version release_version (OME_FILES_VERSION_MAJOR, OME_FILES_VERSION_MINOR, OME_FILES_VERSION_PATCH, OME_FILES_VERSION_EXTRA_S)
 The release version number of the library currently being linked against.
 

Detailed Description

OME-Files image reading and writing.

Enumeration Type Documentation

◆ Dimensions

Dimensions.

The OME data model currently supports five dimensions (XYZTC), plus an implicit dimension (subchannel) and three modulo dimensions which subdivide Z, T and C. This enumeration is used to refer to specific dimensions, and the value is the logical dimension order used for the PixelBuffer interface.

The current interface requires all dimensions to be present even if unused. Future model changes may remove this requirement.

Enumerator
DIM_SPATIAL_X 

Spatial x dimension (X).

DIM_SPATIAL_Y 

Spatial y dimension (Y).

DIM_SPATIAL_Z 

Spatial z dimension (Z).

DIM_TEMPORAL_T 

Temporal t dimension (T).

DIM_CHANNEL 

Logical channel (typically detectors of specific wavelengths) (C).

DIM_SUBCHANNEL 

Logical sub-channel (typically used for RGB channel sub-components) (S).

DIM_MODULO_Z 

Logical subdivision of the spatial z dimension (z).

DIM_MODULO_T 

Logical subdivision of the temporal t dimension (t).

DIM_MODULO_C 

Logical subdivision of the logical channel dimension (c).

◆ Domain

Imaging domain.

Enumerator
UNKNOWN_DOMAIN 

Unknown.

HCS_DOMAIN 

High-Content Screening (HCS)

LM_DOMAIN 

Light Microscopy (LM)

EM_DOMAIN 

Electron Microscopy (EM)

SPM_DOMAIN 

Scanning Probe Microscopy (SPM)

SEM_DOMAIN 

Scanning Electron Microscopy (SEM)

FLIM_DOMAIN 

Fluorescence-Lifetime Imaging (FLIM)

MEDICAL_DOMAIN 

Medical Imaging.

HISTOLOGY_DOMAIN 

Histology.

GEL_DOMAIN 

Gel/Blot Imaging.

ASTRONOMY_DOMAIN 

Astronomy.

GRAPHICS_DOMAIN 

Graphics.

◆ EndianType

Endianness.

Enumerator
ENDIAN_BIG 

Big endian.

ENDIAN_LITTLE 

Little endian.

ENDIAN_NATIVE 

Native endian.

Function Documentation

◆ addMetadataOnly()

void ome::files::addMetadataOnly ( ::ome::xml::meta::OMEXMLMetadata omexml,
dimension_size_type  series,
bool  resolve = true 
)

Add a MetadataOnly element to Pixels for the specified series.

Parameters
omexmlthe OME-XML metadata store.
seriesthe series containing the Pixels element to add MetadataOnly to.
resolvetrue to resolve references, false to skip resolving references

References addMetadataOnly(), ome::xml::meta::OMEXMLMetadata::getRoot(), and ome::xml::meta::OMEXMLMetadata::resolveReferences().

Referenced by addMetadataOnly(), and fillMetadata().

+ Here is the caller graph for this function:

◆ bitsPerPixel()

pixel_size_type ome::files::bitsPerPixel ( ::ome::xml::model::enums::PixelType  pixeltype)

Get the size of a PixelType, in bits.

Parameters
pixeltypethe PixelType to query.
Returns
the size, in bits

Referenced by ome::files::detail::FormatReader::getBitsPerPixel(), ome::files::tiff::getCoreMetadata(), ome::files::in::OMETIFFReader::initFile(), ome::files::out::MinimalTIFFWriter::setupIFD(), and ome::files::out::OMETIFFWriter::setupIFD().

+ Here is the caller graph for this function:

◆ bytesPerPixel()

pixel_size_type ome::files::bytesPerPixel ( ::ome::xml::model::enums::PixelType  pixeltype)

Get the size of a PixelType, in bytes.

Parameters
pixeltypethe PixelType to query.
Returns
the size, in bytes

Referenced by ome::files::detail::FormatReader::getOptimalTileHeight(), pixelSize(), pixelTypeFromBytes(), and ome::files::detail::FormatReader::readPlane().

+ Here is the caller graph for this function:

◆ byteswap() [1/3]

template<typename T >
void ome::files::byteswap ( T &  value)
inline

Byteswap value to switch endianness.

Parameters
valuethe value to swap.

Referenced by ome::files::detail::FormatReader::readPlane().

+ Here is the caller graph for this function:

◆ byteswap() [2/3]

template<>
void ome::files::byteswap ( std::complex< float > &  value)
inline

Byteswap value to switch endianness.

Parameters
valuethe value to swap.

◆ byteswap() [3/3]

template<>
void ome::files::byteswap ( std::complex< double > &  value)
inline

Byteswap value to switch endianness.

Parameters
valuethe value to swap.

◆ createDimensionOrder()

ome::xml::model::enums::DimensionOrder ome::files::createDimensionOrder ( const std::string &  order)

Create a valid DimensionOrder from string.

Any duplicate dimension will have all duplicates following the initial instance removed. Any missing dimension will be suffixed to the resulting dimension order; the order of these dimensions is unspecified (since they weren't provided, the expectation is that the caller did not care).

Parameters
orderthe string dimension order.
Returns
the dimension order.
Exceptions
std::logic_errorif the provided order is invalid.

References createDimensionOrder().

Referenced by createDimensionOrder().

+ Here is the caller graph for this function:

◆ createID() [1/4]

std::string ome::files::createID ( std::string const &  type,
dimension_size_type  idx 
)

Create an object identifier for a given object type and index.

Parameters
typethe object type.
idxthe object index.
Returns
the identifier.

References createID().

Referenced by createID(), fillMetadata(), fillOriginalMetadata(), and fillPixels().

+ Here is the caller graph for this function:

◆ createID() [2/4]

std::string ome::files::createID ( std::string const &  type,
dimension_size_type  idx1,
dimension_size_type  idx2 
)

Create an object identifier for a given object type and indices.

Parameters
typethe object type.
idx1the first object index.
idx2the second object index.
Returns
the identifier.

References createID().

◆ createID() [3/4]

std::string ome::files::createID ( std::string const &  type,
dimension_size_type  idx1,
dimension_size_type  idx2,
dimension_size_type  idx3 
)

Create an object identifier for a given object type and indices.

Parameters
typethe object type.
idx1the first object index.
idx2the second object index.
idx3the third object index.
Returns
the identifier.

References createID().

◆ createID() [4/4]

std::string ome::files::createID ( std::string const &  type,
dimension_size_type  idx1,
dimension_size_type  idx2,
dimension_size_type  idx3,
dimension_size_type  idx4 
)

Create an object identifier for a given object type and indices.

Parameters
typethe object type.
idx1the first object index.
idx2the second object index.
idx3the third object index.
idx4the fourth object index.
Returns
the identifier.

References createID().

◆ createOMEXMLMetadata() [1/5]

std::shared_ptr<::ome::xml::meta::OMEXMLMetadata > ome::files::createOMEXMLMetadata ( ome::common::xml::dom::Document document)

Create OME-XML metadata from DOM Document.

Parameters
documentthe XML document.
Returns
the OME-XML metadata.

References createOMEXMLMetadata(), ome::common::xml::dom::ParseParameters::doSchema, ome::common::xml::dom::Document::getDocumentElement(), ome::xml::model::detail::OMEModel::resolveReferences(), ome::common::xml::dom::ParseParameters::validationSchemaFullChecking, and ome::common::xml::dom::writeDocument().

Referenced by ome::files::in::OMETIFFReader::cacheMetadata(), createOMEXMLMetadata(), createOMEXMLRoot(), ome::files::in::OMETIFFReader::initFile(), and ome::files::in::OMETIFFReader::readMetadata().

+ Here is the caller graph for this function:

◆ createOMEXMLMetadata() [2/5]

std::shared_ptr<::ome::xml::meta::OMEXMLMetadata > ome::files::createOMEXMLMetadata ( const boost::filesystem::path &  file)

Create OME-XML metadata from XML file.

Parameters
filethe XML file.
Returns
the OME-XML metadata.

References createOMEXMLMetadata(), ome::common::xml::dom::ParseParameters::doSchema, and ome::common::xml::dom::ParseParameters::validationSchemaFullChecking.

◆ createOMEXMLMetadata() [3/5]

std::shared_ptr<::ome::xml::meta::OMEXMLMetadata > ome::files::createOMEXMLMetadata ( const std::string &  text)

Create OME-XML metadata from XML string.

Parameters
textthe XML string.
Returns
the OME-XML metadata.

References createOMEXMLMetadata(), ome::common::xml::dom::ParseParameters::doSchema, and ome::common::xml::dom::ParseParameters::validationSchemaFullChecking.

◆ createOMEXMLMetadata() [4/5]

std::shared_ptr<::ome::xml::meta::OMEXMLMetadata > ome::files::createOMEXMLMetadata ( std::istream &  stream)

Create OME-XML metadata from XML input stream.

Parameters
streamthe XML input stream.
Returns
the OME-XML metadata.

References createOMEXMLMetadata(), ome::common::xml::dom::ParseParameters::doSchema, and ome::common::xml::dom::ParseParameters::validationSchemaFullChecking.

◆ createOMEXMLMetadata() [5/5]

std::shared_ptr<::ome::xml::meta::OMEXMLMetadata > ome::files::createOMEXMLMetadata ( const FormatReader reader,
bool  doPlane = false,
bool  doImageName = true 
)

Create OME-XML metadata from reader core metadata.

Parameters
readerthe reader to use.
doPlanecreate Plane elements if true.
doImageNameset image name if true.
Returns
the OME-XML metadata.

References createOMEXMLMetadata(), and fillMetadata().

◆ createOMEXMLRoot()

std::shared_ptr<::ome::xml::meta::MetadataRoot > ome::files::createOMEXMLRoot ( const std::string &  document)

Create OME-XML metadata root from XML document.

Parameters
documentthe XML document source.
Returns
the OME-XML metadata root.
Todo:
Implement model transforms.

References createOMEXMLMetadata(), and createOMEXMLRoot().

Referenced by createOMEXMLRoot().

+ Here is the caller graph for this function:

◆ defaultCreationDateEnabled() [1/2]

bool ome::files::defaultCreationDateEnabled ( )

Check if default creation date is enabled.

Returns
true if enabled, false otherwise.

References defaultCreationDateEnabled().

Referenced by defaultCreationDateEnabled(), and setDefaultCreationDate().

+ Here is the caller graph for this function:

◆ defaultCreationDateEnabled() [2/2]

void ome::files::defaultCreationDateEnabled ( bool  enabled)

Enable or disable default creation date.

This setting enables or disables the replacement of missing creation dates.

See also
setDefaultCreationDate().
Parameters
enabledtrue to enable, false to disable.

References defaultCreationDateEnabled().

◆ escapeXML()

std::string ome::files::escapeXML ( const std::string &  s)

Replace special characters with XML entities in an XML string.

Parameters
sthe string to escape.
Returns
the escaped string.

◆ fillAllPixels()

void ome::files::fillAllPixels ( ::ome::xml::meta::MetadataStore store,
const FormatReader reader 
)

Fill all OME-XML metadata store Pixels elements from reader core metadata.

Set Pixels metadata for all series.

Parameters
storethe OME-XML metadata store.
readerthe reader to use.

References fillAllPixels(), fillPixels(), ome::files::FormatReader::getSeries(), ome::files::FormatReader::getSeriesCount(), and ome::files::FormatReader::setSeries().

Referenced by fillAllPixels().

+ Here is the caller graph for this function:

◆ fillMetadata() [1/2]

void ome::files::fillMetadata ( ::ome::xml::meta::MetadataStore store,
const FormatReader reader,
bool  doPlane = false,
bool  doImageName = true 
)

◆ fillMetadata() [2/2]

void ome::files::fillMetadata ( ::ome::xml::meta::MetadataStore store,
const std::vector< std::shared_ptr< CoreMetadata >>  seriesList,
bool  doPlane = false 
)

Fill OME-XML metadata store from core metadata.

The metadata store is expected to be empty.

Parameters
storethe OME-XML metadata store.
seriesListthe core metadata to use.
doPlanecreate Plane elements if true.

References addMetadataOnly(), createID(), fillMetadata(), fillPixels(), ome::xml::meta::OMEXMLMetadata::getPixelsBinDataCount(), ome::xml::meta::OMEXMLMetadata::getTiffDataCount(), getZCTCoords(), ome::xml::meta::MetadataStore::setImageID(), ome::xml::meta::MetadataStore::setPlaneTheC(), ome::xml::meta::MetadataStore::setPlaneTheT(), and ome::xml::meta::MetadataStore::setPlaneTheZ().

◆ fillOriginalMetadata()

void ome::files::fillOriginalMetadata ( ::ome::xml::meta::OMEXMLMetadata omexml,
const MetadataMap metadata 
)

Create OriginalMetadataAnnotations from MetadataMap.

Parameters
omexmlthe OME-XML metadata store.
metadatathe original metadata.

References createID(), ome::files::MetadataMap::empty(), fillOriginalMetadata(), ome::files::MetadataMap::flatten(), ome::xml::meta::OMEXMLMetadata::getRoot(), ome::xml::meta::OMEXMLMetadata::getXMLAnnotationID(), and ome::xml::meta::OMEXMLMetadata::resolveReferences().

Referenced by fillOriginalMetadata(), and ome::files::detail::FormatReader::setId().

+ Here is the caller graph for this function:

◆ fillPixels() [1/2]

void ome::files::fillPixels ( ::ome::xml::meta::MetadataStore store,
const FormatReader reader 
)

Fill an OME-XML metadata store Pixels element from reader core metadata.

Set Pixels metadata for the reader's current series.

Parameters
storethe OME-XML metadata store.
readerthe reader to use.

References createID(), fillPixels(), ome::files::FormatReader::getBitsPerPixel(), ome::files::FormatReader::getDimensionOrder(), ome::files::FormatReader::getEffectiveSizeC(), ome::files::FormatReader::getPixelType(), ome::files::FormatReader::getRGBChannelCount(), ome::files::FormatReader::getSeries(), ome::files::FormatReader::getSizeC(), ome::files::FormatReader::getSizeT(), ome::files::FormatReader::getSizeX(), ome::files::FormatReader::getSizeY(), ome::files::FormatReader::getSizeZ(), ome::files::FormatReader::isInterleaved(), ome::files::FormatReader::isLittleEndian(), ome::xml::meta::MetadataStore::setChannelID(), ome::xml::meta::MetadataStore::setChannelSamplesPerPixel(), ome::xml::meta::MetadataStore::setPixelsBigEndian(), ome::xml::meta::MetadataStore::setPixelsDimensionOrder(), ome::xml::meta::MetadataStore::setPixelsID(), ome::xml::meta::MetadataStore::setPixelsInterleaved(), ome::xml::meta::MetadataStore::setPixelsSignificantBits(), ome::xml::meta::MetadataStore::setPixelsSizeC(), ome::xml::meta::MetadataStore::setPixelsSizeT(), ome::xml::meta::MetadataStore::setPixelsSizeX(), ome::xml::meta::MetadataStore::setPixelsSizeY(), ome::xml::meta::MetadataStore::setPixelsSizeZ(), and ome::xml::meta::MetadataStore::setPixelsType().

Referenced by fillAllPixels(), fillMetadata(), and fillPixels().

+ Here is the caller graph for this function:

◆ fillPixels() [2/2]

void ome::files::fillPixels ( ::ome::xml::meta::MetadataStore store,
const CoreMetadata seriesMetadata,
dimension_size_type  series 
)

◆ getDomain()

const std::string & ome::files::getDomain ( Domain  domain)

Get the string corresponding to a particular Domain.

Parameters
domainthe Domain to use.
Returns
the string description of the Domain.

References ASTRONOMY_DOMAIN, EM_DOMAIN, FLIM_DOMAIN, GEL_DOMAIN, GRAPHICS_DOMAIN, HCS_DOMAIN, HISTOLOGY_DOMAIN, LM_DOMAIN, MEDICAL_DOMAIN, SEM_DOMAIN, SPM_DOMAIN, and UNKNOWN_DOMAIN.

Referenced by ome::files::in::MinimalTIFFReader::MinimalTIFFReader().

+ Here is the caller graph for this function:

◆ getDomainCollection()

const std::vector< std::string > & ome::files::getDomainCollection ( DomainCollection  domains)

Get the strings corresponding to a particular Domain collection.

Parameters
domainsthe Domain collection to use.
Returns
the string descriptions of the Domain collection.

References ASTRONOMY_DOMAIN, EM_DOMAIN, FLIM_DOMAIN, GEL_DOMAIN, GRAPHICS_DOMAIN, HCS_DOMAIN, HISTOLOGY_DOMAIN, LM_DOMAIN, MEDICAL_DOMAIN, SEM_DOMAIN, SPM_DOMAIN, and UNKNOWN_DOMAIN.

Referenced by ome::files::in::OMETIFFReader::getDomains(), and ome::files::in::OMETIFFReader::OMETIFFReader().

+ Here is the caller graph for this function:

◆ getIndex() [1/2]

dimension_size_type ome::files::getIndex ( const std::string &  order,
dimension_size_type  zSize,
dimension_size_type  cSize,
dimension_size_type  tSize,
dimension_size_type  num,
dimension_size_type  z,
dimension_size_type  c,
dimension_size_type  t 
)

Get the rasterized index corresponding to the given Z, C and T coordinates (real sizes).

Parameters
orderdimension order.
zSizetotal number of focal planes (real size).
cSizetotal number of channels (real size).
tSizetotal number of time points (real size).
numtotal number of image planes (zSize * cSize * tSize), specified as a consistency check.
zthe Z coordinate of ZCT coordinate triple to convert to 1D index (real size).
cthe C coordinate of ZCT coordinate triple to convert to 1D index (real size).
tthe T coordinate of ZCT coordinate triple to convert to 1D index (real size).
Returns
the 1D index.

Referenced by ome::files::detail::FormatReader::getCoreMetadata(), ome::files::detail::FormatWriter::getIndex(), getIndex(), ome::files::detail::FormatReader::getIndex(), and ome::files::in::OMETIFFReader::initFile().

+ Here is the caller graph for this function:

◆ getIndex() [2/2]

dimension_size_type ome::files::getIndex ( const std::string &  order,
dimension_size_type  zSize,
dimension_size_type  cSize,
dimension_size_type  tSize,
dimension_size_type  moduloZSize,
dimension_size_type  moduloCSize,
dimension_size_type  moduloTSize,
dimension_size_type  num,
dimension_size_type  z,
dimension_size_type  c,
dimension_size_type  t,
dimension_size_type  moduloZ,
dimension_size_type  moduloC,
dimension_size_type  moduloT 
)

Get the rasterized index corresponding to the given Z, C, T, ModuloZ, ModuloC and ModuloT coordinates (effective sizes).

Note
The Z, C and T coordinates take the modulo dimension sizes into account. The effective size for each of these dimensions is limited to the total size of the dimension divided by the modulo size.
Parameters
orderdimension order.
zSizetotal number of focal planes (real size).
cSizetotal number of channels (real size).
tSizetotal number of time points (real size).
moduloZSizetotal number of ModuloZ planes (real size).
moduloCSizetotal number of ModuloC channels (real size).
moduloTSizetotal number of ModuloT time points (real size).
numtotal number of image planes (zSize * cSize * tSize), specified as a consistency check.
zthe Z coordinate of ZCTmZmCmT coordinate sextuple to convert to 1D index (effective size).
cthe C coordinate of ZCTmZmCmT coordinate sextuple to convert to 1D index (effective size).
tthe T coordinate of ZCTmZmCmT coordinate sextuple to convert to 1D index (effective size).
moduloZthe ModuloZ coordinate of ZCTmZmCmT coordinate sextuple to convert to 1D index (effective size).
moduloCthe ModuloC coordinate of ZCTmZmCmT coordinate sextuple to convert to 1D index (effective size).
moduloTthe ModuloT coordinate of ZCTmZmCmT coordinate sextuple to convert to 1D index (effective size).
Returns
the 1D index.

References getIndex().

◆ getModelVersion() [1/3]

std::string ome::files::getModelVersion ( )

Get the currently-supported OME Data Model version.

Returns
the model version.

◆ getModelVersion() [2/3]

std::string ome::files::getModelVersion ( ome::common::xml::dom::Document document)

Get the model version used by an OME-XML document.

Parameters
documentthe OME-XML document.
Returns
the model version.

References ome::common::xml::dom::Document::getDocumentElement().

◆ getModelVersion() [3/3]

std::string ome::files::getModelVersion ( const std::string &  document)

Get the model version used by an OME-XML document.

Parameters
documentthe OME-XML document.
Returns
the model version.

◆ getModulo()

Modulo ome::files::getModulo ( const ::ome::xml::meta::OMEXMLMetadata omexml,
const std::string &  tag,
dimension_size_type  image 
)

Get Modulo annotation from OME-XML metadata.

Parameters
omexmlthe OME-XML metadata store.
tagthe Modulo annotation XML tag name.
imagethe image index.
Returns
the Modulo annotation.

References ome::common::xml::dom::NodeList::empty(), ome::common::xml::dom::Document::getElementsByTagName(), getModulo(), ome::xml::meta::OMEXMLMetadata::getRoot(), and ome::common::xml::dom::Node::getTextContent().

Referenced by getModulo(), getModuloAlongC(), getModuloAlongT(), and getModuloAlongZ().

+ Here is the caller graph for this function:

◆ getModuloAlongC()

Modulo ome::files::getModuloAlongC ( const ::ome::xml::meta::OMEXMLMetadata omexml,
dimension_size_type  image 
)

Get ModuloAlongC annotation from OME-XML metadata.

Parameters
omexmlthe OME-XML metadata store.
imagethe image index.
Returns
the Modulo annotation.

References getModulo(), and getModuloAlongC().

Referenced by getModuloAlongC(), and ome::files::in::OMETIFFReader::initFile().

+ Here is the caller graph for this function:

◆ getModuloAlongT()

Modulo ome::files::getModuloAlongT ( const ::ome::xml::meta::OMEXMLMetadata omexml,
dimension_size_type  image 
)

Get ModuloAlongT annotation from OME-XML metadata.

Parameters
omexmlthe OME-XML metadata store.
imagethe image index.
Returns
the Modulo annotation.

References getModulo(), and getModuloAlongT().

Referenced by getModuloAlongT(), and ome::files::in::OMETIFFReader::initFile().

+ Here is the caller graph for this function:

◆ getModuloAlongZ()

Modulo ome::files::getModuloAlongZ ( const ::ome::xml::meta::OMEXMLMetadata omexml,
dimension_size_type  image 
)

Get ModuloAlongZ annotation from OME-XML metadata.

Parameters
omexmlthe OME-XML metadata store.
imagethe image index.
Returns
the Modulo annotation.

References getModulo(), and getModuloAlongZ().

Referenced by getModuloAlongZ(), and ome::files::in::OMETIFFReader::initFile().

+ Here is the caller graph for this function:

◆ getOMEXML()

std::string ome::files::getOMEXML ( ::ome::xml::meta::OMEXMLMetadata omexml,
bool  validate = true 
)

Get OME-XML document from OME-XML metadata.

This will convert the OME-XML metadata to an XML document string.

Parameters
omexmlthe OME-XML metadata store.
validatetrue to validate the OME-XML, false to skip validation.
Returns
the OME-XML metadata as an XML document string.

References ome::xml::meta::OMEXMLMetadata::dumpXML(), getOMEXML(), and validateOMEXML().

Referenced by ome::files::out::OMETIFFWriter::getOMEXML(), and getOMEXML().

+ Here is the caller graph for this function:

◆ getOMEXMLMetadata()

std::shared_ptr<::ome::xml::meta::OMEXMLMetadata > ome::files::getOMEXMLMetadata ( std::shared_ptr<::ome::xml::meta::MetadataRetrieve > &  retrieve)

Get OME-XML metadata from metadata.

This will convert the metadata to OME-XML metadata if required.

Parameters
retrievethe metadata to use.
Returns
the OME-XML metadata.

References getOMEXMLMetadata().

Referenced by getOMEXMLMetadata().

+ Here is the caller graph for this function:

◆ getOriginalMetadata()

MetadataMap ome::files::getOriginalMetadata ( ::ome::xml::meta::OMEXMLMetadata omexml)

Get original metadata from OME-XML metadata StructuredAnnotations.

Parameters
omexmlthe OME-XML metadata store.
Returns
a map of the original metadata annotations.
Todo:
log error

References ome::xml::model::detail::OMEModelObject::getChildrenByTagName(), ome::common::xml::dom::Document::getDocumentElement(), getOriginalMetadata(), ome::xml::meta::OMEXMLMetadata::getRoot(), ome::files::MetadataMap::set(), and ome::common::xml::dom::ParseParameters::validationScheme.

Referenced by getOriginalMetadata(), and ome::files::in::OMETIFFReader::initFile().

+ Here is the caller graph for this function:

◆ getZCTCoords() [1/2]

std::array< dimension_size_type, 3 > ome::files::getZCTCoords ( const std::string &  order,
dimension_size_type  zSize,
dimension_size_type  cSize,
dimension_size_type  tSize,
dimension_size_type  num,
dimension_size_type  index 
)

Get the Z, C and T coordinates (real sizes) corresponding to the given rasterized index value.

Parameters
orderdimension order.
zSizetotal number of focal planes (real size).
cSizetotal number of channels (real size).
tSizetotal number of time points (real size).
numtotal number of image planes (zSize * cSize * tSize), specified as a consistency check.
index1D (rasterized) index to convert to ZCT coordinates.
Returns
an array containing the ZCT coordinates (real sizes, in that order).

Referenced by ome::files::out::OMETIFFWriter::fillMetadata(), fillMetadata(), ome::files::detail::FormatReader::getCoreMetadata(), ome::files::detail::FormatWriter::getZCTCoords(), getZCTCoords(), ome::files::detail::FormatReader::getZCTCoords(), and ome::files::detail::FormatReader::getZCTModuloCoords().

+ Here is the caller graph for this function:

◆ getZCTCoords() [2/2]

std::array< dimension_size_type, 6 > ome::files::getZCTCoords ( const std::string &  order,
dimension_size_type  zSize,
dimension_size_type  cSize,
dimension_size_type  tSize,
dimension_size_type  moduloZSize,
dimension_size_type  moduloCSize,
dimension_size_type  moduloTSize,
dimension_size_type  num,
dimension_size_type  index 
)

Get the Z, C, T, ModuloZ, ModuloC and ModuloT coordinates (effective sizes) corresponding to the given rasterized index value.

Note
The Z, C and T coordinates are not the same as those returned by ome::files::getZCTCoords(const std::string&, dimension_size_type, dimension_size_type, dimension_size_type, dimension_size_type, dimension_size_type) because the size of the modulo dimensions is taken into account. The effective size for each of these dimensions is limited to the total size of the dimension divided by the modulo size.
Parameters
orderdimension order.
zSizetotal number of focal planes (effective size).
cSizetotal number of channels (effective size).
tSizetotal number of time points (effective size).
moduloZSizetotal number of ModuloZ planes (effective size).
moduloCSizetotal number of ModuloC channels (effective size).
moduloTSizetotal number of ModuloT time points (effective size).
numtotal number of image planes (zSize * cSize * tSize), specified as a consistency check.
index1D (rasterized) index to convert to ZCTmZmCmT coordinates.
Returns
an array containing the ZCTmZmCmT coordinates (effective sizes, in that order).

References getZCTCoords().

◆ isComplex()

bool ome::files::isComplex ( ::ome::xml::model::enums::PixelType  pixeltype)

Check whether a PixelType is complex.

Parameters
pixeltypethe PixelType to query.
Returns
true if complex, false otherwise.

◆ isFloatingPoint()

bool ome::files::isFloatingPoint ( ::ome::xml::model::enums::PixelType  pixeltype)

Check whether a PixelType is floating point.

Parameters
pixeltypethe PixelType to query.
Note
Equivalent to !isInteger().
Returns
true if floating point, false otherwise.

References isInteger().

◆ isInteger()

bool ome::files::isInteger ( ::ome::xml::model::enums::PixelType  pixeltype)

Check whether a PixelType is integer.

Parameters
pixeltypethe PixelType to query.
Returns
true if integer, false otherwise.

Referenced by isFloatingPoint().

+ Here is the caller graph for this function:

◆ isSigned()

bool ome::files::isSigned ( ::ome::xml::model::enums::PixelType  pixeltype)

Check whether a PixelType is signed.

Parameters
pixeltypethe PixelType to query.
Returns
true if signed, false otherwise.

◆ MetadataMap::get< MetadataMap::value_type >() [1/2]

template<>
MetadataMap::value_type& ome::files::MetadataMap::get< MetadataMap::value_type > ( const key_type &  key)
inline

Get a reference to the value of a particular key from the map.

If the key was not found, or the type of value does not match the stored value type, value will remain unmodified.

Parameters
keythe key to find.
Returns
a reference to the stored value.
Exceptions
boost::bad_geton failure if the key was not found or if the type did not match the stored value type.

References ome::files::MetadataMap::discriminating_map.

◆ MetadataMap::get< MetadataMap::value_type >() [2/2]

template<>
const MetadataMap::value_type& ome::files::MetadataMap::get< MetadataMap::value_type > ( const key_type &  key) const
inline

Get a reference to the value of a particular key from the map.

If the key was not found, or the type of value does not match the stored value type, value will remain unmodified.

Parameters
keythe key to find.
Returns
a reference to the stored value.
Exceptions
boost::bad_geton failure if the key was not found or if the type did not match the stored value type.

References ome::files::MetadataMap::discriminating_map.

◆ operator &()

PlaneRegion ome::files::operator& ( const PlaneRegion a,
const PlaneRegion b 
)
inline

Intersect two regions.

If the regions do not intersect, a default-constructed region of zero size will be returned.

Parameters
athe first region.
bthe second region.
Returns
the intersection of the two regions.

References ome::files::PlaneRegion::h, ome::files::PlaneRegion::PlaneRegion(), ome::files::PlaneRegion::w, ome::files::PlaneRegion::x, and ome::files::PlaneRegion::y.

◆ operator<<() [1/5]

template<class charT , class traits >
std::basic_ostream<charT,traits>& ome::files::operator<< ( std::basic_ostream< charT, traits > &  os,
const Version version 
)
inline

Output Version to output stream.

Parameters
osthe output stream.
versionthe Version to output.
Returns
the output stream.

References ome::files::Version::major.

◆ operator<<() [2/5]

template<class charT , class traits >
std::basic_ostream<charT,traits>& ome::files::operator<< ( std::basic_ostream< charT, traits > &  os,
const Modulo modulo 
)
inline

Output Modulo to output stream.

Parameters
osthe output stream.
modulothe Modulo to output.
Returns
the output stream.

References ome::files::Modulo::parentDimension.

◆ operator<<() [3/5]

template<class charT , class traits >
std::basic_ostream<charT,traits>& ome::files::operator<< ( std::basic_ostream< charT, traits > &  os,
const FileInfo info 
)
inline

Output FileInfo to output stream.

Parameters
osthe output stream.
infothe FileInfo to output.
Returns
the output stream.

References ome::files::FileInfo::filename.

◆ operator<<() [4/5]

template<class charT , class traits >
std::basic_ostream<charT,traits>& ome::files::operator<< ( std::basic_ostream< charT, traits > &  os,
const CoreMetadata core 
)
inline

Output CoreMetadata to output stream.

Parameters
osthe output stream.
corethe CoreMetadata to output.
Returns
the output stream.

References ome::files::CoreMetadata::sizeX.

◆ operator<<() [5/5]

template<class charT , class traits >
std::basic_ostream<charT,traits>& ome::files::operator<< ( std::basic_ostream< charT, traits > &  os,
const PlaneRegion region 
)
inline

Output PlaneRegion to output stream.

Parameters
osthe output stream.
regionthe PlaneRegion to output.
Returns
the output stream.

References ome::files::PlaneRegion::x.

◆ operator|()

PlaneRegion ome::files::operator| ( const PlaneRegion a,
const PlaneRegion b 
)
inline

Combine (union) two regions.

If the regions do not abut about a common edge, a default-constructed region of zero size will be returned.

Parameters
athe first region.
bthe second region.
Returns
the union of the two regions.

References ome::files::PlaneRegion::h, ome::files::PlaneRegion::PlaneRegion(), ome::files::PlaneRegion::w, ome::files::PlaneRegion::x, and ome::files::PlaneRegion::y.

◆ pixelSize() [1/2]

storage_size_type ome::files::pixelSize ( const ::ome::xml::meta::MetadataRetrieve meta,
dimension_size_type  series 
)

Get the total size of pixel data in a series.

The size for the pixel type is rounded up to the nearest byte before multiplying by the dimension sizes.

Parameters
metathe metadata to use.
seriesthe image series to use.
Returns
the size (in bytes).

References bytesPerPixel(), and pixelSize().

Referenced by pixelSize(), ome::files::out::MinimalTIFFWriter::setId(), ome::files::out::OMETIFFWriter::setId(), and significantPixelSize().

+ Here is the caller graph for this function:

◆ pixelSize() [2/2]

storage_size_type ome::files::pixelSize ( const ::ome::xml::meta::MetadataRetrieve meta)

Get the total size of pixel data for all series.

The size for the pixel type is rounded up to the nearest byte before multiplying by the dimension sizes.

Parameters
metathe metadata to use.
Returns
the size (in bytes).

References pixelSize().

◆ pixelTypeFromBits()

ome::xml::model::enums::PixelType ome::files::pixelTypeFromBits ( pixel_size_type  bytes,
bool  is_signed = false,
bool  is_integer = true,
bool  is_complex = false 
)

Determine a likely pixel type from its the storage size in bits.

Note that the BIT type will never be returned due to having the same storage size as other types.

Parameters
bytesthe storage size in bits.
is_signedtrue if signed, false if unsigned.
is_integertrue if integer, false otherwise.
is_complex:c true if complex, false otherwise.
Returns
the corresponding pixel type.
Exceptions
ifno pixel type was identified or the parameters are invalid.

References pixelTypeFromBytes().

◆ pixelTypeFromBytes()

ome::xml::model::enums::PixelType ome::files::pixelTypeFromBytes ( pixel_size_type  bytes,
bool  is_signed = false,
bool  is_integer = true,
bool  is_complex = false 
)

Determine a likely pixel type from its the storage size in bytes.

Note that the BIT type will never be returned due to having the same storage size as other types.

Parameters
bytesthe storage size in bytes.
is_signedtrue if signed, false if unsigned.
is_integertrue if integer, false otherwise.
is_complex:c true if complex, false otherwise.
Returns
the corresponding pixel type.
Exceptions
ifno pixel type was identified or the parameters are invalid.

References bytesPerPixel(), ome::xml::model::enums::PixelType::COMPLEXDOUBLE, ome::xml::model::enums::PixelType::COMPLEXFLOAT, ome::xml::model::enums::PixelType::DOUBLE, ome::xml::model::enums::PixelType::FLOAT, ome::xml::model::enums::PixelType::INT16, ome::xml::model::enums::PixelType::INT32, ome::xml::model::enums::PixelType::INT8, ome::xml::model::enums::PixelType::UINT16, ome::xml::model::enums::PixelType::UINT32, and ome::xml::model::enums::PixelType::UINT8.

Referenced by pixelTypeFromBits().

+ Here is the caller graph for this function:

◆ register_module_paths()

void ome::files::register_module_paths ( )

Register the OME-Files module paths with OME-Common.

This function forces path registration.

Note
This is a hack to allow static linking to work on Windows; without this, the module object is omitted and the paths aren't automatically registered. This will no longer be required once it is built as a DLL. Its only purpose is to force object inclusion when static linking, and ensure that the registration happens independently of object static construction order to allow use prior to main() entry. You should not use this.

References register_module_paths(), and ome::common::register_module_paths().

◆ removeBinData()

void ome::files::removeBinData ( ::ome::xml::meta::OMEXMLMetadata omexml)

Remove all BinData elements from OME-XML metadata.

Parameters
omexmlthe OME-XML metadata store.

References ome::xml::meta::OMEXMLMetadata::getRoot(), removeBinData(), and ome::xml::meta::OMEXMLMetadata::resolveReferences().

Referenced by ome::files::out::OMETIFFWriter::close(), and removeBinData().

+ Here is the caller graph for this function:

◆ removeChannels()

void ome::files::removeChannels ( ::ome::xml::meta::OMEXMLMetadata omexml,
dimension_size_type  image,
dimension_size_type  sizeC 
)

Remove all but the specified number of valid Channel elements from OME-XML metadata.

Parameters
omexmlthe OME-XML metadata store.
imagethe image index.
sizeCthe number of channels to retain.

References ome::xml::meta::OMEXMLMetadata::getRoot(), removeChannels(), and ome::xml::meta::OMEXMLMetadata::resolveReferences().

Referenced by ome::files::in::OMETIFFReader::cleanMetadata(), and removeChannels().

+ Here is the caller graph for this function:

◆ removeTiffData()

void ome::files::removeTiffData ( ::ome::xml::meta::OMEXMLMetadata omexml)

Remove all TiffData elements from OME-XML metadata.

Parameters
omexmlthe OME-XML metadata store.

References ome::xml::meta::OMEXMLMetadata::getRoot(), removeTiffData(), and ome::xml::meta::OMEXMLMetadata::resolveReferences().

Referenced by ome::files::out::OMETIFFWriter::close(), and removeTiffData().

+ Here is the caller graph for this function:

◆ sanitizeXML()

std::string ome::files::sanitizeXML ( const std::string &  s)

Filter control codes and invalid sequences in an XML string.

Remove all control codes except for LF, HT and CR. Also replace &# with #.

Parameters
sthe string to filter.
Returns
the filtered string.

◆ setDefaultCreationDate()

void ome::files::setDefaultCreationDate ( ::ome::xml::meta::MetadataStore store,
dimension_size_type  series,
const boost::filesystem::path &  id 
)

Set the creation data for a series.

If the specified file exists, the modification time of this file will be used as the creation date. If it does not exist, the current system time will be used as a fallback.

This function will do nothing unless defaultCreationDateEnabled(bool) is enabled.

Parameters
storethe OME-XML metadata store.
seriesthe series for which to set the creation date.
idthe filename for the series.

References defaultCreationDateEnabled(), setDefaultCreationDate(), and ome::xml::meta::MetadataStore::setImageAcquisitionDate().

Referenced by fillMetadata(), and setDefaultCreationDate().

+ Here is the caller graph for this function:

◆ significantBitsPerPixel()

pixel_size_type ome::files::significantBitsPerPixel ( ::ome::xml::model::enums::PixelType  pixeltype)

Get the significant (maximum bits used) size of a PixelType, in bits.

Parameters
pixeltypethe PixelType to query.
Returns
the size, in bits

Referenced by ome::files::tiff::getCoreMetadata(), ome::files::tiff::IFD::setBitsPerSample(), and significantPixelSize().

+ Here is the caller graph for this function:

◆ significantPixelSize() [1/2]

storage_size_type ome::files::significantPixelSize ( const ::ome::xml::meta::MetadataRetrieve meta,
dimension_size_type  series 
)

Get the total significant size of pixel data in a series.

The significant size for the pixel type (in bits) is multiplied by the dimension sizes before converting to bytes.

Parameters
metathe metadata to use.
seriesthe image series to use.
Returns
the size (in bytes).

References significantBitsPerPixel(), and significantPixelSize().

Referenced by ome::files::out::MinimalTIFFWriter::setId(), ome::files::out::OMETIFFWriter::setId(), and significantPixelSize().

+ Here is the caller graph for this function:

◆ significantPixelSize() [2/2]

storage_size_type ome::files::significantPixelSize ( const ::ome::xml::meta::MetadataRetrieve meta)

Get the total significant size of pixel data for all series.

The significant size for the pixel type (in bits) is multiplied by the dimension sizes before converting to bytes.

Parameters
metathe metadata to use.
Returns
the size (in bytes).

References pixelSize(), and significantPixelSize().

◆ transformToLatestModelVersion()

std::string ome::files::transformToLatestModelVersion ( const std::string &  document)

Transform an OME-XML document to the latest model version.

Parameters
documentthe OME-XML document.
Returns
the transformed OME-XML document.

References transformToLatestModelVersion().

Referenced by transformToLatestModelVersion().

+ Here is the caller graph for this function:

◆ validateModel()

bool ome::files::validateModel ( ::ome::xml::meta::Metadata meta,
bool  correct 
)

Validate a metadata store.

Note that unlike validateOMEXML(const std::string&) this does not perform XML validation. It will look for missing or inconsistent metadata and (if specified) attempt to correct the metadata to make it valid.

Parameters
metathe metadata store.
correcttrue to attempt correction, false to leave unmodified.
Returns
true if valid, false if invalid.
Exceptions
FormatExceptionif correction of invalid metadata fails.

References ome::xml::meta::MetadataRetrieve::getChannelCount(), ome::xml::meta::MetadataRetrieve::getChannelSamplesPerPixel(), ome::xml::meta::MetadataRetrieve::getImageCount(), ome::xml::meta::MetadataRetrieve::getPixelsSizeC(), ome::xml::meta::MetadataRetrieve::getPixelsSizeT(), ome::xml::meta::MetadataRetrieve::getPixelsSizeX(), ome::xml::meta::MetadataRetrieve::getPixelsSizeY(), ome::xml::meta::MetadataRetrieve::getPixelsSizeZ(), ome::xml::meta::MetadataStore::setChannelSamplesPerPixel(), ome::xml::meta::MetadataStore::setPixelsSizeC(), and validateModel().

Referenced by ome::files::out::OMETIFFWriter::setId(), and validateModel().

+ Here is the caller graph for this function:

◆ validateOMEXML()

bool ome::files::validateOMEXML ( const std::string &  document)

Validate an OME-XML document.

Parameters
documentthe XML document source.
Returns
true if valid, false if invalid.

References validateOMEXML(), and validateXML().

Referenced by getOMEXML(), and validateOMEXML().

+ Here is the caller graph for this function:

◆ validateXML()

bool ome::files::validateXML ( const std::string &  s,
const std::string &  loc = "XML" 
)

Validate XML in an XML string.

Parameters
sthe string to validate.
locthe file location or other descriptive text for the string; used for error reporting only.
Returns
true if valid, false if invalid.

Referenced by validateOMEXML().

+ Here is the caller graph for this function:

◆ verifyMinimum()

void ome::files::verifyMinimum ( ::ome::xml::meta::MetadataRetrieve retrieve,
dimension_size_type  series = 0U 
)

Verify correctness of minimal amount of metadata in a series.

Parameters
retrievethe OME-XML metadata store.
seriesthe image series to verify.
Exceptions
FormatExceptionif any metadata is missing.

References ome::xml::meta::MetadataRetrieve::getChannelCount(), ome::xml::meta::MetadataRetrieve::getChannelID(), ome::xml::meta::MetadataRetrieve::getImageID(), ome::xml::meta::MetadataRetrieve::getPixelsID(), ome::xml::meta::MetadataStore::getRoot(), and verifyMinimum().

Referenced by ome::files::in::OMETIFFReader::isFilenameThisTypeImpl(), and verifyMinimum().

+ Here is the caller graph for this function: