bioformats  5.1.8
Namespaces | Classes | Typedefs | Enumerations | Functions | Variables
ome::bioformats Namespace Reference

Bio-Formats 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::COMPLEX >
 Properties of COMPLEX pixels. More...
 
struct  PixelProperties< ::ome::xml::model::enums::PixelType::DOUBLE >
 Properties of DOUBLE pixels. More...
 
struct  PixelProperties< ::ome::xml::model::enums::PixelType::DOUBLECOMPLEX >
 Properties of DOUBLECOMPLEX 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...
 
ome::compat::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...
 
ome::compat::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...
 
ome::compat::shared_ptr< ::ome::xml::meta::OMEXMLMetadatacreateOMEXMLMetadata (ome::common::xml::dom::Document &document)
 Create OME-XML metadata from DOM Document. More...
 
ome::compat::shared_ptr< ::ome::xml::meta::OMEXMLMetadatacreateOMEXMLMetadata (const boost::filesystem::path &file)
 Create OME-XML metadata from XML file. More...
 
ome::compat::shared_ptr< ::ome::xml::meta::OMEXMLMetadatacreateOMEXMLMetadata (const std::string &text)
 Create OME-XML metadata from XML string. More...
 
ome::compat::shared_ptr< ::ome::xml::meta::OMEXMLMetadatacreateOMEXMLMetadata (std::istream &stream)
 Create OME-XML metadata from XML input stream. More...
 
ome::compat::shared_ptr< ::ome::xml::meta::OMEXMLMetadatacreateOMEXMLMetadata (const FormatReader &reader, bool doPlane=false, bool doImageName=true)
 Create OME-XML metadata from reader core metadata. More...
 
ome::compat::shared_ptr< ::ome::xml::meta::MetadataRootcreateOMEXMLRoot (const std::string &document)
 Create OME-XML metadata root from XML document. More...
 
ome::compat::shared_ptr< ::ome::xml::meta::OMEXMLMetadatagetOMEXMLMetadata (ome::compat::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< ome::compat::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 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...
 
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...
 
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...
 
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...
 

Variables

const Version release_version (OME_VERSION_MAJOR, OME_VERSION_MINOR, OME_VERSION_PATCH, OME_VERSION_EXTRA_S)
 The release version number of the library currently being linked against.
 
const ::ome::xml::model::primitives::Timestamp release_date (posix_release_date())
 The release date of the library currently being linked against.
 

Detailed Description

Bio-Formats image reading and writing.

Enumeration Type Documentation

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).

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.

Endianness.

Enumerator
ENDIAN_BIG 

Big endian.

ENDIAN_LITTLE 

Little endian.

ENDIAN_NATIVE 

Native endian.

Function Documentation

void ome::bioformats::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 ome::xml::meta::OMEXMLMetadata::getRoot(), and ome::xml::meta::OMEXMLMetadata::resolveReferences().

Referenced by fillMetadata(), and ome::bioformats::in::OMETIFFReader::getMetadataStoreForDisplay().

+ Here is the caller graph for this function:

pixel_size_type ome::bioformats::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::qtwidgets::gl::Image2D::create(), ome::bioformats::detail::FormatReader::getBitsPerPixel(), ome::bioformats::tiff::getCoreMetadata(), ome::bioformats::in::OMETIFFReader::initFile(), ome::bioformats::out::MinimalTIFFWriter::setupIFD(), and ome::bioformats::out::OMETIFFWriter::setupIFD().

+ Here is the caller graph for this function:

pixel_size_type ome::bioformats::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::bioformats::detail::FormatReader::getOptimalTileHeight(), pixelSize(), and pixelTypeFromBytes().

+ Here is the caller graph for this function:

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

Byteswap value to switch endianness.

Parameters
valuethe value to swap.
template<>
void ome::bioformats::byteswap ( std::complex< float > &  value)
inline

Byteswap value to switch endianness.

Parameters
valuethe value to swap.
template<>
void ome::bioformats::byteswap ( std::complex< double > &  value)
inline

Byteswap value to switch endianness.

Parameters
valuethe value to swap.
ome::xml::model::enums::DimensionOrder ome::bioformats::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.
std::string ome::bioformats::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.

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

+ Here is the caller graph for this function:

std::string ome::bioformats::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.
std::string ome::bioformats::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.
std::string ome::bioformats::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.
ome::compat::shared_ptr<::ome::xml::meta::OMEXMLMetadata > ome::bioformats::createOMEXMLMetadata ( ome::common::xml::dom::Document document)

Create OME-XML metadata from DOM Document.

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

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

Referenced by createOMEXMLMetadata(), createOMEXMLRoot(), ome::bioformats::in::OMETIFFReader::initFile(), ome::bioformats::in::OMETIFFReader::isFilenameThisTypeImpl(), and ome::bioformats::in::OMETIFFReader::isSingleFile().

+ Here is the caller graph for this function:

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

Create OME-XML metadata from XML file.

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

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

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

Create OME-XML metadata from XML string.

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

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

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

Create OME-XML metadata from XML input stream.

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

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

ome::compat::shared_ptr<::ome::xml::meta::OMEXMLMetadata > ome::bioformats::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 fillMetadata().

ome::compat::shared_ptr<::ome::xml::meta::MetadataRoot > ome::bioformats::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().

bool ome::bioformats::defaultCreationDateEnabled ( )

Check if default creation date is enabled.

Returns
true if enabled, false otherwise.

Referenced by setDefaultCreationDate().

+ Here is the caller graph for this function:

void ome::bioformats::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.
std::string ome::bioformats::escapeXML ( const std::string &  s)

Replace special characters with XML entities in an XML string.

Parameters
sthe string to escape.
Returns
the escaped string.
void ome::bioformats::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 fillPixels(), ome::bioformats::FormatReader::getSeries(), ome::bioformats::FormatReader::getSeriesCount(), and ome::bioformats::FormatReader::setSeries().

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

Fill OME-XML metadata store from reader core metadata.

The metadata store is expected to be empty.

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

References addMetadataOnly(), createID(), fillPixels(), ome::bioformats::FormatReader::getCurrentFile(), ome::bioformats::FormatReader::getImageCount(), ome::bioformats::FormatReader::getPixelType(), ome::bioformats::FormatReader::getSeries(), ome::bioformats::FormatReader::getSeriesCount(), ome::bioformats::FormatReader::getZCTCoords(), setDefaultCreationDate(), ome::xml::meta::MetadataStore::setImageID(), ome::xml::meta::MetadataStore::setPlaneTheC(), ome::xml::meta::MetadataStore::setPlaneTheT(), ome::xml::meta::MetadataStore::setPlaneTheZ(), and ome::bioformats::FormatReader::setSeries().

Referenced by createOMEXMLMetadata(), ome::bioformats::in::MinimalTIFFReader::initFile(), and ome::bioformats::in::OMETIFFReader::initFile().

+ Here is the caller graph for this function:

void ome::bioformats::fillMetadata ( ::ome::xml::meta::MetadataStore store,
const std::vector< ome::compat::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(), fillPixels(), getZCTCoords(), ome::xml::meta::MetadataStore::setImageID(), ome::xml::meta::MetadataStore::setPlaneTheC(), ome::xml::meta::MetadataStore::setPlaneTheT(), and ome::xml::meta::MetadataStore::setPlaneTheZ().

void ome::bioformats::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::bioformats::MetadataMap::empty(), ome::bioformats::MetadataMap::flatten(), ome::xml::meta::OMEXMLMetadata::getRoot(), ome::xml::meta::OMEXMLMetadata::getXMLAnnotationID(), and ome::xml::meta::OMEXMLMetadata::resolveReferences().

Referenced by ome::bioformats::detail::FormatReader::setId().

+ Here is the caller graph for this function:

void ome::bioformats::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(), ome::bioformats::FormatReader::getBitsPerPixel(), ome::bioformats::FormatReader::getDimensionOrder(), ome::bioformats::FormatReader::getEffectiveSizeC(), ome::bioformats::FormatReader::getPixelType(), ome::bioformats::FormatReader::getRGBChannelCount(), ome::bioformats::FormatReader::getSeries(), ome::bioformats::FormatReader::getSizeC(), ome::bioformats::FormatReader::getSizeT(), ome::bioformats::FormatReader::getSizeX(), ome::bioformats::FormatReader::getSizeY(), ome::bioformats::FormatReader::getSizeZ(), ome::bioformats::FormatReader::isInterleaved(), ome::bioformats::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(), and fillMetadata().

+ Here is the caller graph for this function:

void ome::bioformats::fillPixels ( ::ome::xml::meta::MetadataStore store,
const CoreMetadata seriesMetadata,
dimension_size_type  series 
)
const std::string & ome::bioformats::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::bioformats::in::MinimalTIFFReader::MinimalTIFFReader().

+ Here is the caller graph for this function:

const std::vector< std::string > & ome::bioformats::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::bioformats::in::OMETIFFReader::getDomains(), and ome::bioformats::in::OMETIFFReader::OMETIFFReader().

+ Here is the caller graph for this function:

dimension_size_type ome::bioformats::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::bioformats::detail::FormatWriter::getIndex(), getIndex(), ome::bioformats::detail::FormatReader::getIndex(), and ome::bioformats::in::OMETIFFReader::initFile().

+ Here is the caller graph for this function:

dimension_size_type ome::bioformats::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().

std::string ome::bioformats::getModelVersion ( )

Get the currently-supported OME Data Model version.

Returns
the model version.
std::string ome::bioformats::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().

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

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

Parameters
documentthe OME-XML document.
Returns
the model version.
Modulo ome::bioformats::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::begin(), ome::xml::createDocument(), ome::common::xml::dom::NodeList::empty(), ome::common::xml::dom::NodeList::end(), ome::common::xml::dom::Document::getElementsByTagName(), and ome::xml::meta::OMEXMLMetadata::getRoot().

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

+ Here is the caller graph for this function:

Modulo ome::bioformats::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().

Referenced by ome::bioformats::in::OMETIFFReader::initFile().

+ Here is the caller graph for this function:

Modulo ome::bioformats::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().

Referenced by ome::bioformats::in::OMETIFFReader::initFile().

+ Here is the caller graph for this function:

Modulo ome::bioformats::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().

Referenced by ome::bioformats::in::OMETIFFReader::initFile().

+ Here is the caller graph for this function:

std::string ome::bioformats::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(), and validateOMEXML().

Referenced by ome::bioformats::out::OMETIFFWriter::getOMEXML().

+ Here is the caller graph for this function:

ome::compat::shared_ptr<::ome::xml::meta::OMEXMLMetadata > ome::bioformats::getOMEXMLMetadata ( ome::compat::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 ome::xml::meta::convert().

MetadataMap ome::bioformats::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::createDocument(), ome::xml::model::detail::OMEModelObject::getChildrenByTagName(), ome::common::xml::dom::Document::getDocumentElement(), ome::xml::meta::OMEXMLMetadata::getRoot(), ome::bioformats::MetadataMap::set(), and ome::common::xml::dom::ParseParameters::validationScheme.

Referenced by ome::bioformats::in::OMETIFFReader::initFile().

+ Here is the caller graph for this function:

ome::compat::array< dimension_size_type, 3 > ome::bioformats::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::bioformats::out::OMETIFFWriter::fillMetadata(), fillMetadata(), ome::bioformats::detail::FormatWriter::getZCTCoords(), getZCTCoords(), ome::bioformats::detail::FormatReader::getZCTCoords(), and ome::bioformats::detail::FormatReader::getZCTModuloCoords().

+ Here is the caller graph for this function:

ome::compat::array< dimension_size_type, 6 > ome::bioformats::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::bioformats::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().

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

Check whether a PixelType is complex.

Parameters
pixeltypethe PixelType to query.
Returns
true if complex, false otherwise.
bool ome::bioformats::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().

bool ome::bioformats::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:

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

Check whether a PixelType is signed.

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

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.
template<>
const MetadataMap::value_type& ome::bioformats::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.
PlaneRegion ome::bioformats::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::bioformats::PlaneRegion::h, ome::bioformats::PlaneRegion::w, ome::bioformats::PlaneRegion::x, and ome::bioformats::PlaneRegion::y.

template<class charT , class traits >
std::basic_ostream<charT,traits>& ome::bioformats::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::bioformats::Version::major.

template<class charT , class traits >
std::basic_ostream<charT,traits>& ome::bioformats::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::bioformats::Modulo::parentDimension.

template<class charT , class traits >
std::basic_ostream<charT,traits>& ome::bioformats::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::bioformats::FileInfo::filename.

template<class charT , class traits >
std::basic_ostream<charT,traits>& ome::bioformats::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::bioformats::CoreMetadata::sizeX.

template<class charT , class traits >
std::basic_ostream<charT,traits>& ome::bioformats::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::bioformats::PlaneRegion::x.

PlaneRegion ome::bioformats::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::bioformats::PlaneRegion::h, ome::bioformats::PlaneRegion::w, ome::bioformats::PlaneRegion::x, and ome::bioformats::PlaneRegion::y.

storage_size_type ome::bioformats::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().

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

+ Here is the caller graph for this function:

storage_size_type ome::bioformats::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().

ome::xml::model::enums::PixelType ome::bioformats::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().

ome::xml::model::enums::PixelType ome::bioformats::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::COMPLEX, ome::xml::model::enums::PixelType::DOUBLE, ome::xml::model::enums::PixelType::DOUBLECOMPLEX, 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:

void ome::bioformats::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(), and ome::xml::meta::OMEXMLMetadata::resolveReferences().

Referenced by ome::bioformats::out::OMETIFFWriter::close(), and ome::bioformats::in::OMETIFFReader::getMetadataStoreForDisplay().

+ Here is the caller graph for this function:

void ome::bioformats::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(), and ome::xml::meta::OMEXMLMetadata::resolveReferences().

Referenced by ome::bioformats::in::OMETIFFReader::cleanMetadata().

+ Here is the caller graph for this function:

std::string ome::bioformats::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.
void ome::bioformats::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(), and ome::xml::meta::MetadataStore::setImageAcquisitionDate().

Referenced by fillMetadata().

+ Here is the caller graph for this function:

pixel_size_type ome::bioformats::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::bioformats::tiff::getCoreMetadata(), ome::bioformats::tiff::IFD::setBitsPerSample(), and significantPixelSize().

+ Here is the caller graph for this function:

storage_size_type ome::bioformats::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().

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

+ Here is the caller graph for this function:

storage_size_type ome::bioformats::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().

std::string ome::bioformats::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.
Todo:
Implement model transforms.
bool ome::bioformats::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(), and ome::xml::meta::MetadataStore::setPixelsSizeC().

Referenced by ome::bioformats::out::OMETIFFWriter::setId().

+ Here is the caller graph for this function:

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

Validate an OME-XML document.

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

References validateXML().

Referenced by getOMEXML().

+ Here is the caller graph for this function:

bool ome::bioformats::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.

References ome::xml::createDocument().

Referenced by validateOMEXML().

+ Here is the caller graph for this function:

void ome::bioformats::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(), and ome::xml::meta::MetadataStore::getRoot().

Referenced by ome::bioformats::in::OMETIFFReader::isFilenameThisTypeImpl().

+ Here is the caller graph for this function: