bioformats
5.1.6
|
Basic TIFF writer. More...
#include <ome/bioformats/out/MinimalTIFFWriter.h>
Public Member Functions | |
MinimalTIFFWriter () | |
Constructor. | |
MinimalTIFFWriter (const ome::bioformats::detail::WriterProperties &writerProperties) | |
Constructor with writer properties (for derived writers). | |
virtual | ~MinimalTIFFWriter () |
Destructor. | |
void | setId (const boost::filesystem::path &id) |
Set the current file name. More... | |
void | close (bool fileOnly=false) |
Close the currently open file. More... | |
void | setSeries (dimension_size_type series) const |
Set the active series. More... | |
void | setPlane (dimension_size_type plane) const |
Set the active plane. More... | |
void | saveBytes (dimension_size_type plane, VariantPixelBuffer &buf, dimension_size_type x, dimension_size_type y, dimension_size_type w, dimension_size_type h) |
Save an image plane. More... | |
void | setBigTIFF (boost::optional< bool > big=true) |
Set use of BigTIFF support. More... | |
boost::optional< bool > | getBigTIFF () const |
Query use of BigTIFF support. More... | |
Public Member Functions inherited from ome::bioformats::detail::FormatWriter | |
virtual | ~FormatWriter () |
Destructor. | |
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... | |
virtual dimension_size_type | getSeriesCount () const |
Get the number of image series in this file. More... | |
void | setLookupTable (dimension_size_type plane, const VariantPixelBuffer &buf) |
Set the color lookup table associated with the current series. More... | |
void | saveBytes (dimension_size_type plane, VariantPixelBuffer &buf) |
Save an image plane. More... | |
dimension_size_type | getSeries () const |
Get the active series. More... | |
dimension_size_type | getPlane () const |
Get the active plane. More... | |
bool | canDoStacks () const |
Get whether or not the writer can save multiple images in a single file. More... | |
void | setMetadataRetrieve (ome::compat::shared_ptr< ::ome::xml::meta::MetadataRetrieve > &retrieve) |
Set the default metadata store for this writer. More... | |
const ome::compat::shared_ptr< ::ome::xml::meta::MetadataRetrieve > & | getMetadataRetrieve () const |
Get the current metadata store for this writer. More... | |
ome::compat::shared_ptr< ::ome::xml::meta::MetadataRetrieve > & | getMetadataRetrieve () |
Get the current metadata store for this writer. More... | |
virtual dimension_size_type | getImageCount () const |
Determine the number of image planes in the current series. More... | |
virtual bool | isRGB (dimension_size_type channel) const |
Does a channel contain subchannels? More... | |
virtual dimension_size_type | getSizeX () const |
Get the size of the X dimension. More... | |
virtual dimension_size_type | getSizeY () const |
Get the size of the Y dimension. More... | |
virtual dimension_size_type | getSizeZ () const |
Get the size of the Z dimension. More... | |
virtual dimension_size_type | getSizeT () const |
Get the size of the T dimension. More... | |
virtual dimension_size_type | getSizeC () const |
Get the size of the C dimension. More... | |
virtual ome::xml::model::enums::PixelType | getPixelType () const |
Get the pixel type. More... | |
virtual pixel_size_type | getBitsPerPixel () const |
Get the number of valid bits per pixel. More... | |
virtual dimension_size_type | getEffectiveSizeC () const |
Get the effective size of the C dimension. More... | |
virtual dimension_size_type | getRGBChannelCount (dimension_size_type channel) const |
Get the number of channels required for a call to saveBytes(). More... | |
virtual const std::string & | getDimensionOrder () const |
Get the dimension order. More... | |
virtual 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... | |
virtual 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... | |
void | setFramesPerSecond (frame_rate_type rate) |
Set the frame rate to use when writing. More... | |
frame_rate_type | getFramesPerSecond () const |
Get the frame rate to use when writing. More... | |
const std::set< ome::xml::model::enums::PixelType > & | getPixelTypes () const |
Get supported pixel types. More... | |
const std::set< ome::xml::model::enums::PixelType > & | getPixelTypes (const std::string &codec) const |
Get supported pixel types for the given codec. More... | |
bool | isSupportedType (ome::xml::model::enums::PixelType type) const |
Check if the pixel type is supported. More... | |
bool | isSupportedType (ome::xml::model::enums::PixelType type, const std::string &codec) const |
Check if the pixel type is supported by the given codex. More... | |
const std::set< std::string > & | getCompressionTypes () const |
Get supported compression types. More... | |
void | setCompression (const std::string &compression) |
Set the compression type to use when writing. More... | |
const boost::optional< std::string > & | getCompression () const |
Get the compression type to use when writing. More... | |
void | setInterleaved (bool interleaved) |
Set subchannel interleaving. More... | |
const boost::optional< bool > & | getInterleaved () const |
Set subchannel interleaving. More... | |
void | changeOutputFile (const boost::filesystem::path &id) |
Switch the output file for the current dataset. More... | |
void | setWriteSequentially (bool sequential=true) |
Write planes sequentially. More... | |
bool | getWriteSequentially () const |
Check if planes are written sequentially. 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. | |
Protected Member Functions | |
void | nextIFD () const |
Flush current IFD and create new IFD. | |
void | setupIFD () const |
Set IFD parameters for the current series. | |
Protected Member Functions inherited from ome::bioformats::detail::FormatWriter | |
FormatWriter (const WriterProperties &) | |
Constructor. | |
Protected Member Functions inherited from ome::bioformats::FormatWriter | |
FormatWriter () | |
Constructor. | |
Protected Member Functions inherited from ome::bioformats::FormatHandler | |
FormatHandler () | |
Constructor. | |
Protected Attributes | |
ome::common::Logger | logger |
Message logger. | |
ome::compat::shared_ptr< ome::bioformats::tiff::TIFF > | tiff |
Underlying TIFF file. | |
ome::compat::shared_ptr< ome::bioformats::tiff::IFD > | ifd |
Current IFD. | |
dimension_size_type | ifdIndex |
Current plane. | |
tiff::SeriesIFDRange | seriesIFDRange |
Mapping between series index and start and end IFD as a half-open range. | |
Protected Attributes inherited from ome::bioformats::detail::FormatWriter | |
const WriterProperties & | writerProperties |
Writer 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::ostream > | out |
Current output. | |
dimension_size_type | series |
Current series. | |
dimension_size_type | plane |
Current plane. | |
boost::optional< std::string > | compression |
The compression type to use. | |
boost::optional< bool > | interleaved |
Subchannel interleaving enabled. | |
bool | sequential |
Planes are written sequentially. | |
frame_rate_type | framesPerSecond |
The frames per second to use when writing. | |
ome::compat::shared_ptr< ::ome::xml::meta::MetadataRetrieve > | metadataRetrieve |
Current metadata store. More... | |
Private Attributes | |
boost::optional< bool > | bigTIFF |
Write a Big TIFF. | |
Additional Inherited Members | |
Public Types inherited from ome::bioformats::FormatWriter | |
typedef uint16_t | frame_rate_type |
Frame rate type. | |
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... | |
Basic TIFF writer.
seriesIFDRange
.
|
virtual |
Close the currently open file.
fileOnly | close the open file only if true , or else free all internal state if false . |
Reimplemented from ome::bioformats::detail::FormatWriter.
References bigTIFF, ome::bioformats::detail::FormatWriter::close(), ifd, ifdIndex, nextIFD(), seriesIFDRange, and tiff.
Referenced by ~MinimalTIFFWriter().
boost::optional< bool > ome::bioformats::out::MinimalTIFFWriter::getBigTIFF | ( | ) | const |
Query use of BigTIFF support.
If setBigTIFF has not been used to enable or disable BigTIFF explicitly, BigTIFF support will be disabled by default for data less than 4GiB, unless the data would be larger than 4GiB, in which case it will be enabled by default.
true
if BigTIFF support are enabled, or false
if disabled. References bigTIFF.
|
virtual |
Save an image plane.
Write an image plane from a VariantPixelBuffer of size
to the current series in the current file.
plane | the plane index within the series. |
buf | the source 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 any of the parameters are invalid. |
Implements ome::bioformats::FormatWriter.
References ome::bioformats::FormatHandler::assertId(), ome::bioformats::detail::FormatWriter::currentId, ome::bioformats::detail::FormatWriter::getSeries(), ifd, ifdIndex, ome::bioformats::tiff::ifdIndex(), seriesIFDRange, and setPlane().
void ome::bioformats::out::MinimalTIFFWriter::setBigTIFF | ( | boost::optional< bool > | big = true | ) |
Set use of BigTIFF support.
Enable or disable use of BigTIFF support for writing files larger than 4GiB.
big | true to enable or false to disable BigTIFF support. |
References bigTIFF.
|
virtual |
Set the current file name.
Note this will throw FormatException if there are problems opening the file.
id | the filename to open. |
Reimplemented from ome::bioformats::detail::FormatWriter.
References ome::bioformats::tiff::IFDRange::begin, bigTIFF, ome::bioformats::detail::FormatWriter::currentId, ome::bioformats::tiff::IFDRange::end, ome::bioformats::tiff::IFDRange::filename, ome::bioformats::detail::FormatWriter::getImageCount(), ome::bioformats::detail::FormatWriter::getMetadataRetrieve(), ifd, logger, ome::bioformats::detail::FormatWriter::metadataRetrieve, ome::bioformats::pixelSize(), seriesIFDRange, ome::bioformats::FormatHandler::setId(), setupIFD(), ome::bioformats::significantPixelSize(), and tiff.
|
virtual |
Set the active plane.
plane | the plane to activate. |
Reimplemented from ome::bioformats::detail::FormatWriter.
References ome::bioformats::detail::FormatWriter::getPlane(), nextIFD(), ome::bioformats::detail::FormatWriter::setPlane(), and setupIFD().
Referenced by saveBytes().
|
virtual |
Set the active series.
series | the series to activate. |
Reimplemented from ome::bioformats::detail::FormatWriter.
References ome::bioformats::detail::FormatWriter::getSeries(), nextIFD(), ome::bioformats::detail::FormatWriter::setSeries(), and setupIFD().