ome-files
0.1.1
|
TIFF reader with support for OME-XML metadata. More...
#include <ome/files/in/OMETIFFReader.h>
Public Member Functions | |
OMETIFFReader () | |
Constructor. | |
virtual | ~OMETIFFReader () |
Destructor. | |
bool | isSingleFile (const boost::filesystem::path &id) const |
Is this a single-file format? More... | |
bool | isThisType (const boost::filesystem::path &name, bool open) const |
Check if the given file is a valid instance of this file format. More... | |
void | close (bool fileOnly=false) |
Close the currently open file. More... | |
const std::vector< std::string > & | getDomains () const |
Get the domains represented by the current file. More... | |
const std::vector< boost::filesystem::path > | getSeriesUsedFiles (bool noPixels) const |
Get the files used by the active series. More... | |
FormatReader::FileGroupOption | fileGroupOption (const std::string &id) |
Returns an enum indicating that we cannot, must, or might group the files in this dataset. 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... | |
void | initFile (const boost::filesystem::path &id) |
Initialize the given file. More... | |
ome::compat::shared_ptr< ome::xml::meta::MetadataStore > | getMetadataStoreForConversion () |
Get a MetadataStore suitable for writing. More... | |
ome::compat::shared_ptr< ome::xml::meta::MetadataStore > | getMetadataStoreForDisplay () |
Get a MetadataStore suitable for display. More... | |
Public Member Functions inherited from ome::files::detail::FormatReader | |
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 MetadataOptions & | getMetadataOptions () const |
Get metadata options. More... | |
MetadataOptions & | getMetadataOptions () |
Get metadata options. More... | |
const MetadataMap & | getGlobalMetadata () const |
Get global metadata map. More... | |
const MetadataMap::value_type & | getMetadataValue (const std::string &field) const |
Get a global metadata value. More... | |
const MetadataMap & | getSeriesMetadata () const |
Get series metadata map. More... | |
const MetadataMap::value_type & | getSeriesMetadataValue (const MetadataMap::key_type &field) const |
Get a series metadata value. 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... | |
Modulo & | getModuloZ () |
Get the Modulo subdivision of the Z dimension. More... | |
const Modulo & | getModuloZ () const |
Get the Modulo subdivision of the Z dimension. More... | |
Modulo & | getModuloT () |
Get the Modulo subdivision of the T dimension. More... | |
const Modulo & | getModuloT () const |
Get the Modulo subdivision of the T dimension. More... | |
Modulo & | getModuloC () |
Get the Modulo subdivision of the C dimension. More... | |
const Modulo & | getModuloC () 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... | |
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... | |
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... | |
std::vector< FileInfo > | getAdvancedUsedFiles (bool noPixels=false) const |
Get the files used by this dataset. More... | |
std::vector< FileInfo > | getAdvancedSeriesUsedFiles (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::files::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::files::FormatReader > > | getUnderlyingReaders () const |
Get all underlying readers. 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... | |
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::files::FormatHandler | |
virtual | ~FormatHandler () |
Destructor. | |
Public Member Functions inherited from ome::files::MetadataConfigurable | |
virtual | ~MetadataConfigurable () |
Destructor. | |
Protected Types | |
typedef std::map< std::string, boost::filesystem::path > | uuid_file_map |
Map UUID to filename. | |
typedef std::map< boost::filesystem::path, boost::filesystem::path > | invalid_file_map |
Map filename to another file. | |
typedef std::map< boost::filesystem::path, ome::compat::shared_ptr< ome::files::tiff::TIFF > > | tiff_map |
Map filename to open TIFF handle. | |
Protected Types inherited from ome::files::detail::FormatReader | |
typedef std::vector< ome::compat::shared_ptr< ::ome::files::CoreMetadata > > | coremetadata_list_type |
List type for storing CoreMetadata. | |
Protected Member Functions | |
bool | isFilenameThisTypeImpl (const boost::filesystem::path &name) const |
isThisType file implementation for readers. More... | |
void | getLookupTable (dimension_size_type plane, VariantPixelBuffer &buf) const |
Get the color lookup table associated with an image plane. More... | |
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 |
Obtain a sub-image of an image plane. More... | |
const ome::compat::shared_ptr< const tiff::IFD > | ifdAtIndex (dimension_size_type plane) const |
Get the IFD index for a plane in the current series. More... | |
void | addTIFF (const boost::filesystem::path &tiff) |
Add a TIFF file to the internal TIFF map. More... | |
const ome::compat::shared_ptr< const ome::files::tiff::TIFF > | getTIFF (const boost::filesystem::path &tiff) const |
Get a an open TIFF file from the internal TIFF map. More... | |
void | closeTIFF (const boost::filesystem::path &tiff) |
Close an open TIFF file from the internal TIFF map. More... | |
Protected Member Functions inherited from ome::files::detail::FormatReader | |
FormatReader (const ReaderProperties &) | |
Constructor. | |
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::MetadataStore > | makeFilterMetadata () |
Create a configured FilterMetadata instance. More... | |
const CoreMetadata & | getCoreMetadata (dimension_size_type index) const |
Get CoreMetadata by core index. More... | |
CoreMetadata & | getCoreMetadata (dimension_size_type index) |
Get CoreMetadata by core index. 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... | |
Protected Member Functions inherited from ome::files::FormatReader | |
FormatReader () | |
Constructor. | |
Protected Member Functions inherited from ome::files::FormatHandler | |
FormatHandler () | |
Constructor. | |
Protected Member Functions inherited from ome::files::MetadataConfigurable | |
MetadataConfigurable () | |
Constructor. | |
Protected Attributes | |
ome::common::Logger | logger |
Message logger. | |
uuid_file_map | files |
UUID to filename mapping. | |
invalid_file_map | invalidFiles |
Invalid filename to valid filename mapping. | |
tiff_map | tiffs |
Open TIFF files. | |
boost::filesystem::path | metadataFile |
Metadata file. | |
std::vector< boost::filesystem::path > | usedFiles |
Used files. | |
bool | hasSPW |
Has screen-plate-well metadata. | |
Protected Attributes inherited from ome::files::detail::FormatReader | |
const ReaderProperties & | readerProperties |
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::files::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::MetadataStore > | metadataStore |
Current metadata store. More... | |
MetadataOptions | metadataOptions |
Metadata parsing options. | |
Additional Inherited Members | |
Public Types inherited from ome::files::FormatReader | |
enum | FileGroupOption { MUST_GROUP, CAN_GROUP, CANNOT_GROUP } |
File grouping options. More... | |
Static Public Member Functions inherited from ome::files::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... | |
TIFF reader with support for OME-XML metadata.
|
protected |
Add a TIFF file to the internal TIFF map.
tiff | the TIFF file to add. |
References tiffs.
Referenced by initFile().
|
private |
Clean up OME-XML metadata.
Remove invalid channels.
meta | the metadata store to clean up. |
References ome::xml::meta::OMEXMLMetadata::getImageCount(), ome::xml::meta::OMEXMLMetadata::getPixelsSizeC(), and ome::files::removeChannels().
Referenced by initFile().
|
virtual |
Close the currently open file.
An exception may be thrown when closing the file, for example if there are problems flushing any pending writes, or if there are any inconsistencies in the metadata which prevent completing any final writes. The causes are reader- or writer-dependent, and the exception type is dependent upon the implementation details of the reader or writer in use. It is advised to always explicitly close writers, since if this is automatically called at destruction time, any errors will be lost. If an exception is thrown, the object may be left in an inconsistent state and should not be reused.
fileOnly | close the open file only if true , or else free all internal state if false ; only meaningful for readers, since writers will always free all internal state. |
On | error; exception type may vary. |
Reimplemented from ome::files::detail::FormatReader.
References ome::files::detail::FormatReader::close(), files, hasSPW, invalidFiles, metadataFile, tiffs, and usedFiles.
Referenced by ~OMETIFFReader().
|
protected |
Close an open TIFF file from the internal TIFF map.
If the file is currently open, it will be closed.
tiff | the TIFF file to add. |
References tiffs.
|
virtual |
Returns an enum indicating that we cannot, must, or might group the files in this dataset.
id | filename to check. |
Reimplemented from ome::files::detail::FormatReader.
References ome::files::FormatReader::CAN_GROUP, ome::files::detail::FormatReader::group, isSingleFile(), and ome::files::FormatReader::MUST_GROUP.
|
private |
Get UUID to file associations and used files.
Updates both the files map and the used files list.
meta | the metadata store to use. |
currentId | the current file. |
currentDir | the current directory. |
currentUUID | the current UUID (if any). |
References canonical(), ome::files::detail::FormatReader::currentId, files, ome::xml::meta::OMEXMLMetadata::getImageCount(), ome::xml::meta::OMEXMLMetadata::getTiffDataCount(), ome::xml::meta::OMEXMLMetadata::getUUIDFileName(), ome::xml::meta::OMEXMLMetadata::getUUIDValue(), logger, ome::files::detail::FormatReader::series, and usedFiles.
Referenced by initFile().
|
private |
Attempt to correct logically inconsistent dimensions.
If the product of SizeZ, SizeT and SizeC is not equal to the total image count, attempt to correct it by finding the dimension equal to the image count, and setting all other dimension sizes to 1. If a match isn't found, fall back to setting SizeT to the image count.
series | the series to correct. |
References ome::files::detail::FormatReader::core.
Referenced by initFile().
|
private |
Fix invalid OMERO OME-TIFF metadata.
OMERO has in the past written OME-TIFF with incorrect DimensionOrder. Attempt to identify such data and reset the dimension order to XYZCT.
meta | the metadata store to query. |
series | the series to correct. |
References ome::files::detail::FormatReader::core, files, ome::xml::meta::OMEXMLMetadata::getChannelCount(), ome::xml::meta::OMEXMLMetadata::getChannelName(), ome::xml::meta::OMEXMLMetadata::getTiffDataCount(), and ome::xml::meta::OMEXMLMetadata::getUUIDFileName().
Referenced by initFile().
|
private |
Get acquisition dates for each image.
If no date was specified for the image, the timestamp will be unset.
meta | the metadata store to use. |
timestamps | the acquisition dates, indexed by image. |
References ome::xml::meta::OMEXMLMetadata::getImageAcquisitionDate(), and ome::xml::meta::OMEXMLMetadata::getImageCount().
Referenced by initFile().
|
virtual |
Get the domains represented by the current file.
Reimplemented from ome::files::detail::FormatReader.
References ome::files::FormatHandler::assertId(), ome::files::detail::FormatReader::currentId, ome::files::getDomainCollection(), and hasSPW.
|
protectedvirtual |
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.
buf | the destination pixel buffer. |
plane | the plane index within the series. |
FormatException | if a lookup table could not be obtained. |
Reimplemented from ome::files::detail::FormatReader.
References ome::files::FormatHandler::assertId(), ome::files::detail::FormatReader::currentId, ifdAtIndex(), and ome::files::detail::FormatReader::setPlane().
ome::compat::shared_ptr< ome::xml::meta::MetadataStore > ome::files::in::OMETIFFReader::getMetadataStoreForConversion | ( | ) |
Get a MetadataStore suitable for writing.
References ome::files::detail::FormatReader::getMetadataStore(), ome::files::detail::FormatReader::getSeriesCount(), ome::files::detail::FormatReader::isLittleEndian(), and ome::files::detail::FormatReader::setSeries().
Referenced by initFile().
ome::compat::shared_ptr< ome::xml::meta::MetadataStore > ome::files::in::OMETIFFReader::getMetadataStoreForDisplay | ( | ) |
Get a MetadataStore suitable for display.
References ome::files::addMetadataOnly(), ome::files::detail::FormatReader::getMetadataStore(), ome::files::detail::FormatReader::getSeriesCount(), logger, and ome::files::removeBinData().
|
virtual |
Get the optimal sub-image height.
This is intended for use with openBytes().
channel | the channel to use, range [0, EffectiveSizeC). |
Reimplemented from ome::files::detail::FormatReader.
References ome::files::FormatHandler::assertId(), ome::files::detail::FormatReader::currentId, ome::files::detail::FormatReader::getCoreIndex(), and ome::files::detail::FormatReader::getCoreMetadata().
|
virtual |
Get the optimal sub-image width.
This is intended for use with openBytes().
channel | the channel to use, range [0, EffectiveSizeC). |
Reimplemented from ome::files::detail::FormatReader.
References ome::files::FormatHandler::assertId(), ome::files::detail::FormatReader::currentId, ome::files::detail::FormatReader::getCoreIndex(), and ome::files::detail::FormatReader::getCoreMetadata().
|
virtual |
Get the files used by the active series.
noPixels | exclude pixel data files if true , or include them if false . |
Reimplemented from ome::files::detail::FormatReader.
References ome::files::FormatHandler::assertId(), ome::files::detail::FormatReader::currentId, ome::files::detail::FormatReader::getCoreIndex(), ome::files::detail::FormatReader::getCoreMetadata(), and metadataFile.
|
protected |
Get a an open TIFF file from the internal TIFF map.
If the file does not exist in the map, the file will be added to the internal map first. If the file is not currently open it will be opened.
tiff | the TIFF file to get. |
FormatException | if invalid. |
References ome::files::tiff::TIFF::open(), and tiffs.
Referenced by ifdAtIndex(), and initFile().
|
private |
Get values from a TiffData element.
meta | the metadata store to query. |
series | the series to check. |
tiffData | the TiffData index to check. |
tdIFD | the starting IFD. |
numPlanes | the number of planes. |
firstZ | the first Z plane. |
firstT | the first T plane. |
firstC | the first C plane. |
true
if read successfully, false
otherwise. References ome::files::detail::FormatReader::core, ome::xml::meta::OMEXMLMetadata::getTiffDataFirstC(), ome::xml::meta::OMEXMLMetadata::getTiffDataFirstT(), ome::xml::meta::OMEXMLMetadata::getTiffDataFirstZ(), ome::xml::meta::OMEXMLMetadata::getTiffDataIFD(), and ome::xml::meta::OMEXMLMetadata::getTiffDataPlaneCount().
Referenced by initFile().
|
protected |
Get the IFD index for a plane in the current series.
plane | the plane index within the series. |
FormatException | if out of range. |
References ome::files::detail::FormatReader::getCoreIndex(), ome::files::detail::FormatReader::getCoreMetadata(), getTIFF(), and ome::files::detail::FormatReader::plane.
Referenced by getLookupTable(), and openBytesImpl().
|
virtual |
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.
id | the filename to open. |
FormatException | if a parsing error occurs processing the file. |
Reimplemented from ome::files::detail::FormatReader.
References addTIFF(), ome::files::bitsPerPixel(), canonical(), ome::files::FormatHandler::checkSuffix(), cleanMetadata(), ome::files::tiff::COLORMAP, ome::files::detail::FormatReader::core, ome::files::createOMEXMLMetadata(), ome::files::detail::FormatReader::currentId, files, ome::files::fillMetadata(), findUsedFiles(), fixDimensions(), fixOMEROMetadata(), getAcquisitionDates(), ome::files::detail::FormatReader::getImageCount(), ome::files::getIndex(), getMetadataStoreForConversion(), ome::files::getModuloAlongC(), ome::files::getModuloAlongT(), ome::files::getModuloAlongZ(), ome::files::getOriginalMetadata(), getTIFF(), getTiffDataValues(), hasSPW, ome::files::detail::FormatReader::initFile(), invalidFiles, logger, ome::files::detail::FormatReader::metadata, metadataFile, ome::files::detail::FormatReader::metadataStore, ome::files::tiff::PALETTE, ome::files::detail::FormatReader::plane, ome::files::detail::FormatReader::series, seriesIndexStart(), and usedFiles.
|
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.
name | the file to open for checking. |
true
if the file is valid, false
otherwise. Reimplemented from ome::files::detail::FormatReader.
References ome::files::createOMEXMLMetadata(), metadataFile, and ome::files::verifyMinimum().
|
virtual |
Is this a single-file format?
id | filename to check. |
true
if this is a single-file format, false
otherwise.FormatException | if there was a problem parsing the metadata of the file. |
Reimplemented from ome::files::detail::FormatReader.
References ome::files::FormatHandler::checkSuffix(), and ome::files::createOMEXMLMetadata().
Referenced by fileGroupOption().
|
virtual |
Check if the given file is a valid instance of this file format.
name | the file to open for checking. |
open | If 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. |
true
if the file is valid, false
otherwise.Reimplemented from ome::files::detail::FormatReader.
References ome::files::FormatHandler::checkSuffix(), and ome::files::detail::FormatReader::isThisType().
|
protectedvirtual |
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
plane | the plane index within the series. |
buf | the destination pixel buffer. |
x | the X coordinate of the upper-left corner of the sub-image. |
y | the Y coordinate of the upper-left corner of the sub-image. |
w | the width of the sub-image. |
h | the height of the sub-image. |
FormatException | if there was a problem parsing the metadata of the file. |
Implements ome::files::detail::FormatReader.
References ome::files::FormatHandler::assertId(), ome::files::detail::FormatReader::currentId, and ifdAtIndex().
|
private |
Get the samples per pixel from the first IFD for a series.
meta | the metadata store to query. |
series | the series to check. |
|
private |
Get starting index for each dimension.
This is to cater for files which have been incorrectly written, where the starting index is not zero.
meta | the metadata store to query. |
series | the series to check. |
zIndexStart | the Z starting index. |
tIndexStart | the T starting index. |
cIndexStart | the C starting index. |
References ome::xml::meta::OMEXMLMetadata::getTiffDataCount(), ome::xml::meta::OMEXMLMetadata::getTiffDataFirstC(), and ome::xml::meta::OMEXMLMetadata::getTiffDataFirstT().
Referenced by initFile().