ome-files
0.5.0
|
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_type & | MetadataMap::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_type & | MetadataMap::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::OMEXMLMetadata > | createOMEXMLMetadata (ome::common::xml::dom::Document &document) |
Create OME-XML metadata from DOM Document. More... | |
std::shared_ptr<::ome::xml::meta::OMEXMLMetadata > | createOMEXMLMetadata (const boost::filesystem::path &file) |
Create OME-XML metadata from XML file. More... | |
std::shared_ptr<::ome::xml::meta::OMEXMLMetadata > | createOMEXMLMetadata (const std::string &text) |
Create OME-XML metadata from XML string. More... | |
std::shared_ptr<::ome::xml::meta::OMEXMLMetadata > | createOMEXMLMetadata (std::istream &stream) |
Create OME-XML metadata from XML input stream. More... | |
std::shared_ptr<::ome::xml::meta::OMEXMLMetadata > | createOMEXMLMetadata (const FormatReader &reader, bool doPlane=false, bool doImageName=true) |
Create OME-XML metadata from reader core metadata. More... | |
std::shared_ptr<::ome::xml::meta::MetadataRoot > | createOMEXMLRoot (const std::string &document) |
Create OME-XML metadata root from XML document. More... | |
std::shared_ptr<::ome::xml::meta::OMEXMLMetadata > | getOMEXMLMetadata (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 ®ion) |
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. | |
OME-Files image reading and writing.
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.
enum ome::files::Domain |
Imaging domain.
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.
omexml | the OME-XML metadata store. |
series | the series containing the Pixels element to add MetadataOnly to. |
resolve | true 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().
pixel_size_type ome::files::bitsPerPixel | ( | ::ome::xml::model::enums::PixelType | pixeltype | ) |
Get the size of a PixelType, in bits.
pixeltype | the PixelType to query. |
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().
pixel_size_type ome::files::bytesPerPixel | ( | ::ome::xml::model::enums::PixelType | pixeltype | ) |
Get the size of a PixelType, in bytes.
pixeltype | the PixelType to query. |
Referenced by ome::files::detail::FormatReader::getOptimalTileHeight(), pixelSize(), pixelTypeFromBytes(), and ome::files::detail::FormatReader::readPlane().
|
inline |
Byteswap value to switch endianness.
value | the value to swap. |
Referenced by ome::files::detail::FormatReader::readPlane().
|
inline |
Byteswap value to switch endianness.
value | the value to swap. |
|
inline |
Byteswap value to switch endianness.
value | the value to swap. |
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).
order | the string dimension order. |
std::logic_error | if the provided order is invalid. |
References createDimensionOrder().
Referenced by createDimensionOrder().
std::string ome::files::createID | ( | std::string const & | type, |
dimension_size_type | idx | ||
) |
Create an object identifier for a given object type and index.
type | the object type. |
idx | the object index. |
References createID().
Referenced by createID(), fillMetadata(), fillOriginalMetadata(), and fillPixels().
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.
type | the object type. |
idx1 | the first object index. |
idx2 | the second object index. |
References createID().
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.
type | the object type. |
idx1 | the first object index. |
idx2 | the second object index. |
idx3 | the third object index. |
References createID().
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.
type | the object type. |
idx1 | the first object index. |
idx2 | the second object index. |
idx3 | the third object index. |
idx4 | the fourth object index. |
References createID().
std::shared_ptr<::ome::xml::meta::OMEXMLMetadata > ome::files::createOMEXMLMetadata | ( | ome::common::xml::dom::Document & | document | ) |
Create OME-XML metadata from DOM Document.
document | the XML document. |
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().
std::shared_ptr<::ome::xml::meta::OMEXMLMetadata > ome::files::createOMEXMLMetadata | ( | const boost::filesystem::path & | file | ) |
Create OME-XML metadata from XML file.
file | the XML file. |
References createOMEXMLMetadata(), ome::common::xml::dom::ParseParameters::doSchema, and ome::common::xml::dom::ParseParameters::validationSchemaFullChecking.
std::shared_ptr<::ome::xml::meta::OMEXMLMetadata > ome::files::createOMEXMLMetadata | ( | const std::string & | text | ) |
Create OME-XML metadata from XML string.
text | the XML string. |
References createOMEXMLMetadata(), ome::common::xml::dom::ParseParameters::doSchema, and ome::common::xml::dom::ParseParameters::validationSchemaFullChecking.
std::shared_ptr<::ome::xml::meta::OMEXMLMetadata > ome::files::createOMEXMLMetadata | ( | std::istream & | stream | ) |
Create OME-XML metadata from XML input stream.
stream | the XML input stream. |
References createOMEXMLMetadata(), ome::common::xml::dom::ParseParameters::doSchema, and ome::common::xml::dom::ParseParameters::validationSchemaFullChecking.
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.
reader | the reader to use. |
doPlane | create Plane elements if true . |
doImageName | set image name if true . |
References createOMEXMLMetadata(), and fillMetadata().
std::shared_ptr<::ome::xml::meta::MetadataRoot > ome::files::createOMEXMLRoot | ( | const std::string & | document | ) |
Create OME-XML metadata root from XML document.
document | the XML document source. |
References createOMEXMLMetadata(), and createOMEXMLRoot().
Referenced by createOMEXMLRoot().
bool ome::files::defaultCreationDateEnabled | ( | ) |
Check if default creation date is enabled.
true
if enabled, false
otherwise. References defaultCreationDateEnabled().
Referenced by defaultCreationDateEnabled(), and setDefaultCreationDate().
void ome::files::defaultCreationDateEnabled | ( | bool | enabled | ) |
Enable or disable default creation date.
This setting enables or disables the replacement of missing creation dates.
enabled | true to enable, false to disable. |
References defaultCreationDateEnabled().
std::string ome::files::escapeXML | ( | const std::string & | s | ) |
Replace special characters with XML entities in an XML string.
s | the string to escape. |
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.
store | the OME-XML metadata store. |
reader | the reader to use. |
References fillAllPixels(), fillPixels(), ome::files::FormatReader::getSeries(), ome::files::FormatReader::getSeriesCount(), and ome::files::FormatReader::setSeries().
Referenced by fillAllPixels().
void ome::files::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.
store | the OME-XML metadata store. |
reader | the reader to use. |
doPlane | create Plane elements if true . |
doImageName | set image name if true . |
References addMetadataOnly(), createID(), fillMetadata(), fillPixels(), ome::files::FormatReader::getCurrentFile(), ome::files::FormatReader::getImageCount(), ome::xml::meta::OMEXMLMetadata::getPixelsBinDataCount(), ome::files::FormatReader::getPixelType(), ome::files::FormatReader::getSeries(), ome::files::FormatReader::getSeriesCount(), ome::xml::meta::OMEXMLMetadata::getTiffDataCount(), ome::files::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::files::FormatReader::setSeries().
Referenced by createOMEXMLMetadata(), fillMetadata(), ome::files::in::MinimalTIFFReader::initFile(), and ome::files::in::OMETIFFReader::initFile().
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.
store | the OME-XML metadata store. |
seriesList | the core metadata to use. |
doPlane | create 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().
void ome::files::fillOriginalMetadata | ( | ::ome::xml::meta::OMEXMLMetadata & | omexml, |
const MetadataMap & | metadata | ||
) |
Create OriginalMetadataAnnotations from MetadataMap.
omexml | the OME-XML metadata store. |
metadata | the 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().
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.
store | the OME-XML metadata store. |
reader | the 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().
void ome::files::fillPixels | ( | ::ome::xml::meta::MetadataStore & | store, |
const CoreMetadata & | seriesMetadata, | ||
dimension_size_type | series | ||
) |
Fill an OME-XML metadata store Pixels element from core metadata.
Set Pixels metadata for the the specified series.
store | the OME-XML metadata store. |
seriesMetadata | the seriesMetadata the metadata to use. |
series | the series to set. |
References ome::files::CoreMetadata::bitsPerPixel, createID(), ome::files::CoreMetadata::dimensionOrder, fillPixels(), ome::files::CoreMetadata::interleaved, ome::files::CoreMetadata::littleEndian, ome::files::CoreMetadata::pixelType, 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(), ome::xml::meta::MetadataStore::setPixelsType(), ome::files::CoreMetadata::sizeC, ome::files::CoreMetadata::sizeT, ome::files::CoreMetadata::sizeX, ome::files::CoreMetadata::sizeY, and ome::files::CoreMetadata::sizeZ.
const std::string & ome::files::getDomain | ( | Domain | domain | ) |
Get the string corresponding to a particular Domain.
domain | the Domain to use. |
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().
const std::vector< std::string > & ome::files::getDomainCollection | ( | DomainCollection | domains | ) |
Get the strings corresponding to a particular Domain collection.
domains | the Domain collection to use. |
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().
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).
order | dimension order. |
zSize | total number of focal planes (real size). |
cSize | total number of channels (real size). |
tSize | total number of time points (real size). |
num | total number of image planes (zSize * cSize * tSize), specified as a consistency check. |
z | the Z coordinate of ZCT coordinate triple to convert to 1D index (real size). |
c | the C coordinate of ZCT coordinate triple to convert to 1D index (real size). |
t | the T coordinate of ZCT coordinate triple to convert to 1D index (real size). |
Referenced by ome::files::detail::FormatReader::getCoreMetadata(), ome::files::detail::FormatWriter::getIndex(), getIndex(), ome::files::detail::FormatReader::getIndex(), and ome::files::in::OMETIFFReader::initFile().
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).
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.order | dimension order. |
zSize | total number of focal planes (real size). |
cSize | total number of channels (real size). |
tSize | total number of time points (real size). |
moduloZSize | total number of ModuloZ planes (real size). |
moduloCSize | total number of ModuloC channels (real size). |
moduloTSize | total number of ModuloT time points (real size). |
num | total number of image planes (zSize * cSize * tSize), specified as a consistency check. |
z | the Z coordinate of ZCTmZmCmT coordinate sextuple to convert to 1D index (effective size). |
c | the C coordinate of ZCTmZmCmT coordinate sextuple to convert to 1D index (effective size). |
t | the T coordinate of ZCTmZmCmT coordinate sextuple to convert to 1D index (effective size). |
moduloZ | the ModuloZ coordinate of ZCTmZmCmT coordinate sextuple to convert to 1D index (effective size). |
moduloC | the ModuloC coordinate of ZCTmZmCmT coordinate sextuple to convert to 1D index (effective size). |
moduloT | the ModuloT coordinate of ZCTmZmCmT coordinate sextuple to convert to 1D index (effective size). |
References getIndex().
std::string ome::files::getModelVersion | ( | ) |
Get the currently-supported OME Data Model version.
std::string ome::files::getModelVersion | ( | ome::common::xml::dom::Document & | document | ) |
Get the model version used by an OME-XML document.
document | the OME-XML document. |
References ome::common::xml::dom::Document::getDocumentElement().
std::string ome::files::getModelVersion | ( | const std::string & | document | ) |
Get the model version used by an OME-XML document.
document | the OME-XML document. |
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.
omexml | the OME-XML metadata store. |
tag | the Modulo annotation XML tag name. |
image | the image index. |
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().
Modulo ome::files::getModuloAlongC | ( | const ::ome::xml::meta::OMEXMLMetadata & | omexml, |
dimension_size_type | image | ||
) |
Get ModuloAlongC annotation from OME-XML metadata.
omexml | the OME-XML metadata store. |
image | the image index. |
References getModulo(), and getModuloAlongC().
Referenced by getModuloAlongC(), and ome::files::in::OMETIFFReader::initFile().
Modulo ome::files::getModuloAlongT | ( | const ::ome::xml::meta::OMEXMLMetadata & | omexml, |
dimension_size_type | image | ||
) |
Get ModuloAlongT annotation from OME-XML metadata.
omexml | the OME-XML metadata store. |
image | the image index. |
References getModulo(), and getModuloAlongT().
Referenced by getModuloAlongT(), and ome::files::in::OMETIFFReader::initFile().
Modulo ome::files::getModuloAlongZ | ( | const ::ome::xml::meta::OMEXMLMetadata & | omexml, |
dimension_size_type | image | ||
) |
Get ModuloAlongZ annotation from OME-XML metadata.
omexml | the OME-XML metadata store. |
image | the image index. |
References getModulo(), and getModuloAlongZ().
Referenced by getModuloAlongZ(), and ome::files::in::OMETIFFReader::initFile().
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.
omexml | the OME-XML metadata store. |
validate | true to validate the OME-XML, false to skip validation. |
References ome::xml::meta::OMEXMLMetadata::dumpXML(), getOMEXML(), and validateOMEXML().
Referenced by ome::files::out::OMETIFFWriter::getOMEXML(), and getOMEXML().
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.
retrieve | the metadata to use. |
References getOMEXMLMetadata().
Referenced by getOMEXMLMetadata().
MetadataMap ome::files::getOriginalMetadata | ( | ::ome::xml::meta::OMEXMLMetadata & | omexml | ) |
Get original metadata from OME-XML metadata StructuredAnnotations.
omexml | the OME-XML metadata store. |
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().
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.
order | dimension order. |
zSize | total number of focal planes (real size). |
cSize | total number of channels (real size). |
tSize | total number of time points (real size). |
num | total number of image planes (zSize * cSize * tSize), specified as a consistency check. |
index | 1D (rasterized) index to convert to ZCT coordinates. |
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().
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.
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.order | dimension order. |
zSize | total number of focal planes (effective size). |
cSize | total number of channels (effective size). |
tSize | total number of time points (effective size). |
moduloZSize | total number of ModuloZ planes (effective size). |
moduloCSize | total number of ModuloC channels (effective size). |
moduloTSize | total number of ModuloT time points (effective size). |
num | total number of image planes (zSize * cSize * tSize), specified as a consistency check. |
index | 1D (rasterized) index to convert to ZCTmZmCmT coordinates. |
References getZCTCoords().
bool ome::files::isComplex | ( | ::ome::xml::model::enums::PixelType | pixeltype | ) |
Check whether a PixelType is complex.
pixeltype | the PixelType to query. |
true
if complex, false
otherwise. bool ome::files::isFloatingPoint | ( | ::ome::xml::model::enums::PixelType | pixeltype | ) |
Check whether a PixelType is floating point.
pixeltype | the PixelType to query. |
!isInteger
().true
if floating point, false
otherwise. References isInteger().
bool ome::files::isInteger | ( | ::ome::xml::model::enums::PixelType | pixeltype | ) |
Check whether a PixelType is integer.
pixeltype | the PixelType to query. |
true
if integer, false
otherwise. Referenced by isFloatingPoint().
bool ome::files::isSigned | ( | ::ome::xml::model::enums::PixelType | pixeltype | ) |
Check whether a PixelType is signed.
pixeltype | the PixelType to query. |
true
if signed, false
otherwise.
|
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.
key | the key to find. |
boost::bad_get | on failure if the key was not found or if the type did not match the stored value type. |
References ome::files::MetadataMap::discriminating_map.
|
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.
key | the key to find. |
boost::bad_get | on failure if the key was not found or if the type did not match the stored value type. |
References ome::files::MetadataMap::discriminating_map.
|
inline |
Intersect two regions.
If the regions do not intersect, a default-constructed region of zero size will be returned.
a | the first region. |
b | the second region. |
References ome::files::PlaneRegion::h, ome::files::PlaneRegion::PlaneRegion(), ome::files::PlaneRegion::w, ome::files::PlaneRegion::x, and ome::files::PlaneRegion::y.
|
inline |
Output Version to output stream.
os | the output stream. |
version | the Version to output. |
References ome::files::Version::major.
|
inline |
Output Modulo to output stream.
os | the output stream. |
modulo | the Modulo to output. |
References ome::files::Modulo::parentDimension.
|
inline |
Output FileInfo to output stream.
os | the output stream. |
info | the FileInfo to output. |
References ome::files::FileInfo::filename.
|
inline |
Output CoreMetadata to output stream.
os | the output stream. |
core | the CoreMetadata to output. |
References ome::files::CoreMetadata::sizeX.
|
inline |
Output PlaneRegion to output stream.
os | the output stream. |
region | the PlaneRegion to output. |
References ome::files::PlaneRegion::x.
|
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.
a | the first region. |
b | the second region. |
References ome::files::PlaneRegion::h, ome::files::PlaneRegion::PlaneRegion(), ome::files::PlaneRegion::w, ome::files::PlaneRegion::x, and ome::files::PlaneRegion::y.
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.
meta | the metadata to use. |
series | the image series to use. |
References bytesPerPixel(), and pixelSize().
Referenced by pixelSize(), ome::files::out::MinimalTIFFWriter::setId(), ome::files::out::OMETIFFWriter::setId(), and significantPixelSize().
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.
meta | the metadata to use. |
References pixelSize().
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.
bytes | the storage size in bits. |
is_signed | true if signed, false if unsigned. |
is_integer | true if integer, false otherwise. |
is_complex | :c true if complex, false otherwise. |
if | no pixel type was identified or the parameters are invalid. |
References 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.
bytes | the storage size in bytes. |
is_signed | true if signed, false if unsigned. |
is_integer | true if integer, false otherwise. |
is_complex | :c true if complex, false otherwise. |
if | no 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().
void ome::files::register_module_paths | ( | ) |
Register the OME-Files module paths with OME-Common.
This function forces path registration.
References register_module_paths(), and ome::common::register_module_paths().
void ome::files::removeBinData | ( | ::ome::xml::meta::OMEXMLMetadata & | omexml | ) |
Remove all BinData elements from OME-XML metadata.
omexml | the 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().
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.
omexml | the OME-XML metadata store. |
image | the image index. |
sizeC | the 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().
void ome::files::removeTiffData | ( | ::ome::xml::meta::OMEXMLMetadata & | omexml | ) |
Remove all TiffData elements from OME-XML metadata.
omexml | the 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().
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 #
.
s | the string to filter. |
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.
store | the OME-XML metadata store. |
series | the series for which to set the creation date. |
id | the filename for the series. |
References defaultCreationDateEnabled(), setDefaultCreationDate(), and ome::xml::meta::MetadataStore::setImageAcquisitionDate().
Referenced by fillMetadata(), and setDefaultCreationDate().
pixel_size_type ome::files::significantBitsPerPixel | ( | ::ome::xml::model::enums::PixelType | pixeltype | ) |
Get the significant (maximum bits used) size of a PixelType, in bits.
pixeltype | the PixelType to query. |
Referenced by ome::files::tiff::getCoreMetadata(), ome::files::tiff::IFD::setBitsPerSample(), and significantPixelSize().
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.
meta | the metadata to use. |
series | the image series to use. |
References significantBitsPerPixel(), and significantPixelSize().
Referenced by ome::files::out::MinimalTIFFWriter::setId(), ome::files::out::OMETIFFWriter::setId(), and significantPixelSize().
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.
meta | the metadata to use. |
References pixelSize(), and significantPixelSize().
std::string ome::files::transformToLatestModelVersion | ( | const std::string & | document | ) |
Transform an OME-XML document to the latest model version.
document | the OME-XML document. |
References transformToLatestModelVersion().
Referenced by transformToLatestModelVersion().
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.
meta | the metadata store. |
correct | true to attempt correction, false to leave unmodified. |
true
if valid, false
if invalid. FormatException | if 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().
bool ome::files::validateOMEXML | ( | const std::string & | document | ) |
Validate an OME-XML document.
document | the XML document source. |
true
if valid, false
if invalid. References validateOMEXML(), and validateXML().
Referenced by getOMEXML(), and validateOMEXML().
bool ome::files::validateXML | ( | const std::string & | s, |
const std::string & | loc = "XML" |
||
) |
Validate XML in an XML string.
s | the string to validate. |
loc | the file location or other descriptive text for the string; used for error reporting only. |
true
if valid, false
if invalid. Referenced by validateOMEXML().
void ome::files::verifyMinimum | ( | ::ome::xml::meta::MetadataRetrieve & | retrieve, |
dimension_size_type | series = 0U |
||
) |
Verify correctness of minimal amount of metadata in a series.
retrieve | the OME-XML metadata store. |
series | the image series to verify. |
FormatException | if 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().