OTB  9.0.0
Orfeo Toolbox
Classes | Public Types | Public Member Functions | List of all members

#include <otbImageIOBase.h>

+ Inheritance diagram for otb::ImageIOBase:
+ Collaboration diagram for otb::ImageIOBase:

Classes

class  UnknownType
 

Public Types

typedef itk::SmartPointer< SelfPointer
 
typedef ImageIOBase Self
 
typedef itk::LightProcessObject Superclass
 

Public Member Functions

virtual const char * GetNameOfClass () const
 
enum  IOPixelType {
  UNKNOWNPIXELTYPE,
  SCALAR,
  RGB,
  RGBA,
  OFFSET,
  VECTOR,
  POINT,
  COVARIANTVECTOR,
  SYMMETRICSECONDRANKTENSOR,
  DIFFUSIONTENSOR3D,
  COMPLEX,
  FIXEDARRAY,
  MATRIX
}
 
enum  IOComponentType {
  UNKNOWNCOMPONENTTYPE,
  UCHAR,
  CHAR,
  USHORT,
  SHORT,
  UINT,
  INT,
  ULONG,
  LONG,
  FLOAT,
  DOUBLE,
  CSHORT,
  CINT,
  CFLOAT,
  CDOUBLE
}
 
enum  FileType {
  ASCII,
  Binary,
  TypeNotApplicable
}
 
enum  ByteOrder {
  BigEndian,
  LittleEndian,
  OrderNotApplicable
}
 
typedef long IndexValueType
 
typedef unsigned long SizeValueType
 
typedef std::streamoff SizeType
 
typedef vcl_size_t BufferSizeType
 
typedef std::vector< std::string > ArrayOfExtensionsType
 
IOPixelType m_PixelType
 
IOComponentType m_ComponentType
 
ByteOrder m_ByteOrder
 
FileType m_FileType
 
bool m_Initialized
 
std::string m_FileName
 
unsigned int m_NumberOfComponents
 
unsigned int m_NumberOfDimensions
 
bool m_UseCompression
 
bool m_UseStreamedReading
 
bool m_UseStreamedWriting
 
itk::ImageIORegion m_IORegion
 
std::vector< SizeValueTypem_Dimensions
 
std::vector< double > m_Spacing
 
std::vector< double > m_Origin
 
std::vector< std::vector< double > > m_Direction
 
std::vector< SizeTypem_Strides
 
std::vector< std::string > m_AttachedFileNames
 
ImageMetadata m_Imd
 
std::vector< unsigned int > m_BandList
 
ArrayOfExtensionsType m_SupportedReadExtensions
 
ArrayOfExtensionsType m_SupportedWriteExtensions
 
virtual void SetFileName (const char *_arg)
 
virtual const char * GetFileName () const
 
void SetNumberOfDimensions (unsigned int)
 
virtual unsigned int GetNumberOfDimensions () const
 
virtual void SetDimensions (unsigned int i, unsigned int dim)
 
virtual unsigned int GetDimensions (unsigned int i) const
 
virtual void SetOrigin (unsigned int i, double origin)
 
virtual double GetOrigin (unsigned int i) const
 
virtual void SetSpacing (unsigned int i, double spacing)
 
virtual double GetSpacing (unsigned int i) const
 
virtual void SetDirection (unsigned int i, std::vector< double > &direction)
 
virtual void SetDirection (unsigned int i, vnl_vector< double > &direction)
 
virtual std::vector< double > GetDirection (unsigned int i) const
 
virtual std::vector< double > GetDefaultDirection (unsigned int i) const
 
virtual void SetIORegion (itk::ImageIORegion _arg)
 
virtual const itk::ImageIORegion & GetIORegion () const
 
virtual void SetPixelType (const IOPixelType _arg)
 
virtual IOPixelType GetPixelType () const
 
virtual bool SetPixelTypeInfo (const std::type_info &ptype)
 
virtual void SetComponentType (const IOComponentType _arg)
 
virtual IOComponentType GetComponentType () const
 
virtual const std::type_info & GetComponentTypeInfo () const
 
virtual void SetNumberOfComponents (unsigned int _arg)
 
virtual const unsigned int & GetNumberOfComponents () const
 
virtual void SetUseCompression (bool _arg)
 
virtual bool GetUseCompression () const
 
virtual void UseCompressionOn ()
 
virtual void UseCompressionOff ()
 
virtual void SetUseStreamedReading (bool _arg)
 
virtual bool GetUseStreamedReading () const
 
virtual void UseStreamedReadingOn ()
 
virtual void UseStreamedReadingOff ()
 
virtual void SetUseStreamedWriting (bool _arg)
 
virtual bool GetUseStreamedWriting () const
 
virtual void UseStreamedWritingOn ()
 
virtual void UseStreamedWritingOff ()
 
virtual void SetFileType (const FileType _arg)
 
virtual FileType GetFileType () const
 
void SetFileTypeToASCII ()
 
void SetFileTypeToBinary ()
 
virtual void SetByteOrder (const ByteOrder _arg)
 
virtual ByteOrder GetByteOrder () const
 
void SetByteOrderToBigEndian ()
 
void SetByteOrderToLittleEndian ()
 
virtual SizeType GetPixelStride () const
 
SizeType GetImageSizeInPixels () const
 
SizeType GetImageSizeInBytes () const
 
SizeType GetImageSizeInComponents () const
 
virtual unsigned int GetComponentSize () const
 
virtual unsigned int GetOverviewsCount ()=0
 
virtual std::vector< std::string > GetOverviewsInfo ()=0
 
virtual void SetOutputImagePixelType (bool isComplexInternalPixelType, bool isVectorImage)=0
 
virtual bool CanReadFile (const char *)=0
 
virtual bool CanStreamRead ()
 
virtual void ReadImageInformation ()=0
 
virtual void Read (void *buffer)=0
 
virtual bool CanWriteFile (const char *)=0
 
virtual bool CanStreamWrite ()
 
virtual void WriteImageInformation ()=0
 
virtual void Write (const void *buffer)=0
 
virtual bool SupportsDimension (unsigned long dim)
 
virtual itk::ImageIORegion GenerateStreamableReadRegionFromRequestedRegion (const itk::ImageIORegion &requested) const
 
virtual unsigned int GetActualNumberOfSplitsForWriting (unsigned int numberOfRequestedSplits, const itk::ImageIORegion &pasteRegion, const itk::ImageIORegion &largestPossibleRegion)
 
virtual itk::ImageIORegion GetSplitRegionForWriting (unsigned int ithPiece, unsigned int numberOfActualSplits, const itk::ImageIORegion &pasteRegion, const itk::ImageIORegion &largestPossibleRegion)
 
const ArrayOfExtensionsTypeGetSupportedReadExtensions () const
 
const ArrayOfExtensionsTypeGetSupportedWriteExtensions () const
 
void DoMapBuffer (void *buffer, vcl_size_t numberOfPixels, std::vector< unsigned int > &bandList)
 
virtual const std::vector< std::string > & GetAttachedFileNames () const
 
const ImageMetadataGetImageMetadata () const
 
void SetImageMetadata (ImageMetadata)
 
static std::string GetComponentTypeAsString (IOComponentType)
 
static std::string GetPixelTypeAsString (IOPixelType)
 
static std::string GetFileTypeAsString (FileType)
 
static std::string GetByteOrderAsString (ByteOrder)
 
 ImageIOBase ()
 
 ~ImageIOBase () override
 
void PrintSelf (std::ostream &os, itk::Indent indent) const override
 
virtual void Reset (const bool freeDynamic=true)
 
void Resize (const unsigned int numDimensions, const unsigned int *dimensions)
 
virtual unsigned int GetPixelSize () const
 
void ComputeStrides ()
 
SizeType GetComponentStride () const
 
SizeType GetRowStride () const
 
SizeType GetSliceStride () const
 
void WriteBufferAsASCII (std::ostream &os, const void *buffer, IOComponentType ctype, SizeType numberOfBytesToWrite)
 
void ReadBufferAsASCII (std::istream &os, void *buffer, IOComponentType ctype, SizeType numberOfBytesToBeRead)
 
bool ReadBufferAsBinary (std::istream &os, void *buffer, SizeType numberOfBytesToBeRead)
 
void AddSupportedReadExtension (const char *extension)
 
void AddSupportedWriteExtension (const char *extension)
 
virtual unsigned int GetActualNumberOfSplitsForWritingCanStreamWrite (unsigned int numberOfRequestedSplits, const itk::ImageIORegion &pasteRegion) const
 
virtual itk::ImageIORegion GetSplitRegionForWritingCanStreamWrite (unsigned int ithPiece, unsigned int numberOfActualSplits, const itk::ImageIORegion &pasteRegion) const
 
 ImageIOBase (const Self &)=delete
 
void operator= (const Self &)=delete
 

Detailed Description

Abstract superclass defines image IO interface.

ImageIOBase is a class that reads and/or writes image data of a particular format (such as PNG or raw binary). The ImageIOBase encapsulates both the reading and writing of data. The ImageIOBase is used by the ImageFileReader class (to read data) and the ImageFileWriter (to write data) into a single file. The ImageSeriesReader and ImageSeriesWriter classes are used to read and write data (in conjunction with ImageIOBase) when the data is represented by a series of files. Normally the user does not directly manipulate this class other than to instantiate it, set the FileName, and assign it to a ImageFileReader/ImageFileWriter or ImageSeriesReader/ImageSeriesWriter.

A Pluggable factory pattern is used this allows different kinds of readers to be registered (even at run time) without having to modify the code in this class.

See also
ImageFileWriter
ImageFileReader
ImageSeriesWriter
ImageSeriesReader

Definition at line 69 of file otbImageIOBase.h.

Member Typedef Documentation

◆ ArrayOfExtensionsType

typedef std::vector<std::string> otb::ImageIOBase::ArrayOfExtensionsType

Type for the list of strings to be used for extensions.

Definition at line 437 of file otbImageIOBase.h.

◆ BufferSizeType

Type for representing size of bytes, and or positions along a memory buffer

Definition at line 299 of file otbImageIOBase.h.

◆ IndexValueType

Types for managing image size and image index components.

Definition at line 82 of file otbImageIOBase.h.

◆ Pointer

typedef itk::SmartPointer<Self> otb::ImageIOBase::Pointer

Definition at line 75 of file otbImageIOBase.h.

◆ Self

Standard class typedefs.

Definition at line 73 of file otbImageIOBase.h.

◆ SizeType

typedef std::streamoff otb::ImageIOBase::SizeType

Type for representing size of bytes, and or positions along a file

Definition at line 296 of file otbImageIOBase.h.

◆ SizeValueType

typedef unsigned long otb::ImageIOBase::SizeValueType

Enums used to manipulate the pixel type. The pixel type provides context for automatic data conversions (for instance, RGB to SCALAR, VECTOR to SCALAR).

Definition at line 87 of file otbImageIOBase.h.

◆ Superclass

typedef itk::LightProcessObject otb::ImageIOBase::Superclass

Definition at line 74 of file otbImageIOBase.h.

Member Enumeration Documentation

◆ ByteOrder

Enums used to specify byte order; whether Big Endian or Little Endian. Some subclasses use this, some ignore it.

Enumerator
BigEndian 
LittleEndian 
OrderNotApplicable 

Definition at line 248 of file otbImageIOBase.h.

◆ FileType

Enums used to specify write style: whether binary or ASCII. Some subclasses use this, some ignore it.

Enumerator
ASCII 
Binary 
TypeNotApplicable 

Definition at line 244 of file otbImageIOBase.h.

◆ IOComponentType

Enums used to manipulate the component type. The component type refers to the actual storage class associated with either a SCALAR pixel type or elements of a compound pixel.

Enumerator
UNKNOWNCOMPONENTTYPE 
UCHAR 
CHAR 
USHORT 
SHORT 
UINT 
INT 
ULONG 
LONG 
FLOAT 
DOUBLE 
CSHORT 
CINT 
CFLOAT 
CDOUBLE 

Definition at line 122 of file otbImageIOBase.h.

◆ IOPixelType

Enums used to manipulate the pixel type. The pixel type provides context for automatic data conversions (for instance, RGB to SCALAR, VECTOR to SCALAR).

Enumerator
UNKNOWNPIXELTYPE 
SCALAR 
RGB 
RGBA 
OFFSET 
VECTOR 
POINT 
COVARIANTVECTOR 
SYMMETRICSECONDRANKTENSOR 
DIFFUSIONTENSOR3D 
COMPLEX 
FIXEDARRAY 
MATRIX 

Definition at line 102 of file otbImageIOBase.h.

Constructor & Destructor Documentation

◆ ImageIOBase() [1/2]

otb::ImageIOBase::ImageIOBase ( )
protected

Enums used to manipulate the pixel type. The pixel type provides context for automatic data conversions (for instance, RGB to SCALAR, VECTOR to SCALAR).

◆ ~ImageIOBase()

otb::ImageIOBase::~ImageIOBase ( )
overrideprotected

Enums used to manipulate the pixel type. The pixel type provides context for automatic data conversions (for instance, RGB to SCALAR, VECTOR to SCALAR).

◆ ImageIOBase() [2/2]

otb::ImageIOBase::ImageIOBase ( const Self )
privatedelete

Enums used to manipulate the pixel type. The pixel type provides context for automatic data conversions (for instance, RGB to SCALAR, VECTOR to SCALAR).

Member Function Documentation

◆ AddSupportedReadExtension()

void otb::ImageIOBase::AddSupportedReadExtension ( const char *  extension)
protected

Insert an extension to the list of supported extensions for reading.

◆ AddSupportedWriteExtension()

void otb::ImageIOBase::AddSupportedWriteExtension ( const char *  extension)
protected

Insert an extension to the list of supported extensions for writing.

◆ CanReadFile()

virtual bool otb::ImageIOBase::CanReadFile ( const char *  )
pure virtual

Determine the file type. Returns true if this ImageIO can read the file specified.

Implemented in otb::GDALImageIO.

◆ CanStreamRead()

virtual bool otb::ImageIOBase::CanStreamRead ( )
inlinevirtual

Determine if the ImageIO can stream reading from this file. Default is false.

Reimplemented in otb::GDALImageIO.

Definition at line 346 of file otbImageIOBase.h.

◆ CanStreamWrite()

virtual bool otb::ImageIOBase::CanStreamWrite ( )
inlinevirtual

Determine if the ImageIO can stream writing to this file. Default is false.

There are two types of non exclusive streaming: pasting subregions, and iterative If true then

Reimplemented in otb::GDALImageIO.

Definition at line 370 of file otbImageIOBase.h.

◆ CanWriteFile()

virtual bool otb::ImageIOBase::CanWriteFile ( const char *  )
pure virtual

Determine the file type. Returns true if this ImageIO can read the file specified.

Implemented in otb::GDALImageIO.

◆ ComputeStrides()

void otb::ImageIOBase::ComputeStrides ( )
protected

Calculates the different strides (distance from one thing to the next). Upon return, strides[0] = bytes to get to the next component of a pixel, strides[1] = bytes to get to the next pixel in x direction, strides[2] = bytes to get to the next row in y direction, strides[3] = bytes to get to the next slice in z direction, etc.

◆ DoMapBuffer()

void otb::ImageIOBase::DoMapBuffer ( void *  buffer,
vcl_size_t  numberOfPixels,
std::vector< unsigned int > &  bandList 
)

Remap band order in an input buffer using band mapping bandList This operation is done in-place. The buffer size should enough to contain extracted bands before and after mapping. bandList mapping between origin components and output components (before any conversion)

◆ GenerateStreamableReadRegionFromRequestedRegion()

virtual itk::ImageIORegion otb::ImageIOBase::GenerateStreamableReadRegionFromRequestedRegion ( const itk::ImageIORegion &  requested) const
virtual

Method for supporting streaming. Given a requested region, determine what could be the region that we can read from the file. This is called the streamable region, which will be equal or smaller than the LargestPossibleRegion (unless it was dimensionaly clipped) and greater or equal to the RequestedRegion

the resulting IORegion may be a greater dimensions the the requested IORegion, if the the derived class is unable to read the requested region. For example if the file has a size of [ 10, 10, 10] but the requested region is [10, 10] the return may be 3 dimensions.

◆ GetActualNumberOfSplitsForWriting()

virtual unsigned int otb::ImageIOBase::GetActualNumberOfSplitsForWriting ( unsigned int  numberOfRequestedSplits,
const itk::ImageIORegion &  pasteRegion,
const itk::ImageIORegion &  largestPossibleRegion 
)
virtual

Before this method is called all the configuration will be done, that is Streaming/PasteRegion/Compression/Filename etc If pasting is being used the number of requested splits is for that region not the largest. The derived ImageIO class should verify that the file is capable of being written with this configuration. If pasted is enabled and is not support or does not work with the file, then an exception should be thrown.

The default implementation depends on CanStreamWrite. If false then 1 is returned (unless pasting is indicated), so that the whole file will be updated in one region. If true then its assumed that any arbitrary region can be written to any file. So the users request will be respected. If a derived class has more restictive conditions then they should be checked

◆ GetActualNumberOfSplitsForWritingCanStreamWrite()

virtual unsigned int otb::ImageIOBase::GetActualNumberOfSplitsForWritingCanStreamWrite ( unsigned int  numberOfRequestedSplits,
const itk::ImageIORegion &  pasteRegion 
) const
protectedvirtual

an implementation of ImageRegionSplitter:GetNumberOfSplits

◆ GetAttachedFileNames()

virtual const std::vector<std::string>& otb::ImageIOBase::GetAttachedFileNames ( ) const
virtual

Returns a const ref to the list of attached files

◆ GetByteOrder()

virtual ByteOrder otb::ImageIOBase::GetByteOrder ( ) const
virtual

Enums used to manipulate the pixel type. The pixel type provides context for automatic data conversions (for instance, RGB to SCALAR, VECTOR to SCALAR).

◆ GetByteOrderAsString()

static std::string otb::ImageIOBase::GetByteOrderAsString ( ByteOrder  )
static

Convenience method returns the ByteOrder as a string. This can be used for writing output files.

◆ GetComponentSize()

virtual unsigned int otb::ImageIOBase::GetComponentSize ( ) const
virtual

Compute the size (in bytes) of the components of a pixel. For example, and RGB pixel of unsigned char would have a component size of 1 byte. This method can be invoked only after the component type is set.

◆ GetComponentStride()

SizeType otb::ImageIOBase::GetComponentStride ( ) const
protected

Convenient method for accessing number of bytes to get to the next pixel component. Returns m_Strides[0].

◆ GetComponentType()

virtual IOComponentType otb::ImageIOBase::GetComponentType ( ) const
virtual

Enums used to manipulate the pixel type. The pixel type provides context for automatic data conversions (for instance, RGB to SCALAR, VECTOR to SCALAR).

◆ GetComponentTypeAsString()

static std::string otb::ImageIOBase::GetComponentTypeAsString ( IOComponentType  )
static

Convenience method returns the IOComponentType as a string. This can be used for writing output files.

Referenced by otb::ImageFileReader< TOutputImage, ConvertPixelTraits >::DoConvertBuffer().

◆ GetComponentTypeInfo()

virtual const std::type_info& otb::ImageIOBase::GetComponentTypeInfo ( ) const
virtual

Enums used to manipulate the pixel type. The pixel type provides context for automatic data conversions (for instance, RGB to SCALAR, VECTOR to SCALAR).

◆ GetDefaultDirection()

virtual std::vector<double> otb::ImageIOBase::GetDefaultDirection ( unsigned int  i) const
virtual

Return the directions to be assigned by default to recipient images whose dimension is smaller than the image dimension in file.

◆ GetDimensions()

virtual unsigned int otb::ImageIOBase::GetDimensions ( unsigned int  i) const
inlinevirtual

Enums used to manipulate the pixel type. The pixel type provides context for automatic data conversions (for instance, RGB to SCALAR, VECTOR to SCALAR).

Definition at line 135 of file otbImageIOBase.h.

◆ GetDirection()

virtual std::vector<double> otb::ImageIOBase::GetDirection ( unsigned int  i) const
inlinevirtual

Enums used to manipulate the pixel type. The pixel type provides context for automatic data conversions (for instance, RGB to SCALAR, VECTOR to SCALAR).

Definition at line 163 of file otbImageIOBase.h.

◆ GetFileName()

virtual const char* otb::ImageIOBase::GetFileName ( ) const
virtual

Enums used to manipulate the pixel type. The pixel type provides context for automatic data conversions (for instance, RGB to SCALAR, VECTOR to SCALAR).

◆ GetFileType()

virtual FileType otb::ImageIOBase::GetFileType ( ) const
virtual

Enums used to manipulate the pixel type. The pixel type provides context for automatic data conversions (for instance, RGB to SCALAR, VECTOR to SCALAR).

◆ GetFileTypeAsString()

static std::string otb::ImageIOBase::GetFileTypeAsString ( FileType  )
static

Convenience method returns the FileType as a string. This can be used for writing output files.

◆ GetImageMetadata()

const ImageMetadata& otb::ImageIOBase::GetImageMetadata ( ) const

Enums used to manipulate the pixel type. The pixel type provides context for automatic data conversions (for instance, RGB to SCALAR, VECTOR to SCALAR).

◆ GetImageSizeInBytes()

SizeType otb::ImageIOBase::GetImageSizeInBytes ( ) const

Return the number of bytes in the image.

◆ GetImageSizeInComponents()

SizeType otb::ImageIOBase::GetImageSizeInComponents ( ) const

Return the number of pixels times the number of components in the image.

◆ GetImageSizeInPixels()

SizeType otb::ImageIOBase::GetImageSizeInPixels ( ) const

Return the number of pixels in the image.

◆ GetIORegion()

virtual const itk::ImageIORegion& otb::ImageIOBase::GetIORegion ( ) const
virtual

Enums used to manipulate the pixel type. The pixel type provides context for automatic data conversions (for instance, RGB to SCALAR, VECTOR to SCALAR).

◆ GetNameOfClass()

virtual const char* otb::ImageIOBase::GetNameOfClass ( ) const
virtual

Run-time type information (and related methods).

Reimplemented in otb::GDALImageIO.

◆ GetNumberOfComponents()

virtual const unsigned int& otb::ImageIOBase::GetNumberOfComponents ( ) const
virtual

Enums used to manipulate the pixel type. The pixel type provides context for automatic data conversions (for instance, RGB to SCALAR, VECTOR to SCALAR).

◆ GetNumberOfDimensions()

virtual unsigned int otb::ImageIOBase::GetNumberOfDimensions ( ) const
virtual

Enums used to manipulate the pixel type. The pixel type provides context for automatic data conversions (for instance, RGB to SCALAR, VECTOR to SCALAR).

◆ GetOrigin()

virtual double otb::ImageIOBase::GetOrigin ( unsigned int  i) const
inlinevirtual

Enums used to manipulate the pixel type. The pixel type provides context for automatic data conversions (for instance, RGB to SCALAR, VECTOR to SCALAR).

Definition at line 144 of file otbImageIOBase.h.

◆ GetOverviewsCount()

virtual unsigned int otb::ImageIOBase::GetOverviewsCount ( )
pure virtual

Get the number of overviews available into the file specified Returns: overview count, zero if none.

Implemented in otb::GDALImageIO.

◆ GetOverviewsInfo()

virtual std::vector<std::string> otb::ImageIOBase::GetOverviewsInfo ( )
pure virtual

Get information about overviews available into the file specified Returns: overview info, empty if none.

Implemented in otb::GDALImageIO.

◆ GetPixelSize()

virtual unsigned int otb::ImageIOBase::GetPixelSize ( ) const
protectedvirtual

Compute the size (in bytes) of the pixel. For example, and RGB pixel of unsigned char would have size 3 bytes.

◆ GetPixelStride()

virtual SizeType otb::ImageIOBase::GetPixelStride ( ) const
virtual

Convenient method for accessing the number of bytes to get to the next pixel. Returns m_Strides[1];

Please note that this methods depends the private methods ComputeStrides being called, otherwise this is the incorrect value.

◆ GetPixelType()

virtual IOPixelType otb::ImageIOBase::GetPixelType ( ) const
virtual

Enums used to manipulate the pixel type. The pixel type provides context for automatic data conversions (for instance, RGB to SCALAR, VECTOR to SCALAR).

◆ GetPixelTypeAsString()

static std::string otb::ImageIOBase::GetPixelTypeAsString ( IOPixelType  )
static

Convenience method returns the IOPixelType as a string. This can be used for writing output files.

◆ GetRowStride()

SizeType otb::ImageIOBase::GetRowStride ( ) const
protected

Convenient method for accessing the number of bytes to get to the next row. Returns m_Strides[2].

◆ GetSliceStride()

SizeType otb::ImageIOBase::GetSliceStride ( ) const
protected

Convenient method for accessing the number of bytes to get to the next slice. Returns m_Strides[3].

◆ GetSpacing()

virtual double otb::ImageIOBase::GetSpacing ( unsigned int  i) const
inlinevirtual

Enums used to manipulate the pixel type. The pixel type provides context for automatic data conversions (for instance, RGB to SCALAR, VECTOR to SCALAR).

Definition at line 153 of file otbImageIOBase.h.

◆ GetSplitRegionForWriting()

virtual itk::ImageIORegion otb::ImageIOBase::GetSplitRegionForWriting ( unsigned int  ithPiece,
unsigned int  numberOfActualSplits,
const itk::ImageIORegion &  pasteRegion,
const itk::ImageIORegion &  largestPossibleRegion 
)
virtual

returns the ith IORegion

numberOfActualSplits should be the value returned from GetActualNumberOfSplitsForWriting with the same parameters

Derieved classes should overload this method to return a compatible region

◆ GetSplitRegionForWritingCanStreamWrite()

virtual itk::ImageIORegion otb::ImageIOBase::GetSplitRegionForWritingCanStreamWrite ( unsigned int  ithPiece,
unsigned int  numberOfActualSplits,
const itk::ImageIORegion &  pasteRegion 
) const
protectedvirtual

an implementation of ImageRegionSplitter:GetSplit

◆ GetSupportedReadExtensions()

const ArrayOfExtensionsType& otb::ImageIOBase::GetSupportedReadExtensions ( ) const

This method returns an array with the list of filename extensions supported for reading by this ImageIO class. This is intended to facilitate GUI and application level integration.

◆ GetSupportedWriteExtensions()

const ArrayOfExtensionsType& otb::ImageIOBase::GetSupportedWriteExtensions ( ) const

This method returns an array with the list of filename extensions supported for writing by this ImageIO class. This is intended to facilitate GUI and application level integration.

◆ GetUseCompression()

virtual bool otb::ImageIOBase::GetUseCompression ( ) const
virtual

Enums used to manipulate the pixel type. The pixel type provides context for automatic data conversions (for instance, RGB to SCALAR, VECTOR to SCALAR).

◆ GetUseStreamedReading()

virtual bool otb::ImageIOBase::GetUseStreamedReading ( ) const
virtual

Enums used to manipulate the pixel type. The pixel type provides context for automatic data conversions (for instance, RGB to SCALAR, VECTOR to SCALAR).

◆ GetUseStreamedWriting()

virtual bool otb::ImageIOBase::GetUseStreamedWriting ( ) const
virtual

Enums used to manipulate the pixel type. The pixel type provides context for automatic data conversions (for instance, RGB to SCALAR, VECTOR to SCALAR).

◆ operator=()

void otb::ImageIOBase::operator= ( const Self )
privatedelete

Enums used to manipulate the pixel type. The pixel type provides context for automatic data conversions (for instance, RGB to SCALAR, VECTOR to SCALAR).

◆ PrintSelf()

void otb::ImageIOBase::PrintSelf ( std::ostream &  os,
itk::Indent  indent 
) const
overrideprotected

Enums used to manipulate the pixel type. The pixel type provides context for automatic data conversions (for instance, RGB to SCALAR, VECTOR to SCALAR).

◆ Read()

virtual void otb::ImageIOBase::Read ( void *  buffer)
pure virtual

Reads the data from disk into the memory buffer provided.

Implemented in otb::GDALImageIO.

◆ ReadBufferAsASCII()

void otb::ImageIOBase::ReadBufferAsASCII ( std::istream &  os,
void *  buffer,
IOComponentType  ctype,
SizeType  numberOfBytesToBeRead 
)
protected

Convenient method to read a buffer as ASCII text.

◆ ReadBufferAsBinary()

bool otb::ImageIOBase::ReadBufferAsBinary ( std::istream &  os,
void *  buffer,
SizeType  numberOfBytesToBeRead 
)
protected

Convenient method to read a buffer as binary. Return true on success.

◆ ReadImageInformation()

virtual void otb::ImageIOBase::ReadImageInformation ( )
pure virtual

Read the spacing and dimensions of the image. Assumes SetFileName has been called with a valid file name.

Implemented in otb::GDALImageIO.

◆ Reset()

virtual void otb::ImageIOBase::Reset ( const bool  freeDynamic = true)
protectedvirtual

Return the object to an initialized state, ready to be used

◆ Resize()

void otb::ImageIOBase::Resize ( const unsigned int  numDimensions,
const unsigned int *  dimensions 
)
protected

Resize the ImageIOBase object to new dimensions.

◆ SetByteOrder()

virtual void otb::ImageIOBase::SetByteOrder ( const ByteOrder  _arg)
virtual

These methods indicate the byte ordering of the file you are trying to read in. These methods will then either swap or not swap the bytes depending on the byte ordering of the machine it is being run on. For example, reading in a BigEndian file on a BigEndian machine will result in no swapping. Trying to read the same file on a LittleEndian machine will result in swapping. Note: most UNIX machines are BigEndian while PC's and VAX's are LittleEndian. So if the file you are reading in was generated on a VAX or PC, SetByteOrderToLittleEndian() otherwise SetByteOrderToBigEndian(). Some ImageIOBase subclasses ignore these methods.

◆ SetByteOrderToBigEndian()

void otb::ImageIOBase::SetByteOrderToBigEndian ( )
inline

Enums used to manipulate the pixel type. The pixel type provides context for automatic data conversions (for instance, RGB to SCALAR, VECTOR to SCALAR).

Definition at line 277 of file otbImageIOBase.h.

◆ SetByteOrderToLittleEndian()

void otb::ImageIOBase::SetByteOrderToLittleEndian ( )
inline

Enums used to manipulate the pixel type. The pixel type provides context for automatic data conversions (for instance, RGB to SCALAR, VECTOR to SCALAR).

Definition at line 281 of file otbImageIOBase.h.

◆ SetComponentType()

virtual void otb::ImageIOBase::SetComponentType ( const IOComponentType  _arg)
virtual

Set/Get the component type of the image. This is always a native type.

◆ SetDimensions()

virtual void otb::ImageIOBase::SetDimensions ( unsigned int  i,
unsigned int  dim 
)
virtual

Set/Get the image dimensions in the x, y, z, etc. directions. GetDimensions() is typically used after reading the data; the SetDimensions() is used prior to writing the data.

◆ SetDirection() [1/2]

virtual void otb::ImageIOBase::SetDirection ( unsigned int  i,
std::vector< double > &  direction 
)
virtual

Set/Get the image direction on an axis-by-axis basis. The SetDirection() method is required when writing the image.

◆ SetDirection() [2/2]

virtual void otb::ImageIOBase::SetDirection ( unsigned int  i,
vnl_vector< double > &  direction 
)
virtual

Enums used to manipulate the pixel type. The pixel type provides context for automatic data conversions (for instance, RGB to SCALAR, VECTOR to SCALAR).

◆ SetFileName()

virtual void otb::ImageIOBase::SetFileName ( const char *  _arg)
virtual

Set/Get the name of the file to be read.

◆ SetFileType()

virtual void otb::ImageIOBase::SetFileType ( const FileType  _arg)
virtual

These methods control whether the file is written binary or ASCII. Many file formats (i.e., subclasses) ignore this flag.

◆ SetFileTypeToASCII()

void otb::ImageIOBase::SetFileTypeToASCII ( )
inline

Enums used to manipulate the pixel type. The pixel type provides context for automatic data conversions (for instance, RGB to SCALAR, VECTOR to SCALAR).

Definition at line 254 of file otbImageIOBase.h.

◆ SetFileTypeToBinary()

void otb::ImageIOBase::SetFileTypeToBinary ( )
inline

Enums used to manipulate the pixel type. The pixel type provides context for automatic data conversions (for instance, RGB to SCALAR, VECTOR to SCALAR).

Definition at line 258 of file otbImageIOBase.h.

◆ SetImageMetadata()

void otb::ImageIOBase::SetImageMetadata ( ImageMetadata  )

Enums used to manipulate the pixel type. The pixel type provides context for automatic data conversions (for instance, RGB to SCALAR, VECTOR to SCALAR).

◆ SetIORegion()

virtual void otb::ImageIOBase::SetIORegion ( itk::ImageIORegion  _arg)
virtual

Specify the region of the image data to either read or write. The IORegion specifies the part of the image to read or write. Regions are defined with an index and a size vector. These vectors define the start (lower-left corner) and length of the region within the image. Make sure that the IORegion lies within the image.

◆ SetNumberOfComponents()

virtual void otb::ImageIOBase::SetNumberOfComponents ( unsigned int  _arg)
virtual

Set/Get the number of components per pixel in the image. This may be set by the reading process. For SCALAR pixel types, NumberOfComponents will be 1. For other pixel types, NumberOfComponents will be greater than or equal to one.

◆ SetNumberOfDimensions()

void otb::ImageIOBase::SetNumberOfDimensions ( unsigned int  )

Set/Get the number of independent variables (dimensions) in the image being read or written. Note this is not necessarily what is written, rather the IORegion controls that.

◆ SetOrigin()

virtual void otb::ImageIOBase::SetOrigin ( unsigned int  i,
double  origin 
)
virtual

Set/Get the image origin on a axis-by-axis basis. The SetOrigin() method is required when writing the image.

◆ SetOutputImagePixelType()

virtual void otb::ImageIOBase::SetOutputImagePixelType ( bool  isComplexInternalPixelType,
bool  isVectorImage 
)
pure virtual

Provide hist about the output container to deal with complex pixel type

Implemented in otb::GDALImageIO.

◆ SetPixelType()

virtual void otb::ImageIOBase::SetPixelType ( const IOPixelType  _arg)
virtual

Set/Get the type of the pixel. The PixelTypes provides context to the IO mechanisms for data conversions. PixelTypes can be SCALAR, RGB, RGBA, VECTOR, COVARIANTVECTOR, POINT, INDEX. If the PIXELTYPE is SCALAR, then the NumberOfComponents should be 1. Any other of PIXELTYPE will have more than one component.

◆ SetPixelTypeInfo()

virtual bool otb::ImageIOBase::SetPixelTypeInfo ( const std::type_info &  ptype)
virtual

SetPixelTypeInfo is used by writers to convert from an ITK strongly typed pixel to a ImageIO (weaker) typed pixel. This function sets these PixelType, ComponentType, and NumberOfComponents based on RTTI type_info structure passed in. The function returns false if the pixel type is not supported.

◆ SetSpacing()

virtual void otb::ImageIOBase::SetSpacing ( unsigned int  i,
double  spacing 
)
virtual

Set/Get the image spacing on an axis-by-axis basis. The SetSpacing() method is required when writing the image.

◆ SetUseCompression()

virtual void otb::ImageIOBase::SetUseCompression ( bool  _arg)
virtual

Set/Get a boolean to use the compression or not.

◆ SetUseStreamedReading()

virtual void otb::ImageIOBase::SetUseStreamedReading ( bool  _arg)
virtual

Set/Get a boolean to use streaming while reading or not.

◆ SetUseStreamedWriting()

virtual void otb::ImageIOBase::SetUseStreamedWriting ( bool  _arg)
virtual

Set/Get a boolean to use streaming while writing or not.

◆ SupportsDimension()

virtual bool otb::ImageIOBase::SupportsDimension ( unsigned long  dim)
inlinevirtual

The different types of ImageIO's can support data of varying dimensionality. For example, some file formats are strictly 2D while others can support 2D, 3D, or even n-D. This method returns true/false as to whether the ImageIO can support the dimension indicated.

Definition at line 391 of file otbImageIOBase.h.

◆ UseCompressionOff()

virtual void otb::ImageIOBase::UseCompressionOff ( )
virtual

Enums used to manipulate the pixel type. The pixel type provides context for automatic data conversions (for instance, RGB to SCALAR, VECTOR to SCALAR).

◆ UseCompressionOn()

virtual void otb::ImageIOBase::UseCompressionOn ( )
virtual

Enums used to manipulate the pixel type. The pixel type provides context for automatic data conversions (for instance, RGB to SCALAR, VECTOR to SCALAR).

◆ UseStreamedReadingOff()

virtual void otb::ImageIOBase::UseStreamedReadingOff ( )
virtual

Enums used to manipulate the pixel type. The pixel type provides context for automatic data conversions (for instance, RGB to SCALAR, VECTOR to SCALAR).

◆ UseStreamedReadingOn()

virtual void otb::ImageIOBase::UseStreamedReadingOn ( )
virtual

Enums used to manipulate the pixel type. The pixel type provides context for automatic data conversions (for instance, RGB to SCALAR, VECTOR to SCALAR).

◆ UseStreamedWritingOff()

virtual void otb::ImageIOBase::UseStreamedWritingOff ( )
virtual

Enums used to manipulate the pixel type. The pixel type provides context for automatic data conversions (for instance, RGB to SCALAR, VECTOR to SCALAR).

◆ UseStreamedWritingOn()

virtual void otb::ImageIOBase::UseStreamedWritingOn ( )
virtual

Enums used to manipulate the pixel type. The pixel type provides context for automatic data conversions (for instance, RGB to SCALAR, VECTOR to SCALAR).

◆ Write()

virtual void otb::ImageIOBase::Write ( const void *  buffer)
pure virtual

Writes the data to disk from the memory buffer provided. Make sure that the IORegions has been set properly. The buffer is cast to a pointer to the beginning of the image data.

Implemented in otb::GDALImageIO.

◆ WriteBufferAsASCII()

void otb::ImageIOBase::WriteBufferAsASCII ( std::ostream &  os,
const void *  buffer,
IOComponentType  ctype,
SizeType  numberOfBytesToWrite 
)
protected

Convenient method to write a buffer as ASCII text.

◆ WriteImageInformation()

virtual void otb::ImageIOBase::WriteImageInformation ( )
pure virtual

Writes the spacing and dimensions of the image. Assumes SetFileName has been called with a valid file name.

Implemented in otb::GDALImageIO.

Member Data Documentation

◆ m_AttachedFileNames

std::vector<std::string> otb::ImageIOBase::m_AttachedFileNames
protected

List of files part of the same dataset as the input filename

Definition at line 580 of file otbImageIOBase.h.

◆ m_BandList

std::vector<unsigned int> otb::ImageIOBase::m_BandList
protected

Mapping between origin components and output components. Note that the buffer is already mapped after calling the DoMapBuffer method. This attribute is useful to write band related metadatas.

Definition at line 588 of file otbImageIOBase.h.

◆ m_ByteOrder

ByteOrder otb::ImageIOBase::m_ByteOrder
protected

Big or Little Endian, and the type of the file. (May be ignored.)

Definition at line 478 of file otbImageIOBase.h.

◆ m_ComponentType

IOComponentType otb::ImageIOBase::m_ComponentType
protected

Used internally to keep track of the type of the component. It is set when ComputeStrides() is invoked.

Definition at line 475 of file otbImageIOBase.h.

◆ m_Dimensions

std::vector<SizeValueType> otb::ImageIOBase::m_Dimensions
protected

The array which stores the number of pixels in the x, y, z directions.

Definition at line 508 of file otbImageIOBase.h.

◆ m_Direction

std::vector<std::vector<double> > otb::ImageIOBase::m_Direction
protected

The arrays which store the direction cosines of the image.

Definition at line 518 of file otbImageIOBase.h.

◆ m_FileName

std::string otb::ImageIOBase::m_FileName
protected

Filename to read

Definition at line 485 of file otbImageIOBase.h.

◆ m_FileType

FileType otb::ImageIOBase::m_FileType
protected

Enums used to manipulate the pixel type. The pixel type provides context for automatic data conversions (for instance, RGB to SCALAR, VECTOR to SCALAR).

Definition at line 479 of file otbImageIOBase.h.

◆ m_Imd

ImageMetadata otb::ImageIOBase::m_Imd
protected

Image metadata pre-parsed by the ImageIO

Definition at line 583 of file otbImageIOBase.h.

◆ m_Initialized

bool otb::ImageIOBase::m_Initialized
protected

Does the ImageIOBase object have enough info to be of use?

Definition at line 482 of file otbImageIOBase.h.

◆ m_IORegion

itk::ImageIORegion otb::ImageIOBase::m_IORegion
protected

The region to read or write. The region contains information about the data within the region to read or write.

Definition at line 505 of file otbImageIOBase.h.

◆ m_NumberOfComponents

unsigned int otb::ImageIOBase::m_NumberOfComponents
protected

Stores the number of components per pixel. This will be 1 for grayscale images, 3 for RGBPixel images, and 4 for RGBPixelA images.

Definition at line 489 of file otbImageIOBase.h.

◆ m_NumberOfDimensions

unsigned int otb::ImageIOBase::m_NumberOfDimensions
protected

The number of independent dimensions in the image.

Definition at line 492 of file otbImageIOBase.h.

◆ m_Origin

std::vector<double> otb::ImageIOBase::m_Origin
protected

The array which stores the origin of the image.

Definition at line 515 of file otbImageIOBase.h.

◆ m_PixelType

IOPixelType otb::ImageIOBase::m_PixelType
protected

Used internally to keep track of the type of the pixel.

Definition at line 471 of file otbImageIOBase.h.

◆ m_Spacing

std::vector<double> otb::ImageIOBase::m_Spacing
protected

The array which stores the spacing of pixels in the x, y, z directions.

Definition at line 512 of file otbImageIOBase.h.

◆ m_Strides

std::vector<SizeType> otb::ImageIOBase::m_Strides
protected

Stores the number of bytes it takes to get to the next 'thing' e.g. component, pixel, row, slice, etc.

Definition at line 522 of file otbImageIOBase.h.

◆ m_SupportedReadExtensions

ArrayOfExtensionsType otb::ImageIOBase::m_SupportedReadExtensions
private

Enums used to manipulate the pixel type. The pixel type provides context for automatic data conversions (for instance, RGB to SCALAR, VECTOR to SCALAR).

Definition at line 594 of file otbImageIOBase.h.

◆ m_SupportedWriteExtensions

ArrayOfExtensionsType otb::ImageIOBase::m_SupportedWriteExtensions
private

Enums used to manipulate the pixel type. The pixel type provides context for automatic data conversions (for instance, RGB to SCALAR, VECTOR to SCALAR).

Definition at line 595 of file otbImageIOBase.h.

◆ m_UseCompression

bool otb::ImageIOBase::m_UseCompression
protected

Should we compress the data?

Definition at line 495 of file otbImageIOBase.h.

◆ m_UseStreamedReading

bool otb::ImageIOBase::m_UseStreamedReading
protected

Should we use streaming for reading

Definition at line 498 of file otbImageIOBase.h.

◆ m_UseStreamedWriting

bool otb::ImageIOBase::m_UseStreamedWriting
protected

Should we use streaming for writing

Definition at line 501 of file otbImageIOBase.h.


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