bioformats  5.1.8
Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Member Functions | List of all members
ome::bioformats::FormatHandler Class Referenceabstract

Interface for all biological file format readers and writers. More...

#include <ome/bioformats/FormatHandler.h>

+ Inheritance diagram for ome::bioformats::FormatHandler:

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.
 

Private Member Functions

 FormatHandler (const FormatHandler &)
 Copy constructor (deleted).
 
FormatHandleroperator= (const FormatHandler &)
 Assignment operator (deleted).
 

Detailed Description

Interface for all biological file format readers and writers.

Note
The Java implementation includes a getNativeDataType method; this is not included in this implementation.

Member Function Documentation

static void ome::bioformats::FormatHandler::assertId ( const boost::optional< boost::filesystem::path > &  id,
bool  notNull = true 
)
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.

Parameters
idFilename to test.
notNulltrue if id should be non-null, false if id should be null.
Exceptions
std::logic_errorif the assertion fails.

Referenced by ome::bioformats::detail::FormatWriter::changeOutputFile(), ome::bioformats::detail::FormatReader::FormatReader(), ome::bioformats::detail::FormatWriter::FormatWriter(), ome::bioformats::detail::FormatReader::getBitsPerPixel(), ome::bioformats::detail::FormatReader::getCoreMetadataList(), ome::bioformats::detail::FormatReader::getDimensionOrder(), ome::bioformats::in::OMETIFFReader::getDomains(), ome::bioformats::detail::FormatReader::getDomains(), ome::bioformats::detail::FormatReader::getImageCount(), ome::bioformats::detail::FormatWriter::getIndex(), ome::bioformats::detail::FormatReader::getIndex(), ome::bioformats::in::MinimalTIFFReader::getLookupTable(), ome::bioformats::in::OMETIFFReader::getLookupTable(), ome::bioformats::detail::FormatReader::getLookupTable(), ome::bioformats::in::OMETIFFReader::getOptimalTileHeight(), ome::bioformats::detail::FormatReader::getOptimalTileHeight(), ome::bioformats::in::OMETIFFReader::getOptimalTileWidth(), ome::bioformats::detail::FormatReader::getOptimalTileWidth(), ome::bioformats::detail::FormatReader::getPixelType(), ome::bioformats::detail::FormatWriter::getPlane(), ome::bioformats::detail::FormatReader::getPlane(), ome::bioformats::detail::FormatReader::getResolutionCount(), ome::bioformats::detail::FormatWriter::getSeries(), ome::bioformats::detail::FormatReader::getSeriesCount(), ome::bioformats::detail::FormatReader::getSeriesMetadata(), ome::bioformats::detail::FormatReader::getSeriesMetadataValue(), ome::bioformats::in::OMETIFFReader::getSeriesUsedFiles(), ome::bioformats::detail::FormatReader::getSizeC(), ome::bioformats::detail::FormatReader::getSizeT(), ome::bioformats::detail::FormatReader::getSizeX(), ome::bioformats::detail::FormatReader::getSizeY(), ome::bioformats::detail::FormatReader::getSizeZ(), ome::bioformats::detail::FormatReader::getThumbSize(), ome::bioformats::detail::FormatWriter::getZCTCoords(), ome::bioformats::detail::FormatReader::getZCTCoords(), ome::bioformats::detail::FormatReader::getZCTModuloCoords(), ome::bioformats::detail::FormatReader::isFalseColor(), ome::bioformats::detail::FormatReader::isIndexed(), ome::bioformats::detail::FormatReader::isInterleaved(), ome::bioformats::detail::FormatReader::isLittleEndian(), ome::bioformats::detail::FormatReader::isMetadataComplete(), ome::bioformats::detail::FormatReader::isOrderCertain(), ome::bioformats::detail::FormatReader::isRGB(), ome::bioformats::detail::FormatReader::isThumbnailSeries(), ome::bioformats::in::MinimalTIFFReader::openBytesImpl(), ome::bioformats::in::OMETIFFReader::openBytesImpl(), ome::bioformats::detail::FormatReader::openThumbBytes(), ome::bioformats::out::MinimalTIFFWriter::saveBytes(), ome::bioformats::out::OMETIFFWriter::saveBytes(), ome::bioformats::detail::FormatWriter::saveBytes(), ome::bioformats::detail::FormatReader::setFlattenedResolutions(), ome::bioformats::detail::FormatReader::setGroupFiles(), ome::bioformats::detail::FormatWriter::setLookupTable(), ome::bioformats::detail::FormatReader::setMetadataFiltered(), ome::bioformats::detail::FormatWriter::setMetadataRetrieve(), ome::bioformats::detail::FormatReader::setMetadataStore(), ome::bioformats::detail::FormatReader::setNormalized(), ome::bioformats::detail::FormatReader::setOriginalMetadataPopulated(), ome::bioformats::detail::FormatWriter::setPlane(), ome::bioformats::detail::FormatReader::setPlane(), and ome::bioformats::detail::FormatWriter::setSeries().

+ Here is the caller graph for this function:

static bool ome::bioformats::FormatHandler::checkSuffix ( const boost::filesystem::path &  name,
const boost::filesystem::path &  suffix 
)
inlinestatic

Perform suffix matching for the given filename.

Parameters
namethe name to check.
suffixthe suffix to match.
Returns
true if the suffix is suppored, false otherwise.

Referenced by checkSuffix(), ome::bioformats::in::OMETIFFReader::initFile(), ome::bioformats::in::OMETIFFReader::isSingleFile(), ome::bioformats::in::OMETIFFReader::isThisType(), ome::bioformats::detail::FormatWriter::isThisType(), and ome::bioformats::detail::FormatReader::isThisType().

+ Here is the caller graph for this function:

static bool ome::bioformats::FormatHandler::checkSuffix ( const boost::filesystem::path &  name,
const std::vector< boost::filesystem::path > &  suffixes 
)
inlinestatic

Perform suffix matching for the given filename.

Parameters
namethe name to check.
suffixesthe suffixes to match.
Returns
true if the suffix is suppored, false otherwise.

References checkSuffix().

static bool ome::bioformats::FormatHandler::checkSuffix ( const boost::filesystem::path &  name,
const std::vector< boost::filesystem::path > &  suffixes,
const std::vector< boost::filesystem::path > &  compression_suffixes 
)
inlinestatic

Perform suffix matching for the given filename.

Parameters
namethe name to check.
suffixesthe suffixes to match.
compression_suffixesthe compression suffixes to match.
Returns
true if the suffix is suppored, false otherwise.

References checkSuffix().

virtual void ome::bioformats::FormatHandler::close ( bool  fileOnly = false)
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.

Parameters
fileOnlyclose 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.
Exceptions
Onerror; exception type may vary.

Implemented in ome::bioformats::detail::FormatReader, ome::bioformats::detail::FormatWriter, ome::bioformats::in::OMETIFFReader, ome::bioformats::out::OMETIFFWriter, ome::bioformats::in::MinimalTIFFReader, ome::bioformats::out::MinimalTIFFWriter, and ome::bioformats::in::TIFFReader.

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

Get the default compression suffixes for this file format.

Returns
a list of file suffixes.

Implemented in ome::bioformats::detail::FormatReader, and ome::bioformats::detail::FormatWriter.

virtual const std::string& ome::bioformats::FormatHandler::getFormat ( ) const
pure virtual

Get the name of this file format.

Returns
the file format name.

Implemented in ome::bioformats::detail::FormatReader, and ome::bioformats::detail::FormatWriter.

virtual const std::string& ome::bioformats::FormatHandler::getFormatDescription ( ) const
pure virtual

Get the description of this file format.

Returns
the file format description.

Implemented in ome::bioformats::detail::FormatReader, and ome::bioformats::detail::FormatWriter.

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

Get the default file suffixes for this file format.

Returns
a list of file suffixes.

Implemented in ome::bioformats::detail::FormatReader, and ome::bioformats::detail::FormatWriter.

virtual bool ome::bioformats::FormatHandler::isThisType ( const boost::filesystem::path &  name,
bool  open = true 
) const
pure 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?

Implemented in ome::bioformats::detail::FormatReader, ome::bioformats::detail::FormatWriter, ome::bioformats::FormatReader, and ome::bioformats::in::OMETIFFReader.

virtual void ome::bioformats::FormatHandler::setId ( const boost::filesystem::path &  id)
pure virtual

Set the current file name.

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

Parameters
idthe filename to open.

Implemented in ome::bioformats::detail::FormatReader, ome::bioformats::detail::FormatWriter, ome::bioformats::out::OMETIFFWriter, and ome::bioformats::out::MinimalTIFFWriter.

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

+ Here is the caller graph for this function:


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