ome-files
0.5.0
|
Interface for all biological file format readers and writers. More...
#include <ome/files/FormatHandler.h>
Public Member Functions | |
virtual | ~FormatHandler () |
Destructor. | |
virtual bool | isThisType (const boost::filesystem::path &name, bool open=true) const =0 |
Check if the given file is a valid instance of this file format. More... | |
virtual const std::string & | getFormat () const =0 |
Get the name of this file format. More... | |
virtual const std::string & | getFormatDescription () const =0 |
Get the description of this file format. More... | |
virtual const std::vector< boost::filesystem::path > & | getSuffixes () const =0 |
Get the default file suffixes for this file format. More... | |
virtual const std::vector< boost::filesystem::path > & | getCompressionSuffixes () const =0 |
Get the default compression suffixes for this file format. More... | |
virtual void | setId (const boost::filesystem::path &id)=0 |
Set the current file name. More... | |
virtual void | close (bool fileOnly=false)=0 |
Close the currently open file. More... | |
Static Public Member Functions | |
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... | |
Protected Member Functions | |
FormatHandler () | |
Constructor. | |
Interface for all biological file format readers and writers.
|
inlinestatic |
Assert that the current file is valid.
Assert if the current file is null, or not, according to the given flag. If the assertion fails, an exception is thrown.
id | Filename to test. |
notNull | true if id should be non-null, false if id should be null. |
std::logic_error | if the assertion fails. |
Referenced by ome::files::detail::FormatWriter::changeOutputFile(), ome::files::detail::FormatReader::FormatReader(), ome::files::detail::FormatWriter::FormatWriter(), ome::files::detail::FormatReader::getBitsPerPixel(), ome::files::detail::FormatReader::getCoreMetadataList(), ome::files::detail::FormatReader::getDimensionOrder(), ome::files::in::OMETIFFReader::getDomains(), ome::files::detail::FormatReader::getDomains(), ome::files::detail::FormatReader::getImageCount(), ome::files::detail::FormatWriter::getIndex(), ome::files::detail::FormatReader::getIndex(), ome::files::in::MinimalTIFFReader::getLookupTable(), ome::files::in::OMETIFFReader::getLookupTable(), ome::files::detail::FormatReader::getLookupTable(), ome::files::in::OMETIFFReader::getOptimalTileHeight(), ome::files::detail::FormatReader::getOptimalTileHeight(), ome::files::in::OMETIFFReader::getOptimalTileWidth(), ome::files::detail::FormatReader::getOptimalTileWidth(), ome::files::detail::FormatReader::getPixelType(), ome::files::detail::FormatWriter::getPlane(), ome::files::detail::FormatReader::getPlane(), ome::files::detail::FormatReader::getResolutionCount(), ome::files::detail::FormatReader::getRGBChannelCount(), ome::files::detail::FormatWriter::getSeries(), ome::files::detail::FormatReader::getSeriesCount(), ome::files::detail::FormatReader::getSeriesMetadata(), ome::files::detail::FormatReader::getSeriesMetadataValue(), ome::files::in::OMETIFFReader::getSeriesUsedFiles(), ome::files::detail::FormatReader::getSizeC(), ome::files::detail::FormatReader::getSizeT(), ome::files::detail::FormatReader::getSizeX(), ome::files::detail::FormatReader::getSizeY(), ome::files::detail::FormatReader::getSizeZ(), ome::files::detail::FormatReader::getThumbSize(), ome::files::detail::FormatWriter::getZCTCoords(), ome::files::detail::FormatReader::getZCTCoords(), ome::files::detail::FormatReader::getZCTModuloCoords(), ome::files::detail::FormatReader::isFalseColor(), ome::files::detail::FormatReader::isIndexed(), ome::files::detail::FormatReader::isInterleaved(), ome::files::detail::FormatReader::isLittleEndian(), ome::files::detail::FormatReader::isMetadataComplete(), ome::files::detail::FormatReader::isOrderCertain(), ome::files::detail::FormatReader::isRGB(), ome::files::detail::FormatReader::isThumbnailSeries(), ome::files::in::MinimalTIFFReader::openBytesImpl(), ome::files::in::OMETIFFReader::openBytesImpl(), ome::files::detail::FormatReader::openThumbBytes(), ome::files::out::MinimalTIFFWriter::saveBytes(), ome::files::detail::FormatWriter::saveBytes(), ome::files::out::OMETIFFWriter::saveBytes(), ome::files::detail::FormatReader::setFlattenedResolutions(), ome::files::detail::FormatReader::setGroupFiles(), ome::files::detail::FormatWriter::setLookupTable(), ome::files::detail::FormatReader::setMetadataFiltered(), ome::files::detail::FormatWriter::setMetadataRetrieve(), ome::files::detail::FormatReader::setMetadataStore(), ome::files::detail::FormatReader::setNormalized(), ome::files::detail::FormatReader::setOriginalMetadataPopulated(), ome::files::detail::FormatWriter::setPlane(), ome::files::detail::FormatReader::setPlane(), and ome::files::detail::FormatWriter::setSeries().
|
inlinestatic |
Perform suffix matching for the given filename.
name | the name to check. |
suffix | the suffix to match. |
true
if the suffix is suppored, false
otherwise. Referenced by checkSuffix(), ome::files::in::OMETIFFReader::initFile(), ome::files::in::OMETIFFReader::isFilenameThisTypeImpl(), ome::files::in::OMETIFFReader::isSingleFile(), ome::files::in::OMETIFFReader::isThisType(), ome::files::detail::FormatWriter::isThisType(), ome::files::detail::FormatReader::isThisType(), and ome::files::in::OMETIFFReader::readMetadata().
|
inlinestatic |
Perform suffix matching for the given filename.
name | the name to check. |
suffixes | the suffixes to match. |
true
if the suffix is suppored, false
otherwise. References checkSuffix().
|
inlinestatic |
Perform suffix matching for the given filename.
name | the name to check. |
suffixes | the suffixes to match. |
compression_suffixes | the compression suffixes to match. |
true
if the suffix is suppored, false
otherwise. References checkSuffix().
|
pure 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. |
Implemented in ome::files::detail::FormatReader, ome::files::detail::FormatWriter, ome::files::in::OMETIFFReader, ome::files::out::OMETIFFWriter, ome::files::in::MinimalTIFFReader, ome::files::out::MinimalTIFFWriter, and ome::files::in::TIFFReader.
Referenced by ~FormatHandler().
|
pure virtual |
Get the default compression suffixes for this file format.
Implemented in ome::files::detail::FormatReader, and ome::files::detail::FormatWriter.
Referenced by ~FormatHandler().
|
pure virtual |
Get the name of this file format.
Implemented in ome::files::detail::FormatReader, and ome::files::detail::FormatWriter.
Referenced by ~FormatHandler().
|
pure virtual |
Get the description of this file format.
Implemented in ome::files::detail::FormatReader, and ome::files::detail::FormatWriter.
Referenced by ~FormatHandler().
|
pure virtual |
Get the default file suffixes for this file format.
Implemented in ome::files::detail::FormatReader, and ome::files::detail::FormatWriter.
Referenced by ~FormatHandler().
|
pure 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.Implemented in ome::files::detail::FormatReader, ome::files::detail::FormatWriter, ome::files::FormatReader, and ome::files::in::OMETIFFReader.
Referenced by ~FormatHandler().
|
pure virtual |
Set the current file name.
Note this will throw FormatException if there are problems opening the file.
id | the filename to open. |
Implemented in ome::files::detail::FormatReader, ome::files::detail::FormatWriter, ome::files::out::OMETIFFWriter, and ome::files::out::MinimalTIFFWriter.
Referenced by ome::files::out::MinimalTIFFWriter::setId(), and ~FormatHandler().