bioformats  5.1.6
Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | Private Member Functions | List of all members
ome::bioformats::detail::FormatReader Class Referenceabstract

Interface for all biological file format readers (default behaviour). More...

#include <ome/bioformats/detail/FormatReader.h>

+ Inheritance diagram for ome::bioformats::detail::FormatReader:
+ Collaboration diagram for ome::bioformats::detail::FormatReader:

Public Member Functions

virtual ~FormatReader ()
 Destructor.
 
const std::set< MetadataOptions::MetadataLevel > & getSupportedMetadataLevels ()
 Get the supported metadata levels. More...
 
void setMetadataOptions (const MetadataOptions &options)
 Set metadata options. More...
 
const MetadataOptionsgetMetadataOptions () const
 Get metadata options. More...
 
MetadataOptionsgetMetadataOptions ()
 Get metadata options. More...
 
const MetadataMapgetGlobalMetadata () const
 Get global metadata map. More...
 
const MetadataMap::value_typegetMetadataValue (const std::string &field) const
 Get a global metadata value. More...
 
const MetadataMapgetSeriesMetadata () const
 Get series metadata map. More...
 
const MetadataMap::value_typegetSeriesMetadataValue (const MetadataMap::key_type &field) const
 Get a series metadata value. More...
 
bool isThisType (const boost::filesystem::path &name, bool open=true) const
 Check if the given file is a valid instance of this file format. More...
 
bool isThisType (const uint8_t *begin, std::size_t length) const
 Check if the given buffer is a valid header for this file format. More...
 
bool isThisType (const uint8_t *begin, const uint8_t *end) const
 Check if the given buffer is a valid header for this file format. More...
 
bool isThisType (std::istream &stream) const
 Check if the given input stream is a valid stream for this file format. More...
 
dimension_size_type getImageCount () const
 Determine the number of image planes in the current series. More...
 
bool isRGB (dimension_size_type channel) const
 Check if the image planes for a channel have more than one sub-channel per openBytes() call. More...
 
dimension_size_type getSizeX () const
 Get the size of the X dimension. More...
 
dimension_size_type getSizeY () const
 Get the size of the Y dimension. More...
 
dimension_size_type getSizeZ () const
 Get the size of the Z dimension. More...
 
dimension_size_type getSizeT () const
 Get the size of the T dimension. More...
 
dimension_size_type getSizeC () const
 Get the size of the C dimension. More...
 
ome::xml::model::enums::PixelType getPixelType () const
 Get the pixel type. More...
 
pixel_size_type getBitsPerPixel () const
 Get the number of valid bits per pixel. More...
 
dimension_size_type getEffectiveSizeC () const
 Get the effective size of the C dimension. More...
 
dimension_size_type getRGBChannelCount (dimension_size_type channel) const
 Get the number of channels returned for a call to openBytes(). More...
 
bool isIndexed () const
 Get whether the image planes are indexed color. More...
 
bool isFalseColor () const
 Get whether the image planes are false color. More...
 
void getLookupTable (dimension_size_type plane, VariantPixelBuffer &buf) const
 Get the color lookup table associated with an image plane. More...
 
ModulogetModuloZ ()
 Get the Modulo subdivision of the Z dimension. More...
 
const ModulogetModuloZ () const
 Get the Modulo subdivision of the Z dimension. More...
 
ModulogetModuloT ()
 Get the Modulo subdivision of the T dimension. More...
 
const ModulogetModuloT () const
 Get the Modulo subdivision of the T dimension. More...
 
ModulogetModuloC ()
 Get the Modulo subdivision of the C dimension. More...
 
const ModulogetModuloC () const
 Get the Modulo subdivision of the C dimension. More...
 
dimension_size_type getThumbSizeX () const
 Get the thumbnail size of the X dimension. More...
 
dimension_size_type getThumbSizeY () const
 Get the thumbnail size of the Y dimension. More...
 
bool isLittleEndian () const
 Get whether the data is in little-endian format. More...
 
const std::string & getDimensionOrder () const
 Get the dimension order. More...
 
bool isOrderCertain () const
 Get whether the dimension order and sizes are known, or merely guesses. More...
 
bool isThumbnailSeries () const
 Get whether the current series is a lower resolution copy of a different series. More...
 
bool isInterleaved () const
 Get whether or not the channels are interleaved. More...
 
bool isInterleaved (dimension_size_type subC) const
 Get whether or not the given channel is interleaved. More...
 
void openBytes (dimension_size_type plane, VariantPixelBuffer &buf) const
 Obtain an image plane. More...
 
void openBytes (dimension_size_type plane, VariantPixelBuffer &buf, dimension_size_type x, dimension_size_type y, dimension_size_type w, dimension_size_type h) const
 Obtain a sub-image of an image plane. More...
 
void openThumbBytes (dimension_size_type plane, VariantPixelBuffer &buf) const
 Obtain a thumbnail of an image plane. More...
 
void close (bool fileOnly=false)
 Close the currently open file. More...
 
dimension_size_type getSeriesCount () const
 Get the number of image series in this file. More...
 
void setSeries (dimension_size_type series) const
 Set the active series. More...
 
dimension_size_type getSeries () const
 Get the active series. More...
 
void setPlane (dimension_size_type plane) const
 Set the active plane. More...
 
dimension_size_type getPlane () const
 Get the active plane. More...
 
void setGroupFiles (bool group)
 Set file grouping. More...
 
bool isGroupFiles () const
 Get file grouping. More...
 
FileGroupOption fileGroupOption (const std::string &id)
 Returns an enum indicating that we cannot, must, or might group the files in this dataset. More...
 
bool isMetadataComplete () const
 Get status of metadata parsing. More...
 
void setNormalized (bool normalize)
 Set float normalization. More...
 
bool isNormalized () const
 Get float normalization. More...
 
void setOriginalMetadataPopulated (bool populate)
 Specifies whether or not to save proprietary metadata in the MetadataStore.
 
bool isOriginalMetadataPopulated () const
 Get proprietary metadata storage. More...
 
const std::vector< boost::filesystem::path > getUsedFiles (bool noPixels=false) const
 Get the files used by this dataset. More...
 
const std::vector< boost::filesystem::path > getSeriesUsedFiles (bool noPixels=false) const
 Get the files used by the active series. More...
 
std::vector< FileInfogetAdvancedUsedFiles (bool noPixels=false) const
 Get the files used by this dataset. More...
 
std::vector< FileInfogetAdvancedSeriesUsedFiles (bool noPixels=false) const
 Get the files used by the active series. More...
 
const boost::optional< boost::filesystem::path > & getCurrentFile () const
 Get the currently open file. More...
 
dimension_size_type getIndex (dimension_size_type z, dimension_size_type c, dimension_size_type t) const
 Get the linear index of a Z, C and T coordinate. More...
 
dimension_size_type getIndex (dimension_size_type z, dimension_size_type c, dimension_size_type t, dimension_size_type moduloZ, dimension_size_type moduloC, dimension_size_type moduloT) const
 Get the linear index of a Z, C, T, ModuloZ, ModuloC and ModuloT coordinate. More...
 
ome::compat::array< dimension_size_type, 3 > getZCTCoords (dimension_size_type index) const
 Get the Z, C and T coordinate of a linear index. More...
 
ome::compat::array< dimension_size_type, 6 > getZCTModuloCoords (dimension_size_type index) const
 Get the Z, C, T, ModuloZ, ModuloC and ModuloT coordinate of a linear index. More...
 
const std::vector< ome::compat::shared_ptr< ::ome::bioformats::CoreMetadata > > & getCoreMetadataList () const
 Get the core metadata. More...
 
void setMetadataFiltered (bool filter)
 Set metadata filtering. More...
 
bool isMetadataFiltered () const
 Get metadata filtering. More...
 
void setMetadataStore (ome::compat::shared_ptr< ::ome::xml::meta::MetadataStore > &store)
 Set the default metadata store for this reader. More...
 
const ome::compat::shared_ptr< ::ome::xml::meta::MetadataStore > & getMetadataStore () const
 Get the current metadata store for this reader. More...
 
ome::compat::shared_ptr< ::ome::xml::meta::MetadataStore > & getMetadataStore ()
 Get the current metadata store for this reader. More...
 
std::vector< ome::compat::shared_ptr< ::ome::bioformats::FormatReader > > getUnderlyingReaders () const
 Get all underlying readers. More...
 
bool isSingleFile (const boost::filesystem::path &id) const
 Is this a single-file format? More...
 
uint32_t getRequiredDirectories (const std::vector< std::string > &files) const
 Get required parent directories. More...
 
const std::string & getDatasetStructureDescription () const
 Get a short description of the dataset structure. More...
 
const std::vector< std::string > & getPossibleDomains (const std::string &id) const
 Get the possible domains represented in which this format is used. More...
 
bool hasCompanionFiles () const
 Does this format support multi-file datasets? More...
 
const std::vector< std::string > & getDomains () const
 Get the domains represented by the current file. More...
 
dimension_size_type getOptimalTileWidth (dimension_size_type channel) const
 Get the optimal sub-image width. More...
 
dimension_size_type getOptimalTileHeight (dimension_size_type channel) const
 Get the optimal sub-image height. More...
 
dimension_size_type getOptimalTileWidth () const
 Get the optimal sub-image width. More...
 
dimension_size_type getOptimalTileHeight () const
 Get the optimal sub-image height. More...
 
dimension_size_type seriesToCoreIndex (dimension_size_type series) const
 Get the first core index corresponding to the specified series. More...
 
dimension_size_type coreIndexToSeries (dimension_size_type index) const
 Get the series corresponding to the specified core index. More...
 
dimension_size_type getCoreIndex () const
 Get the CoreMetadata index of the current resolution/series. More...
 
void setCoreIndex (dimension_size_type index) const
 Set the current resolution/series (ignoring sub-resolutions). More...
 
dimension_size_type getResolutionCount () const
 Get the number of resolutions for the current series. More...
 
void setResolution (dimension_size_type resolution) const
 Set the active resolution level. More...
 
dimension_size_type getResolution () const
 Get the active resolution level. More...
 
bool hasFlattenedResolutions () const
 Get resolution flattening. More...
 
void setFlattenedResolutions (bool flatten)
 Set resolution flattening. More...
 
void setId (const boost::filesystem::path &id)
 Set the current file name. More...
 
const std::string & getFormat () const
 Get the name of this file format. More...
 
const std::string & getFormatDescription () const
 Get the description of this file format. More...
 
const std::vector< boost::filesystem::path > & getSuffixes () const
 Get the default file suffixes for this file format. More...
 
const std::vector< boost::filesystem::path > & getCompressionSuffixes () const
 Get the default compression suffixes for this file format. More...
 
- Public Member Functions inherited from ome::bioformats::FormatHandler
virtual ~FormatHandler ()
 Destructor.
 
- Public Member Functions inherited from ome::bioformats::MetadataConfigurable
virtual ~MetadataConfigurable ()
 Destructor.
 

Protected Types

typedef std::vector< ome::compat::shared_ptr< ::ome::bioformats::CoreMetadata > > coremetadata_list_type
 List type for storing CoreMetadata.
 

Protected Member Functions

 FormatReader (const ReaderProperties &)
 Constructor.
 
virtual void initFile (const boost::filesystem::path &id)
 Initialize the given file. More...
 
virtual bool isUsedFile (const boost::filesystem::path &file)
 Check if a file is in the used files list. More...
 
virtual void readPlane (std::istream &source, VariantPixelBuffer &dest, dimension_size_type x, dimension_size_type y, dimension_size_type w, dimension_size_type h, dimension_size_type samples)
 Read a raw plane. More...
 
virtual void readPlane (std::istream &source, VariantPixelBuffer &dest, dimension_size_type x, dimension_size_type y, dimension_size_type w, dimension_size_type h, dimension_size_type scanlinePad, dimension_size_type samples)
 Read a raw plane with scanline padding. More...
 
virtual ome::compat::shared_ptr< ::ome::xml::meta::MetadataStoremakeFilterMetadata ()
 Create a configured FilterMetadata instance. More...
 
const CoreMetadatagetCoreMetadata (dimension_size_type index) const
 Get CoreMetadata by core index. More...
 
CoreMetadatagetCoreMetadata (dimension_size_type index)
 Get CoreMetadata by core index. More...
 
virtual bool isFilenameThisTypeImpl (const boost::filesystem::path &name) const
 isThisType file implementation for readers. More...
 
virtual bool isStreamThisTypeImpl (std::istream &stream) const
 isThisType stream implementation for readers. More...
 
ome::compat::array< dimension_size_type, 2 > getThumbSize () const
 Get the thumbnail size of the X and Y dimensions. More...
 
virtual void openBytesImpl (dimension_size_type plane, VariantPixelBuffer &buf, dimension_size_type x, dimension_size_type y, dimension_size_type w, dimension_size_type h) const =0
 Obtain a sub-image of an image plane. More...
 
- Protected Member Functions inherited from ome::bioformats::FormatReader
 FormatReader ()
 Constructor.
 
- Protected Member Functions inherited from ome::bioformats::FormatHandler
 FormatHandler ()
 Constructor.
 
- Protected Member Functions inherited from ome::bioformats::MetadataConfigurable
 MetadataConfigurable ()
 Constructor.
 

Protected Attributes

const ReaderPropertiesreaderProperties
 Reader properties specific to the derived file format.
 
boost::optional< boost::filesystem::path > currentId
 The identifier (path) of the currently open file.
 
ome::compat::shared_ptr< std::istream > in
 Current input.
 
::ome::bioformats::MetadataMap metadata
 Mapping of metadata key/value pairs.
 
dimension_size_type coreIndex
 The number of the current series (flattened). More...
 
dimension_size_type series
 The number of the current series (non-flattened). More...
 
dimension_size_type plane
 The number of the current plane in the current series. More...
 
coremetadata_list_type core
 Core metadata values.
 
dimension_size_type resolution
 The number of the current resolution. More...
 
bool flattenedResolutions
 Whether or not resolutions are flattened.
 
bool suffixNecessary
 Whether the file extension matching one of the reader's suffixes is necessary to identify the file as an instance of this format.
 
bool suffixSufficient
 Whether the file extension matching one of the reader's suffixes is sufficient to identify the file as an instance of this format.
 
bool companionFiles
 Whether this format supports multi-file datasets.
 
std::string datasetDescription
 Short description of the structure of the dataset.
 
bool normalizeData
 Whether or not to normalize float data.
 
bool filterMetadata
 Whether or not to filter out invalid metadata.
 
bool saveOriginalMetadata
 Whether or not to save proprietary metadata in the MetadataStore.
 
bool indexedAsRGB
 Whether or not MetadataStore sets C = 3 for indexed color images.
 
bool group
 Whether or not to group multi-file formats.
 
std::vector< std::string > domains
 List of domains in which this format is used.
 
ome::compat::shared_ptr< ::ome::xml::meta::MetadataStoremetadataStore
 Current metadata store. More...
 
MetadataOptions metadataOptions
 Metadata parsing options.
 

Private Member Functions

 FormatReader (const FormatReader &)
 Copy constructor (deleted).
 
FormatReaderoperator= (const FormatReader &)
 Assignment operator (deleted).
 

Additional Inherited Members

- Public Types inherited from ome::bioformats::FormatReader
enum  FileGroupOption { MUST_GROUP, CAN_GROUP, CANNOT_GROUP }
 File grouping options. More...
 
- Static Public Member Functions inherited from ome::bioformats::FormatHandler
static bool checkSuffix (const boost::filesystem::path &name, const boost::filesystem::path &suffix)
 Perform suffix matching for the given filename. More...
 
static bool checkSuffix (const boost::filesystem::path &name, const std::vector< boost::filesystem::path > &suffixes)
 Perform suffix matching for the given filename. More...
 
static bool checkSuffix (const boost::filesystem::path &name, const std::vector< boost::filesystem::path > &suffixes, const std::vector< boost::filesystem::path > &compression_suffixes)
 Perform suffix matching for the given filename. More...
 
static void assertId (const boost::optional< boost::filesystem::path > &id, bool notNull=true)
 Assert that the current file is valid. More...
 

Detailed Description

Interface for all biological file format readers (default behaviour).

Differences from the Java implementation:

Member Function Documentation

void ome::bioformats::detail::FormatReader::close ( bool  fileOnly = false)
virtual

Close the currently open file.

Parameters
fileOnlyclose the open file only if true, or else free all internal state if false.

Implements ome::bioformats::FormatHandler.

Reimplemented in ome::bioformats::in::OMETIFFReader, ome::bioformats::in::MinimalTIFFReader, and ome::bioformats::in::TIFFReader.

References core, coreIndex, currentId, in, plane, resolution, and series.

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

+ Here is the caller graph for this function:

dimension_size_type ome::bioformats::detail::FormatReader::coreIndexToSeries ( dimension_size_type  index) const
virtual

Get the series corresponding to the specified core index.

Parameters
indexthe core index to use.
Returns
the series for the index.

Implements ome::bioformats::FormatReader.

References core, coreIndex, hasFlattenedResolutions(), and series.

Referenced by getSeriesCount(), and setCoreIndex().

+ Here is the caller graph for this function:

FormatReader::FileGroupOption ome::bioformats::detail::FormatReader::fileGroupOption ( const std::string &  id)
virtual

Returns an enum indicating that we cannot, must, or might group the files in this dataset.

Parameters
idfilename to check.
Returns
the grouping option for the specified file.

Implements ome::bioformats::FormatReader.

Reimplemented in ome::bioformats::in::OMETIFFReader.

References ome::bioformats::FormatReader::CANNOT_GROUP.

std::vector< FileInfo > ome::bioformats::detail::FormatReader::getAdvancedSeriesUsedFiles ( bool  noPixels = false) const
virtual

Get the files used by the active series.

Parameters
noPixelsexclude pixel data files if true, or include them if false.
Returns
a list of FileInfo objects representing each used file.

Implements ome::bioformats::FormatReader.

References ome::common::canonical(), ome::bioformats::FileInfo::filename, getCurrentFile(), getFormat(), getSeriesUsedFiles(), ome::bioformats::FileInfo::reader, and ome::bioformats::FileInfo::usedToInitialize.

std::vector< FileInfo > ome::bioformats::detail::FormatReader::getAdvancedUsedFiles ( bool  noPixels = false) const
virtual

Get the files used by this dataset.

Parameters
noPixelsexclude pixel data files if true, or include them if false.
Returns
a list of FileInfo objects representing each used file.

Implements ome::bioformats::FormatReader.

References ome::common::canonical(), ome::bioformats::FileInfo::filename, getCurrentFile(), getFormat(), getUsedFiles(), ome::bioformats::FileInfo::reader, and ome::bioformats::FileInfo::usedToInitialize.

pixel_size_type ome::bioformats::detail::FormatReader::getBitsPerPixel ( ) const
virtual

Get the number of valid bits per pixel.

The number of valid bits per pixel is always less than or equal to the number of bits per pixel that correspond to getPixelType().

Returns
the number of valid bits per pixel.
Todo:
: Move this logic into a CoreMetadata accessor. Why are we modifying coremetadata during an explicitly nonmodifying operation??

Implements ome::bioformats::FormatReader.

References ome::bioformats::FormatHandler::assertId(), ome::bioformats::bitsPerPixel(), ome::bioformats::CoreMetadata::bitsPerPixel, currentId, getCoreIndex(), getCoreMetadata(), and getPixelType().

const std::vector< boost::filesystem::path > & ome::bioformats::detail::FormatReader::getCompressionSuffixes ( ) const
virtual

Get the default compression suffixes for this file format.

Returns
a list of file suffixes.

Implements ome::bioformats::FormatHandler.

References ome::bioformats::detail::ReaderProperties::compression_suffixes, and readerProperties.

dimension_size_type ome::bioformats::detail::FormatReader::getCoreIndex ( ) const
virtual
const CoreMetadata& ome::bioformats::detail::FormatReader::getCoreMetadata ( dimension_size_type  index) const
inlineprotected
CoreMetadata& ome::bioformats::detail::FormatReader::getCoreMetadata ( dimension_size_type  index)
inlineprotected

Get CoreMetadata by core index.

Parameters
indexthe core index.
Returns
the CoreMetadata.
Exceptions
std::range_errorif the core index is invalid.
std::logic_errorif the metadata is null.
const std::vector< ome::compat::shared_ptr<::ome::bioformats::CoreMetadata > > & ome::bioformats::detail::FormatReader::getCoreMetadataList ( ) const
virtual

Get the core metadata.

A CoreMetadata object exists to describe the each series in the dataset.

Returns
a const reference to the core metadata.

Implements ome::bioformats::FormatReader.

References ome::bioformats::FormatHandler::assertId(), core, and currentId.

const boost::optional< boost::filesystem::path > & ome::bioformats::detail::FormatReader::getCurrentFile ( ) const
virtual

Get the currently open file.

Returns
the filename.

Implements ome::bioformats::FormatReader.

References currentId.

Referenced by getAdvancedSeriesUsedFiles(), and getAdvancedUsedFiles().

+ Here is the caller graph for this function:

const std::string & ome::bioformats::detail::FormatReader::getDatasetStructureDescription ( ) const
virtual

Get a short description of the dataset structure.

Returns
a short description.

Implements ome::bioformats::FormatReader.

References datasetDescription.

const std::string & ome::bioformats::detail::FormatReader::getDimensionOrder ( ) const
virtual

Get the dimension order.

The dimension order is a five-character string representing the order in which planes will be returned. Valid orders are:

  • XYCTZ
  • XYCZT
  • XYTCZ
  • XYTZC
  • XYZCT
  • XYZTC

In cases where the channels are interleaved (e.g. CXYTZ), C will be the first dimension after X and Y (e.g. XYCTZ) and the isInterleaved() method will return true.

Returns
the dimension order.

Implements ome::bioformats::FormatReader.

References ome::bioformats::FormatHandler::assertId(), currentId, ome::bioformats::CoreMetadata::dimensionOrder, getCoreIndex(), and getCoreMetadata().

Referenced by getIndex(), getZCTCoords(), getZCTModuloCoords(), and readPlane().

+ Here is the caller graph for this function:

const std::vector< std::string > & ome::bioformats::detail::FormatReader::getDomains ( ) const
virtual

Get the domains represented by the current file.

Returns
a list of domains.

Implements ome::bioformats::FormatReader.

Reimplemented in ome::bioformats::in::OMETIFFReader.

References ome::bioformats::FormatHandler::assertId(), currentId, and domains.

dimension_size_type ome::bioformats::detail::FormatReader::getEffectiveSizeC ( ) const
virtual

Get the effective size of the C dimension.

This guarantees that

regardless of the result of isRGB().

Returns
the effective C dimension size.

Implements ome::bioformats::FormatReader.

References getCoreIndex(), getCoreMetadata(), and ome::bioformats::CoreMetadata::sizeC.

Referenced by getIndex(), getOptimalTileHeight(), getOptimalTileWidth(), getZCTCoords(), and getZCTModuloCoords().

+ Here is the caller graph for this function:

const std::string & ome::bioformats::detail::FormatReader::getFormat ( ) const
virtual

Get the name of this file format.

Returns
the file format name.

Implements ome::bioformats::FormatHandler.

References ome::bioformats::detail::ReaderProperties::name, and readerProperties.

Referenced by getAdvancedSeriesUsedFiles(), and getAdvancedUsedFiles().

+ Here is the caller graph for this function:

const std::string & ome::bioformats::detail::FormatReader::getFormatDescription ( ) const
virtual

Get the description of this file format.

Returns
the file format description.

Implements ome::bioformats::FormatHandler.

References ome::bioformats::detail::ReaderProperties::description, and readerProperties.

const MetadataMap & ome::bioformats::detail::FormatReader::getGlobalMetadata ( ) const
virtual

Get global metadata map.

Obtain the map containing the global metadata field/value pairs the current dataset.

Returns
the global metadata map.

Implements ome::bioformats::FormatReader.

References metadata.

dimension_size_type ome::bioformats::detail::FormatReader::getImageCount ( ) const
virtual

Determine the number of image planes in the current series.

Returns
the number of image planes.

Implements ome::bioformats::FormatReader.

References ome::bioformats::FormatHandler::assertId(), currentId, getCoreIndex(), getCoreMetadata(), and ome::bioformats::CoreMetadata::imageCount.

Referenced by getIndex(), getZCTCoords(), getZCTModuloCoords(), ome::bioformats::in::OMETIFFReader::initFile(), and setPlane().

+ Here is the caller graph for this function:

dimension_size_type ome::bioformats::detail::FormatReader::getIndex ( dimension_size_type  z,
dimension_size_type  c,
dimension_size_type  t 
) const
virtual

Get the linear index of a Z, C and T coordinate.

The index is computed using the DimensionOrder.

Parameters
zthe Z coordinate (real size).
cthe C coordinate (real size).
tthe T coordinate (real size).
Returns
the linear index.
Todo:

unify with the pixel buffer dimension indexes.

Don't use separate values to match the return of getZCTCoords.

Implements ome::bioformats::FormatReader.

References ome::bioformats::FormatHandler::assertId(), currentId, getDimensionOrder(), getEffectiveSizeC(), getImageCount(), ome::bioformats::getIndex(), getSizeT(), and getSizeZ().

dimension_size_type ome::bioformats::detail::FormatReader::getIndex ( dimension_size_type  z,
dimension_size_type  c,
dimension_size_type  t,
dimension_size_type  moduloZ,
dimension_size_type  moduloC,
dimension_size_type  moduloT 
) const
virtual

Get the linear index of a Z, C, T, ModuloZ, ModuloC and ModuloT coordinate.

The index is computed using the DimensionOrder.

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
zthe Z coordinate (effective size).
cthe C coordinate (effective size).
tthe T coordinate (effective size).
moduloZthe ModuloZ coordinate (effective size).
moduloCthe ModuloC coordinate (effective size).
moduloTthe ModuloT coordinate (effective size).
Returns
the linear index.
Todo:

unify with the pixel buffer dimension indexes.

Don't use separate values to match the return of getZCTModuloCoords.

Implements ome::bioformats::FormatReader.

References ome::bioformats::FormatHandler::assertId(), currentId, getDimensionOrder(), getEffectiveSizeC(), getImageCount(), ome::bioformats::getIndex(), getModuloC(), getModuloT(), getModuloZ(), getSizeT(), and getSizeZ().

void ome::bioformats::detail::FormatReader::getLookupTable ( dimension_size_type  plane,
VariantPixelBuffer buf 
) const
virtual

Get the color lookup table associated with an image plane.

If no image planes have been opened, or if isIndexed() returns false, then this may throw an exception.

The VariantPixelBuffer will use the X dimension for the value index and the sub-channel dimension for the color samples (order is RGB). Depending upon the image type, the size of the X dimension may vary. It will typically be 2^8 or 2^16, but other sizes are possible.

Parameters
bufthe destination pixel buffer.
planethe plane index within the series.
Exceptions
FormatExceptionif a lookup table could not be obtained.

Implements ome::bioformats::FormatReader.

Reimplemented in ome::bioformats::in::OMETIFFReader, and ome::bioformats::in::MinimalTIFFReader.

References ome::bioformats::FormatHandler::assertId(), and currentId.

const MetadataOptions & ome::bioformats::detail::FormatReader::getMetadataOptions ( ) const
virtual

Get metadata options.

Returns
the current options.

Implements ome::bioformats::MetadataConfigurable.

References metadataOptions.

MetadataOptions & ome::bioformats::detail::FormatReader::getMetadataOptions ( )
virtual

Get metadata options.

Returns
the current options.

Implements ome::bioformats::MetadataConfigurable.

References metadataOptions.

const ome::compat::shared_ptr<::ome::xml::meta::MetadataStore > & ome::bioformats::detail::FormatReader::getMetadataStore ( ) const
virtual

Get the current metadata store for this reader.

Returns
the metadata store, which will never be null.

Implements ome::bioformats::FormatReader.

References metadataStore.

Referenced by ome::bioformats::in::OMETIFFReader::getMetadataStoreForConversion(), ome::bioformats::in::OMETIFFReader::getMetadataStoreForDisplay(), ome::bioformats::in::MinimalTIFFReader::initFile(), initFile(), makeFilterMetadata(), and setId().

+ Here is the caller graph for this function:

ome::compat::shared_ptr<::ome::xml::meta::MetadataStore > & ome::bioformats::detail::FormatReader::getMetadataStore ( )
virtual

Get the current metadata store for this reader.

Returns
the metadata store, which will never be null.

Implements ome::bioformats::FormatReader.

References metadataStore.

const MetadataMap::value_type & ome::bioformats::detail::FormatReader::getMetadataValue ( const std::string &  field) const
virtual

Get a global metadata value.

Obtain the specified metadata field's value for the current dataset.

Parameters
fieldthe name associated with the metadata field.
Returns
the value.
Exceptions
boost::bad_geton failure if the key was not found.

Implements ome::bioformats::FormatReader.

References ome::bioformats::MetadataMap::get(), and metadata.

Modulo & ome::bioformats::detail::FormatReader::getModuloC ( )
virtual

Get the Modulo subdivision of the C dimension.

Returns
the Modulo defining the C dimension subdivision.

Implements ome::bioformats::FormatReader.

References getCoreIndex(), getCoreMetadata(), and ome::bioformats::CoreMetadata::moduloC.

Referenced by getIndex(), getZCTModuloCoords(), and setId().

+ Here is the caller graph for this function:

const Modulo & ome::bioformats::detail::FormatReader::getModuloC ( ) const
virtual

Get the Modulo subdivision of the C dimension.

Returns
the Modulo defining the C dimension subdivision.

Implements ome::bioformats::FormatReader.

References getCoreIndex(), getCoreMetadata(), and ome::bioformats::CoreMetadata::moduloC.

Modulo & ome::bioformats::detail::FormatReader::getModuloT ( )
virtual

Get the Modulo subdivision of the T dimension.

Returns
the Modulo defining the T dimension subdivision.

Implements ome::bioformats::FormatReader.

References getCoreIndex(), getCoreMetadata(), and ome::bioformats::CoreMetadata::moduloT.

Referenced by getIndex(), getZCTModuloCoords(), and setId().

+ Here is the caller graph for this function:

const Modulo & ome::bioformats::detail::FormatReader::getModuloT ( ) const
virtual

Get the Modulo subdivision of the T dimension.

Returns
the Modulo defining the T dimension subdivision.

Implements ome::bioformats::FormatReader.

References getCoreIndex(), getCoreMetadata(), and ome::bioformats::CoreMetadata::moduloT.

Modulo & ome::bioformats::detail::FormatReader::getModuloZ ( )
virtual

Get the Modulo subdivision of the Z dimension.

Returns
the Modulo defining the Z dimension subdivision.

Implements ome::bioformats::FormatReader.

References getCoreIndex(), getCoreMetadata(), and ome::bioformats::CoreMetadata::moduloZ.

Referenced by getIndex(), getZCTModuloCoords(), and setId().

+ Here is the caller graph for this function:

const Modulo & ome::bioformats::detail::FormatReader::getModuloZ ( ) const
virtual

Get the Modulo subdivision of the Z dimension.

Returns
the Modulo defining the Z dimension subdivision.

Implements ome::bioformats::FormatReader.

References getCoreIndex(), getCoreMetadata(), and ome::bioformats::CoreMetadata::moduloZ.

dimension_size_type ome::bioformats::detail::FormatReader::getOptimalTileHeight ( dimension_size_type  channel) const
virtual

Get the optimal sub-image height.

This is intended for use with openBytes().

Parameters
channelthe channel to use, range [0, EffectiveSizeC).
Returns
the optimal height.

Implements ome::bioformats::FormatReader.

Reimplemented in ome::bioformats::in::OMETIFFReader.

References ome::bioformats::FormatHandler::assertId(), ome::bioformats::bytesPerPixel(), currentId, getPixelType(), getRGBChannelCount(), getSizeX(), and getSizeY().

dimension_size_type ome::bioformats::detail::FormatReader::getOptimalTileHeight ( ) const
virtual

Get the optimal sub-image height.

This is intended for use with openBytes(). Note that this overload does not have a channel argument, and so the value returned is the smallest height for all channels for convienience and compatibility with the Java implementation. If the optimal height varies widely between channels, this may result in suboptimal performance; specify the channel to get the optimal height for each channel.

Returns
the optimal height.

Implements ome::bioformats::FormatReader.

References ome::bioformats::FormatHandler::assertId(), currentId, and getEffectiveSizeC().

dimension_size_type ome::bioformats::detail::FormatReader::getOptimalTileWidth ( dimension_size_type  channel) const
virtual

Get the optimal sub-image width.

This is intended for use with openBytes().

Parameters
channelthe channel to use, range [0, EffectiveSizeC).
Returns
the optimal width.

Implements ome::bioformats::FormatReader.

Reimplemented in ome::bioformats::in::OMETIFFReader.

References ome::bioformats::FormatHandler::assertId(), currentId, and getSizeX().

dimension_size_type ome::bioformats::detail::FormatReader::getOptimalTileWidth ( ) const
virtual

Get the optimal sub-image width.

This is intended for use with openBytes(). Note that this overload does not have a channel argument, and so the value returned is the smallest width for all channels for convienience and compatibility with the Java implementation. If the optimal width varies widely between channels, this may result in suboptimal performance; specify the channel to get the optimal width for each channel.

Returns
the optimal width.

Implements ome::bioformats::FormatReader.

References ome::bioformats::FormatHandler::assertId(), currentId, and getEffectiveSizeC().

ome::xml::model::enums::PixelType ome::bioformats::detail::FormatReader::getPixelType ( ) const
virtual

Get the pixel type.

Returns
the pixel type.

Implements ome::bioformats::FormatReader.

References ome::bioformats::FormatHandler::assertId(), currentId, getCoreIndex(), getCoreMetadata(), and ome::bioformats::CoreMetadata::pixelType.

Referenced by getBitsPerPixel(), getOptimalTileHeight(), and readPlane().

+ Here is the caller graph for this function:

dimension_size_type ome::bioformats::detail::FormatReader::getPlane ( ) const
virtual

Get the active plane.

Returns
the active plane.

Implements ome::bioformats::FormatReader.

References ome::bioformats::FormatHandler::assertId(), currentId, and plane.

const std::vector< std::string > & ome::bioformats::detail::FormatReader::getPossibleDomains ( const std::string &  id) const
virtual

Get the possible domains represented in which this format is used.

Parameters
idfilename to check.
Returns
a list of domains.
Exceptions
FormatExceptionif there was a problem parsing the metadata of the file.
Todo:
can this be a reference to static data?

Implements ome::bioformats::FormatReader.

References domains.

uint32_t ome::bioformats::detail::FormatReader::getRequiredDirectories ( const std::vector< std::string > &  files) const
virtual

Get required parent directories.

Get the number of parent directories that are important when processing the given list of files. The number of directories is relative to the common parent. For example, given a list with these two files:

  • /path/to/file/foo
  • /path/to/file/that/is/related

A return value of 0 indicates that /path/to/file/ is irrelevant. A return value of 1 indicates that /path/to/ is irrelevant. Return values less than 0 are invalid.

All listed files are assumed to belong to datasets of the same format.

Parameters
filesthe file list being processed.
Returns
the number of important parent directories for the file list.
Exceptions
FormatExceptionif there was a problem parsing the metadata of the file.
Todo:
This could use a much better explanation, it's not at all clear what the return value means. Is it an index into files? Is it an index into the path components? Of which of the files? In which order? From the root or common parent? Is the order of files important?

Implements ome::bioformats::FormatReader.

dimension_size_type ome::bioformats::detail::FormatReader::getResolution ( ) const
virtual

Get the active resolution level.

Returns
the resolution level.
See also
getResolutionCount()

Implements ome::bioformats::FormatReader.

References resolution.

dimension_size_type ome::bioformats::detail::FormatReader::getResolutionCount ( ) const
virtual

Get the number of resolutions for the current series.

Resolutions are stored in descending order of size, so the largest resolution is first and the smallest resolution is last.

Returns
the number of resolutions.

Implements ome::bioformats::FormatReader.

References ome::bioformats::FormatHandler::assertId(), core, currentId, getSeries(), hasFlattenedResolutions(), and seriesToCoreIndex().

Referenced by setResolution().

+ Here is the caller graph for this function:

dimension_size_type ome::bioformats::detail::FormatReader::getRGBChannelCount ( dimension_size_type  channel) const
virtual

Get the number of channels returned for a call to openBytes().

The most common case where this value is greater than 1 is for interleaved RGB data, such as a 24-bit color image plane. However, it is possible for this value to be greater than 1 for non-interleaved data, such as an RGB TIFF with Planar rather than Chunky configuration.

Parameters
channelthe channel to use, range [0, EffectiveSizeC).
Returns
the number of channels.

Implements ome::bioformats::FormatReader.

References getCoreIndex(), getCoreMetadata(), and ome::bioformats::CoreMetadata::sizeC.

Referenced by getOptimalTileHeight(), and isRGB().

+ Here is the caller graph for this function:

dimension_size_type ome::bioformats::detail::FormatReader::getSeries ( ) const
virtual

Get the active series.

Returns
the active series.

Implements ome::bioformats::FormatReader.

References series.

Referenced by getResolutionCount(), ome::bioformats::in::MinimalTIFFReader::ifdAtIndex(), and setResolution().

+ Here is the caller graph for this function:

dimension_size_type ome::bioformats::detail::FormatReader::getSeriesCount ( ) const
virtual

Get the number of image series in this file.

Returns
the number of image series.
Exceptions
std::logic_errorif the sub-resolution metadata (if any) is invalid; this will only occur if the reader sets invalid metadata.

Implements ome::bioformats::FormatReader.

References ome::bioformats::FormatHandler::assertId(), core, coreIndexToSeries(), currentId, and hasFlattenedResolutions().

Referenced by ome::bioformats::in::OMETIFFReader::getMetadataStoreForConversion(), ome::bioformats::in::OMETIFFReader::getMetadataStoreForDisplay(), getUsedFiles(), and setId().

+ Here is the caller graph for this function:

const MetadataMap & ome::bioformats::detail::FormatReader::getSeriesMetadata ( ) const
virtual

Get series metadata map.

Obtain the map containing the series metadata field/value pairs the active series in the current dataset.

Returns
the series metadata map.

Implements ome::bioformats::FormatReader.

References ome::bioformats::FormatHandler::assertId(), currentId, getCoreIndex(), getCoreMetadata(), and ome::bioformats::CoreMetadata::seriesMetadata.

Referenced by getSeriesMetadataValue(), and setId().

+ Here is the caller graph for this function:

const MetadataMap::value_type & ome::bioformats::detail::FormatReader::getSeriesMetadataValue ( const MetadataMap::key_type field) const
virtual

Get a series metadata value.

Obtain the specified metadata field's value for the active series in the current dataset.

Parameters
fieldthe name associated with the metadata field.
Returns
the value.
Exceptions
boost::bad_geton failure if the key was not found.

Implements ome::bioformats::FormatReader.

References ome::bioformats::FormatHandler::assertId(), currentId, ome::bioformats::MetadataMap::get(), and getSeriesMetadata().

const std::vector< boost::filesystem::path > ome::bioformats::detail::FormatReader::getSeriesUsedFiles ( bool  noPixels = false) const
virtual

Get the files used by the active series.

Parameters
noPixelsexclude pixel data files if true, or include them if false.
Returns
a list of filenames.

Implements ome::bioformats::FormatReader.

Reimplemented in ome::bioformats::in::OMETIFFReader.

References currentId.

Referenced by getAdvancedSeriesUsedFiles(), and getUsedFiles().

+ Here is the caller graph for this function:

dimension_size_type ome::bioformats::detail::FormatReader::getSizeC ( ) const
virtual

Get the size of the C dimension.

Returns
the C dimension size.

Implements ome::bioformats::FormatReader.

References ome::bioformats::FormatHandler::assertId(), currentId, getCoreIndex(), and getCoreMetadata().

dimension_size_type ome::bioformats::detail::FormatReader::getSizeT ( ) const
virtual

Get the size of the T dimension.

Returns
the T dimension size.

Implements ome::bioformats::FormatReader.

References ome::bioformats::FormatHandler::assertId(), currentId, getCoreIndex(), getCoreMetadata(), and ome::bioformats::CoreMetadata::sizeT.

Referenced by getIndex(), getZCTCoords(), and getZCTModuloCoords().

+ Here is the caller graph for this function:

dimension_size_type ome::bioformats::detail::FormatReader::getSizeX ( ) const
virtual

Get the size of the X dimension.

Returns
the X dimension size.

Implements ome::bioformats::FormatReader.

References ome::bioformats::FormatHandler::assertId(), currentId, getCoreIndex(), getCoreMetadata(), and ome::bioformats::CoreMetadata::sizeX.

Referenced by getOptimalTileHeight(), getOptimalTileWidth(), getThumbSize(), and openBytes().

+ Here is the caller graph for this function:

dimension_size_type ome::bioformats::detail::FormatReader::getSizeY ( ) const
virtual

Get the size of the Y dimension.

Returns
the Y dimension size.

Implements ome::bioformats::FormatReader.

References ome::bioformats::FormatHandler::assertId(), currentId, getCoreIndex(), getCoreMetadata(), and ome::bioformats::CoreMetadata::sizeY.

Referenced by getOptimalTileHeight(), getThumbSize(), and openBytes().

+ Here is the caller graph for this function:

dimension_size_type ome::bioformats::detail::FormatReader::getSizeZ ( ) const
virtual

Get the size of the Z dimension.

Returns
the Z dimension size.

Implements ome::bioformats::FormatReader.

References ome::bioformats::FormatHandler::assertId(), currentId, getCoreIndex(), getCoreMetadata(), and ome::bioformats::CoreMetadata::sizeZ.

Referenced by getIndex(), getZCTCoords(), and getZCTModuloCoords().

+ Here is the caller graph for this function:

const std::vector< boost::filesystem::path > & ome::bioformats::detail::FormatReader::getSuffixes ( ) const
virtual

Get the default file suffixes for this file format.

Returns
a list of file suffixes.

Implements ome::bioformats::FormatHandler.

References readerProperties, and ome::bioformats::detail::ReaderProperties::suffixes.

const std::set< MetadataOptions::MetadataLevel > & ome::bioformats::detail::FormatReader::getSupportedMetadataLevels ( )
virtual

Get the supported metadata levels.

Returns
a set of supported metadata levels.

Implements ome::bioformats::MetadataConfigurable.

References ome::bioformats::detail::ReaderProperties::metadata_levels, and readerProperties.

ome::compat::array< dimension_size_type, 2 > ome::bioformats::detail::FormatReader::getThumbSize ( ) const
protected

Get the thumbnail size of the X and Y dimensions.

Returns
an array containing the X and Y dimension thumbnail size (in that order).

References ome::bioformats::FormatHandler::assertId(), currentId, getCoreIndex(), getCoreMetadata(), getSizeX(), getSizeY(), ome::bioformats::CoreMetadata::thumbSizeX, and ome::bioformats::CoreMetadata::thumbSizeY.

Referenced by getThumbSizeX(), and getThumbSizeY().

+ Here is the caller graph for this function:

dimension_size_type ome::bioformats::detail::FormatReader::getThumbSizeX ( ) const
virtual

Get the thumbnail size of the X dimension.

Returns
the X dimension thumbnail size.

Implements ome::bioformats::FormatReader.

References getThumbSize().

dimension_size_type ome::bioformats::detail::FormatReader::getThumbSizeY ( ) const
virtual

Get the thumbnail size of the Y dimension.

Returns
the Y dimension thumbnail size.

Implements ome::bioformats::FormatReader.

References getThumbSize().

std::vector< ome::compat::shared_ptr<::ome::bioformats::FormatReader > > ome::bioformats::detail::FormatReader::getUnderlyingReaders ( ) const
virtual

Get all underlying readers.

Note
If there are no underlying readers, the list will be empty.
Returns
a list of readers.

Implements ome::bioformats::FormatReader.

const std::vector< boost::filesystem::path > ome::bioformats::detail::FormatReader::getUsedFiles ( bool  noPixels = false) const
virtual

Get the files used by this dataset.

Parameters
noPixelsexclude pixel data files if true, or include them if false.
Returns
a list of filenames.

Implements ome::bioformats::FormatReader.

References getSeriesCount(), getSeriesUsedFiles(), and setSeries().

Referenced by getAdvancedUsedFiles(), initFile(), and isUsedFile().

+ Here is the caller graph for this function:

ome::compat::array< dimension_size_type, 3 > ome::bioformats::detail::FormatReader::getZCTCoords ( dimension_size_type  index) const
virtual

Get the Z, C and T coordinate of a linear index.

Parameters
indexthe linear index.
Returns
an array containing Z, C and T values (real sizes).
Todo:
unify with the pixel buffer dimension indexes.

Implements ome::bioformats::FormatReader.

References ome::bioformats::FormatHandler::assertId(), currentId, getDimensionOrder(), getEffectiveSizeC(), getImageCount(), getSizeT(), getSizeZ(), and ome::bioformats::getZCTCoords().

ome::compat::array< dimension_size_type, 6 > ome::bioformats::detail::FormatReader::getZCTModuloCoords ( dimension_size_type  index) const
virtual

Get the Z, C, T, ModuloZ, ModuloC and ModuloT coordinate of a linear index.

Note
The Z, C and T coordinates are not the same as those returned by getZCTCoords(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
indexthe linear index.
Returns
an array containing Z, C, T, ModuloZ, ModuloC and ModuloT values (effective sizes).
Todo:
unify with the pixel buffer dimension indexes.

Implements ome::bioformats::FormatReader.

References ome::bioformats::FormatHandler::assertId(), currentId, getDimensionOrder(), getEffectiveSizeC(), getImageCount(), getModuloC(), getModuloT(), getModuloZ(), getSizeT(), getSizeZ(), and ome::bioformats::getZCTCoords().

bool ome::bioformats::detail::FormatReader::hasCompanionFiles ( ) const
virtual

Does this format support multi-file datasets?

Returns
true if multiple files are supported, false otherwise.

Implements ome::bioformats::FormatReader.

References companionFiles.

bool ome::bioformats::detail::FormatReader::hasFlattenedResolutions ( ) const
virtual

Get resolution flattening.

Returns
true if flattening is enabled, false otherwise.

Implements ome::bioformats::FormatReader.

References flattenedResolutions.

Referenced by coreIndexToSeries(), getResolutionCount(), getSeriesCount(), and seriesToCoreIndex().

+ Here is the caller graph for this function:

void ome::bioformats::detail::FormatReader::initFile ( const boost::filesystem::path &  id)
protectedvirtual

Initialize the given file.

This will parse header information, etc. and is called by setId. Most subclasses should override this method to perform initialization operations such as parsing metadata.

Parameters
idthe filename to open.
Exceptions
FormatExceptionif a parsing error occurs processing the file.
See also
ome::bioformats::FormatHandler::setId.

Reimplemented in ome::bioformats::in::OMETIFFReader, and ome::bioformats::in::MinimalTIFFReader.

References ome::bioformats::MetadataMap::clear(), close(), core, coreIndex, currentId, getMetadataStore(), getUsedFiles(), metadata, and series.

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

+ Here is the caller graph for this function:

bool ome::bioformats::detail::FormatReader::isFalseColor ( ) const
virtual

Get whether the image planes are false color.

This will be false if isIndexed() is false, or if isIndexed() is true and the lookup table represents "real" color data. This will be true if isIndexed() is true and the lookup table is only present to aid in visualization.

Returns
true if false color, false otherwise.

Implements ome::bioformats::FormatReader.

References ome::bioformats::FormatHandler::assertId(), currentId, ome::bioformats::CoreMetadata::falseColor, getCoreIndex(), and getCoreMetadata().

bool ome::bioformats::detail::FormatReader::isFilenameThisTypeImpl ( const boost::filesystem::path &  name) const
protectedvirtual

isThisType file implementation for readers.

Readers which require opening a file in order to determine its type should override this method with their own implementation. Reader implementations should open the specified file using their preferred method and check its validity.

Parameters
namethe file to open for checking.
Returns
true if the file is valid, false otherwise.

Reimplemented in ome::bioformats::in::OMETIFFReader, and ome::bioformats::in::MinimalTIFFReader.

Referenced by isThisType().

+ Here is the caller graph for this function:

bool ome::bioformats::detail::FormatReader::isGroupFiles ( ) const
virtual

Get file grouping.

Returns
true if grouping is enabled, false otherwise.

Implements ome::bioformats::FormatReader.

References group.

bool ome::bioformats::detail::FormatReader::isIndexed ( ) const
virtual

Get whether the image planes are indexed color.

This value does not affect getSizeC(), getEffectiveSizeC() or getRGBChannelCount().

Returns
true if indexed, false otherwise.

Implements ome::bioformats::FormatReader.

References ome::bioformats::FormatHandler::assertId(), currentId, getCoreIndex(), getCoreMetadata(), and ome::bioformats::CoreMetadata::indexed.

bool ome::bioformats::detail::FormatReader::isInterleaved ( ) const
virtual

Get whether or not the channels are interleaved.

This method exists because X and Y must appear first in the dimension order. For interleaved data, getDimensionOrder() returns XYCTZ or XYCZT and this method returns true.

Note that this flag returns whether or not the data returned by openBytes() is interleaved. In most cases, this will match the interleaving in the original file, but for some formats (e.g. TIFF) channel re-ordering is done internally and the return value of this method will not match what is in the original file.

Returns
true if the channels are interleaved, false otherwise.

Implements ome::bioformats::FormatReader.

Referenced by readPlane().

+ Here is the caller graph for this function:

bool ome::bioformats::detail::FormatReader::isInterleaved ( dimension_size_type  channel) const
virtual

Get whether or not the given channel is interleaved.

Some data with multiple channels within C have the sub-channels of one sub-dimension interleaved, and the other not. For example, SDTReader handles spectral-lifetime data with interleaved lifetime bins and non-interleaved spectral channels.

Parameters
channelthe channel to use, range [0, EffectiveSizeC).
Returns
true if the sub-channel is interleaved, false otherwise.

Implements ome::bioformats::FormatReader.

References ome::bioformats::FormatHandler::assertId(), currentId, getCoreIndex(), getCoreMetadata(), and ome::bioformats::CoreMetadata::interleaved.

bool ome::bioformats::detail::FormatReader::isLittleEndian ( ) const
virtual

Get whether the data is in little-endian format.

Returns
false if big endian, true if little endian.

Implements ome::bioformats::FormatReader.

References ome::bioformats::FormatHandler::assertId(), currentId, getCoreIndex(), getCoreMetadata(), and ome::bioformats::CoreMetadata::littleEndian.

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

+ Here is the caller graph for this function:

bool ome::bioformats::detail::FormatReader::isMetadataComplete ( ) const
virtual

Get status of metadata parsing.

Returns
true if this format's metadata is completely parsed, false otherwise.

Implements ome::bioformats::FormatReader.

References ome::bioformats::FormatHandler::assertId(), currentId, getCoreIndex(), getCoreMetadata(), and ome::bioformats::CoreMetadata::metadataComplete.

bool ome::bioformats::detail::FormatReader::isMetadataFiltered ( ) const
virtual

Get metadata filtering.

Returns
true if metadata filtering is enabled, false if disabled.

Implements ome::bioformats::FormatReader.

References filterMetadata.

Referenced by makeFilterMetadata().

+ Here is the caller graph for this function:

bool ome::bioformats::detail::FormatReader::isNormalized ( ) const
virtual

Get float normalization.

Returns
true if float normalization is enabled, false otherwise.

Implements ome::bioformats::FormatReader.

References normalizeData.

bool ome::bioformats::detail::FormatReader::isOrderCertain ( ) const
virtual

Get whether the dimension order and sizes are known, or merely guesses.

Returns
true if the order is known, false otherwise.

Implements ome::bioformats::FormatReader.

References ome::bioformats::FormatHandler::assertId(), currentId, getCoreIndex(), getCoreMetadata(), and ome::bioformats::CoreMetadata::orderCertain.

bool ome::bioformats::detail::FormatReader::isOriginalMetadataPopulated ( ) const
virtual

Get proprietary metadata storage.

Returns
true if proprietary metadata is saved in the MetadataStore, false otherwise.
Todo:
The name of this method is awful.

Implements ome::bioformats::FormatReader.

References saveOriginalMetadata.

bool ome::bioformats::detail::FormatReader::isRGB ( dimension_size_type  channel) const
virtual

Check if the image planes for a channel have more than one sub-channel per openBytes() call.

Parameters
channelthe channel to use, range [0, EffectiveSizeC).
Returns
true if and only if getRGBChannelCount() returns a value greater than 1, false otherwise.

Implements ome::bioformats::FormatReader.

References ome::bioformats::FormatHandler::assertId(), currentId, and getRGBChannelCount().

bool ome::bioformats::detail::FormatReader::isSingleFile ( const boost::filesystem::path &  id) const
virtual

Is this a single-file format?

Parameters
idfilename to check.
Returns
true if this is a single-file format, false otherwise.
Exceptions
FormatExceptionif there was a problem parsing the metadata of the file.

Implements ome::bioformats::FormatReader.

Reimplemented in ome::bioformats::in::OMETIFFReader.

bool ome::bioformats::detail::FormatReader::isStreamThisTypeImpl ( std::istream &  stream) const
protectedvirtual

isThisType stream implementation for readers.

Readers which require opening a file in order to determine its type, and which can handle istream data, should override this method with their own implementation. Reader implementations should check the validity of the stream data.

Parameters
streamthe input stream to check.
Returns
true if the stream is valid, false otherwise.

Referenced by isThisType().

+ Here is the caller graph for this function:

bool ome::bioformats::detail::FormatReader::isThisType ( const boost::filesystem::path &  name,
bool  open = true 
) const
virtual

Check if the given file is a valid instance of this file format.

Parameters
namethe file to open for checking.
openIf true, and the file extension is insufficient to determine the file type, the file may be opened for further analysis, or other relatively expensive file system operations (such as file existence tests and directory listings) may be performed. If false, file system access is not allowed.
Returns
true if the file is valid, false otherwise.
Todo:
Could this method be static?

Implements ome::bioformats::FormatHandler.

Reimplemented in ome::bioformats::in::OMETIFFReader.

References ome::bioformats::FormatHandler::checkSuffix(), ome::bioformats::detail::ReaderProperties::compression_suffixes, isFilenameThisTypeImpl(), readerProperties, ome::bioformats::detail::ReaderProperties::suffixes, suffixNecessary, and suffixSufficient.

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

+ Here is the caller graph for this function:

bool ome::bioformats::detail::FormatReader::isThisType ( const uint8_t *  begin,
std::size_t  length 
) const
virtual

Check if the given buffer is a valid header for this file format.

The buffer is defined as a half-open range using two iterators.

Parameters
beginthe start of the buffer.
lengththe buffer length.
Returns
true if the file is valid, false otherwise.
Todo:
Could this method be static and/or const?

Implements ome::bioformats::FormatReader.

References isThisType().

bool ome::bioformats::detail::FormatReader::isThisType ( const uint8_t *  begin,
const uint8_t *  end 
) const
virtual

Check if the given buffer is a valid header for this file format.

The buffer is defined as a half-open range using two iterators.

Parameters
beginthe start of the buffer.
endone past the end of the buffer.
Returns
true if the file is valid, false otherwise.
Todo:
Could this method be static and/or const?

Implements ome::bioformats::FormatReader.

References isThisType().

bool ome::bioformats::detail::FormatReader::isThisType ( std::istream &  stream) const
virtual

Check if the given input stream is a valid stream for this file format.

Parameters
streamthe input stream to check.
Returns
true if the file is valid, false otherwise.
Todo:
Could this method be static and/or const?

Implements ome::bioformats::FormatReader.

References isStreamThisTypeImpl().

bool ome::bioformats::detail::FormatReader::isThumbnailSeries ( ) const
virtual

Get whether the current series is a lower resolution copy of a different series.

Returns
true if a low resolution copy, false otherwise.

Implements ome::bioformats::FormatReader.

References ome::bioformats::FormatHandler::assertId(), currentId, getCoreIndex(), getCoreMetadata(), and ome::bioformats::CoreMetadata::thumbnail.

bool ome::bioformats::detail::FormatReader::isUsedFile ( const boost::filesystem::path &  file)
protectedvirtual

Check if a file is in the used files list.

Parameters
filethe file to check.
Returns
true if the file is used, false if not used.
Todo:
: Use a set rather than a list?

References ome::common::canonical(), and getUsedFiles().

ome::compat::shared_ptr<::ome::xml::meta::MetadataStore > ome::bioformats::detail::FormatReader::makeFilterMetadata ( )
protectedvirtual

Create a configured FilterMetadata instance.

This creates, configures and returns an instance of ome::xml::meta::FilterMetadata.

Returns
a FilterMetadata instance.

References getMetadataStore(), and isMetadataFiltered().

void ome::bioformats::detail::FormatReader::openBytes ( dimension_size_type  plane,
VariantPixelBuffer buf 
) const
virtual

Obtain an image plane.

Obtain and copy the image plane from the current series into a VariantPixelBuffer of size

Parameters
planethe plane index within the series.
bufthe destination pixel buffer.
Exceptions
FormatExceptionif there was a problem parsing the metadata of the file.

Implements ome::bioformats::FormatReader.

References getSizeX(), and getSizeY().

void ome::bioformats::detail::FormatReader::openBytes ( dimension_size_type  plane,
VariantPixelBuffer buf,
dimension_size_type  x,
dimension_size_type  y,
dimension_size_type  w,
dimension_size_type  h 
) const
virtual

Obtain a sub-image of an image plane.

Obtain and copy the sub-image of an image plane from the current series into a VariantPixelBuffer of size

Parameters
planethe plane index within the series.
bufthe destination pixel buffer.
xthe X coordinate of the upper-left corner of the sub-image.
ythe Y coordinate of the upper-left corner of the sub-image.
wthe width of the sub-image.
hthe height of the sub-image.
Exceptions
FormatExceptionif there was a problem parsing the metadata of the file.

Implements ome::bioformats::FormatReader.

References openBytesImpl(), and setPlane().

virtual void ome::bioformats::detail::FormatReader::openBytesImpl ( dimension_size_type  plane,
VariantPixelBuffer buf,
dimension_size_type  x,
dimension_size_type  y,
dimension_size_type  w,
dimension_size_type  h 
) const
protectedpure virtual

Obtain a sub-image of an image plane.

Obtain and copy the sub-image of an image plane from the current series into a VariantPixelBuffer of size

Parameters
planethe plane index within the series.
bufthe destination pixel buffer.
xthe X coordinate of the upper-left corner of the sub-image.
ythe Y coordinate of the upper-left corner of the sub-image.
wthe width of the sub-image.
hthe height of the sub-image.
Exceptions
FormatExceptionif there was a problem parsing the metadata of the file.

Implemented in ome::bioformats::in::OMETIFFReader, and ome::bioformats::in::MinimalTIFFReader.

Referenced by openBytes().

+ Here is the caller graph for this function:

void ome::bioformats::detail::FormatReader::openThumbBytes ( dimension_size_type  plane,
VariantPixelBuffer buf 
) const
virtual

Obtain a thumbnail of an image plane.

Obtail and copy the thumbnail for the specified image plane from the current series into a VariantPixelBuffer.

Parameters
planethe plane index within the series.
bufthe destination pixel buffer.
Todo:
Implement openThumbBytes. This requires implementing image rescaling/resampling.

Implements ome::bioformats::FormatReader.

References ome::bioformats::FormatHandler::assertId(), and currentId.

void ome::bioformats::detail::FormatReader::readPlane ( std::istream &  source,
VariantPixelBuffer dest,
dimension_size_type  x,
dimension_size_type  y,
dimension_size_type  w,
dimension_size_type  h,
dimension_size_type  samples 
)
protectedvirtual

Read a raw plane.

Note that the pixel buffer must be of the correct size to store the pixel data.

Parameters
sourcethe stream to read the plane from.
destthe pixel buffer in which to store the plane.
xthe left edge of the plane.
ythe top edge of the plane.
wthe width of the plane.
hthe height of the plane.
samplesthe number of samples per pixel.
void ome::bioformats::detail::FormatReader::readPlane ( std::istream &  source,
VariantPixelBuffer dest,
dimension_size_type  x,
dimension_size_type  y,
dimension_size_type  w,
dimension_size_type  h,
dimension_size_type  scanlinePad,
dimension_size_type  samples 
)
protectedvirtual

Read a raw plane with scanline padding.

Note that the pixel buffer must be of the correct size to store the pixel data.

Parameters
sourcethe stream to read the plane from.
destthe pixel buffer in which to store the plane.
xthe left edge of the plane.
ythe top edge of the plane.
wthe width of the plane.
hthe height of the plane.
scanlinePadthe scanline padding.
samplesthe number of samples per pixel.

References ome::bioformats::DIM_CHANNEL, ome::bioformats::DIM_MODULO_C, ome::bioformats::DIM_MODULO_T, ome::bioformats::DIM_MODULO_Z, ome::bioformats::DIM_SPATIAL_X, ome::bioformats::DIM_SPATIAL_Y, ome::bioformats::DIM_SPATIAL_Z, ome::bioformats::DIM_SUBCHANNEL, ome::bioformats::DIM_TEMPORAL_T, ome::bioformats::PixelBufferBase::dimensions, getDimensionOrder(), getPixelType(), isInterleaved(), ome::bioformats::PixelBufferBase::make_storage_order(), ome::bioformats::VariantPixelBuffer::pixelType(), ome::bioformats::VariantPixelBuffer::setBuffer(), ome::bioformats::VariantPixelBuffer::shape(), ome::bioformats::VariantPixelBuffer::storage_order(), and ome::bioformats::VariantPixelBuffer::vbuffer().

dimension_size_type ome::bioformats::detail::FormatReader::seriesToCoreIndex ( dimension_size_type  series) const
virtual

Get the first core index corresponding to the specified series.

Parameters
seriesthe series to use.
Returns
the first for index for the series.

Implements ome::bioformats::FormatReader.

References core, coreIndex, hasFlattenedResolutions(), resolution, and series.

Referenced by getResolutionCount(), setCoreIndex(), setResolution(), and setSeries().

+ Here is the caller graph for this function:

void ome::bioformats::detail::FormatReader::setCoreIndex ( dimension_size_type  index) const
virtual

Set the current resolution/series (ignoring sub-resolutions).

Equivalent to setSeries(), but with flattened resolutions always set to false.

Parameters
indexthe core index to set.
Todo:
Remove use of stateful API which requires use of series switching in const methods.
Exceptions
std::logic_errorif the index is invalid.

Implements ome::bioformats::FormatReader.

References core, coreIndex, coreIndexToSeries(), plane, resolution, series, and seriesToCoreIndex().

void ome::bioformats::detail::FormatReader::setFlattenedResolutions ( bool  flatten)
virtual

Set resolution flattening.

This controls whether or not resolution levels are flattened into individual series. This alters the behaviour of setSeries() and getSeries() but does not affect the behaviour of setCoreIndex() and getCoreIndex(), which are resolution-independent.

Parameters
flattentrue to enable flattening, false to disable.

Implements ome::bioformats::FormatReader.

References ome::bioformats::FormatHandler::assertId(), currentId, and flattenedResolutions.

void ome::bioformats::detail::FormatReader::setGroupFiles ( bool  group)
virtual

Set file grouping.

This specifies whether or not to force grouping in multi-file formats.

Parameters
grouptrue to enable grouping, false to disable.

Implements ome::bioformats::FormatReader.

References ome::bioformats::FormatHandler::assertId(), currentId, and group.

void ome::bioformats::detail::FormatReader::setId ( const boost::filesystem::path &  id)
virtual

Set the current file name.

Note this will throw FormatException if there are problems opening the file.

Parameters
idthe filename to open.
Todo:
Implement addModuloAlong. Requires bits of MetadataTools OMEXMLServiceImpl.

Implements ome::bioformats::FormatHandler.

References ome::bioformats::MetadataMap::begin(), ome::common::canonical(), currentId, ome::bioformats::MetadataMap::end(), ome::bioformats::fillOriginalMetadata(), getMetadataStore(), getModuloC(), getModuloT(), getModuloZ(), getSeriesCount(), getSeriesMetadata(), initFile(), metadata, saveOriginalMetadata, series, ome::bioformats::MetadataMap::set(), setSeries(), and ome::common::trim().

void ome::bioformats::detail::FormatReader::setMetadataFiltered ( bool  filter)
virtual

Set metadata filtering.

If filtering is enabled, "ugly" metadata (entries with unprintable characters, and extremely large entries) should be discarded from the metadata table.

Parameters
filtertrue to enable filtering, false to disable.

Implements ome::bioformats::FormatReader.

References ome::bioformats::FormatHandler::assertId(), currentId, and filterMetadata.

void ome::bioformats::detail::FormatReader::setMetadataOptions ( const MetadataOptions options)
virtual

Set metadata options.

Parameters
optionsthe options to set.

Implements ome::bioformats::MetadataConfigurable.

References metadataOptions.

void ome::bioformats::detail::FormatReader::setMetadataStore ( ome::compat::shared_ptr< ::ome::xml::meta::MetadataStore > &  store)
virtual

Set the default metadata store for this reader.

Parameters
storea metadata store implementation.

Implements ome::bioformats::FormatReader.

References ome::bioformats::FormatHandler::assertId(), currentId, and metadataStore.

void ome::bioformats::detail::FormatReader::setNormalized ( bool  normalize)
virtual

Set float normalization.

Parameters
normalizetrue to enable normalization, or false to disable.

Implements ome::bioformats::FormatReader.

References ome::bioformats::FormatHandler::assertId(), currentId, and normalizeData.

void ome::bioformats::detail::FormatReader::setPlane ( dimension_size_type  plane) const
virtual

Set the active plane.

Parameters
planethe plane to activate.
Todo:
Remove use of stateful API which requires use of plane switching in const methods.

Implements ome::bioformats::FormatReader.

References ome::bioformats::FormatHandler::assertId(), currentId, getImageCount(), and plane.

Referenced by ome::bioformats::in::OMETIFFReader::getLookupTable(), and openBytes().

+ Here is the caller graph for this function:

void ome::bioformats::detail::FormatReader::setResolution ( dimension_size_type  resolution) const
virtual

Set the active resolution level.

Note
This also resets the current plane to 0.
Parameters
resolutionthe resolution to set.
See also
getResolutionCount()
Todo:
Remove use of stateful API which requires use of series switching in const methods.
Exceptions
std::logic_errorif the resolution is invalid.

Implements ome::bioformats::FormatReader.

References coreIndex, getResolutionCount(), getSeries(), plane, resolution, and seriesToCoreIndex().

void ome::bioformats::detail::FormatReader::setSeries ( dimension_size_type  series) const
virtual

Set the active series.

Note
This also resets the resolution to 0 and the current plane to 0.
Parameters
seriesthe series to activate.
Todo:
Remove use of stateful API which requires use of series switching in const methods.
Exceptions
std::logic_errorif the series is invalid.

Implements ome::bioformats::FormatReader.

References coreIndex, plane, resolution, series, and seriesToCoreIndex().

Referenced by ome::bioformats::in::OMETIFFReader::getMetadataStoreForConversion(), getUsedFiles(), and setId().

+ Here is the caller graph for this function:

Member Data Documentation

dimension_size_type ome::bioformats::detail::FormatReader::coreIndex
mutableprotected

The number of the current series (flattened).

Todo:
Remove use of stateful API which requires use of series switching in const methods.

Referenced by close(), coreIndexToSeries(), getCoreIndex(), initFile(), seriesToCoreIndex(), setCoreIndex(), setResolution(), and setSeries().

ome::compat::shared_ptr< ::ome::xml::meta::MetadataStore> ome::bioformats::detail::FormatReader::metadataStore
protected

Current metadata store.

Should never be accessed directly as the semantics of getMetadataStore() prevent "null" access.

Referenced by getMetadataStore(), ome::bioformats::in::OMETIFFReader::initFile(), and setMetadataStore().

dimension_size_type ome::bioformats::detail::FormatReader::plane
mutableprotected

The number of the current plane in the current series.

Todo:
Remove use of stateful API which requires use of series switching in const methods.

Referenced by close(), getPlane(), ome::bioformats::in::OMETIFFReader::ifdAtIndex(), ome::bioformats::in::OMETIFFReader::initFile(), setCoreIndex(), setPlane(), setResolution(), and setSeries().

dimension_size_type ome::bioformats::detail::FormatReader::resolution
mutableprotected

The number of the current resolution.

Todo:
Remove use of stateful API which requires use of series switching in const methods.

Referenced by close(), getResolution(), seriesToCoreIndex(), setCoreIndex(), setResolution(), and setSeries().

dimension_size_type ome::bioformats::detail::FormatReader::series
mutableprotected

The number of the current series (non-flattened).

Todo:
Remove use of stateful API which requires use of series switching in const methods.

Referenced by close(), coreIndexToSeries(), ome::bioformats::in::OMETIFFReader::findUsedFiles(), getSeries(), ome::bioformats::in::OMETIFFReader::initFile(), initFile(), seriesToCoreIndex(), setCoreIndex(), setId(), and setSeries().


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