Orfeo ToolBox  4.2
Orfeo ToolBox is not a black box
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | Private Attributes | List of all members
otb::ONERAImageIO Class Reference

ImageIO object for reading (not writing) ONERA format images. More...

#include <otbONERAImageIO.h>

+ Inheritance diagram for otb::ONERAImageIO:
+ Collaboration diagram for otb::ONERAImageIO:

Public Types

typedef unsigned char InputPixelType
 
typedef itk::SmartPointer< SelfPointer
 
typedef ONERAImageIO Self
 
typedef otb::ImageIOBase Superclass
 
- Public Types inherited from otb::ImageIOBase
typedef std::vector< std::string > ArrayOfExtensionsType
 
typedef vcl_size_t BufferSizeType
 
enum  ByteOrder {
  BigEndian,
  LittleEndian,
  OrderNotApplicable
}
 
enum  FileType {
  ASCII,
  Binary,
  TypeNotApplicable
}
 
typedef long IndexValueType
 
enum  IOComponentType {
  UNKNOWNCOMPONENTTYPE,
  UCHAR,
  CHAR,
  USHORT,
  SHORT,
  UINT,
  INT,
  ULONG,
  LONG,
  FLOAT,
  DOUBLE,
  CSHORT,
  CINT,
  CFLOAT,
  CDOUBLE
}
 
enum  IOPixelType {
  UNKNOWNPIXELTYPE,
  SCALAR,
  RGB,
  RGBA,
  OFFSET,
  VECTOR,
  POINT,
  COVARIANTVECTOR,
  SYMMETRICSECONDRANKTENSOR,
  DIFFUSIONTENSOR3D,
  COMPLEX,
  FIXEDARRAY,
  MATRIX
}
 
typedef itk::SmartPointer< SelfPointer
 
typedef ImageIOBase Self
 
typedef std::streamoff SizeType
 
typedef unsigned long SizeValueType
 
typedef itk::LightProcessObject Superclass
 

Public Member Functions

virtual bool CanReadFile (const char *)
 
virtual bool CanStreamRead ()
 
virtual bool CanStreamWrite ()
 
virtual bool CanWriteFile (const char *)
 
virtual ::itk::LightObject::Pointer CreateAnother (void) const
 
virtual const char * GetNameOfClass () const
 
virtual void Read (void *buffer)
 
virtual void ReadImageInformation ()
 
virtual void ReadVolume (void *buffer)
 
virtual void Write (const void *buffer)
 
virtual void WriteImageInformation ()
 
- Public Member Functions inherited from otb::ImageIOBase
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 ByteOrder GetByteOrder () const
 
std::string GetByteOrderAsString (ByteOrder) const
 
virtual unsigned int GetComponentSize () const
 
virtual IOComponentType GetComponentType () const
 
std::string GetComponentTypeAsString (IOComponentType) const
 
virtual const std::type_info & GetComponentTypeInfo () const
 
virtual std::vector< double > GetDefaultDirection (unsigned int i) const
 
virtual unsigned int GetDimensions (unsigned int i) const
 
virtual std::vector< double > GetDirection (unsigned int i) const
 
virtual const char * GetFileName () const
 
virtual FileType GetFileType () const
 
std::string GetFileTypeAsString (FileType) const
 
SizeType GetImageSizeInBytes () const
 
SizeType GetImageSizeInComponents () const
 
SizeType GetImageSizeInPixels () const
 
virtual const itk::ImageIORegionGetIORegion ()
 
virtual const unsigned int & GetNumberOfComponents ()
 
virtual unsigned int GetNumberOfDimensions () const
 
virtual double GetOrigin (unsigned int i) const
 
virtual SizeType GetPixelStride () const
 
virtual IOPixelType GetPixelType () const
 
std::string GetPixelTypeAsString (IOPixelType) const
 
virtual double GetSpacing (unsigned int i) const
 
virtual itk::ImageIORegion GetSplitRegionForWriting (unsigned int ithPiece, unsigned int numberOfActualSplits, const itk::ImageIORegion &pasteRegion, const itk::ImageIORegion &largestPossibleRegion)
 
const ArrayOfExtensionsTypeGetSupportedReadExtensions () const
 
const ArrayOfExtensionsTypeGetSupportedWriteExtensions () const
 
virtual bool GetUseCompression () const
 
virtual bool GetUseStreamedReading () const
 
virtual bool GetUseStreamedWriting () const
 
virtual void SetByteOrder (const ByteOrder _arg)
 
void SetByteOrderToBigEndian ()
 
void SetByteOrderToLittleEndian ()
 
virtual void SetComponentType (const IOComponentType _arg)
 
virtual void SetDimensions (unsigned int i, unsigned int dim)
 
virtual void SetDirection (unsigned int i, std::vector< double > &direction)
 
virtual void SetDirection (unsigned int i, vnl_vector< double > &direction)
 
virtual void SetFileName (const char *_arg)
 
virtual void SetFileType (const FileType _arg)
 
void SetFileTypeToASCII ()
 
void SetFileTypeToBinary ()
 
virtual void SetIORegion (itk::ImageIORegion _arg)
 
virtual void SetNumberOfComponents (unsigned int _arg)
 
void SetNumberOfDimensions (unsigned int)
 
virtual void SetOrigin (unsigned int i, double origin)
 
virtual void SetPixelType (const IOPixelType _arg)
 
virtual bool SetPixelTypeInfo (const std::type_info &ptype)
 
virtual void SetSpacing (unsigned int i, double spacing)
 
virtual void SetUseCompression (bool _arg)
 
virtual void SetUseStreamedReading (bool _arg)
 
virtual void SetUseStreamedWriting (bool _arg)
 
virtual bool SupportsDimension (unsigned long dim)
 
virtual void UseCompressionOff ()
 
virtual void UseCompressionOn ()
 
virtual void UseStreamedReadingOff ()
 
virtual void UseStreamedReadingOn ()
 
virtual void UseStreamedWritingOff ()
 
virtual void UseStreamedWritingOn ()
 

Static Public Member Functions

static Pointer New ()
 

Protected Member Functions

 ONERAImageIO ()
 
virtual ~ONERAImageIO ()
 
void InternalReadImageInformation ()
 
void InternalWriteImageInformation ()
 
bool OpenOneraDataFileForReading (const char *filename)
 
bool OpenOneraDataFileForWriting (const char *filename)
 
bool OpenOneraHeaderFileForReading (const char *filename)
 
bool OpenOneraHeaderFileForWriting (const char *filename)
 
void PrintSelf (std::ostream &os, itk::Indent indent) const
 
- Protected Member Functions inherited from otb::ImageIOBase
 ImageIOBase ()
 
virtual ~ImageIOBase ()
 
void AddSupportedReadExtension (const char *extension)
 
void AddSupportedWriteExtension (const char *extension)
 
void ComputeStrides ()
 
virtual unsigned int GetActualNumberOfSplitsForWritingCanStreamWrite (unsigned int numberOfRequestedSplits, const itk::ImageIORegion &pasteRegion) const
 
SizeType GetComponentStride () const
 
virtual unsigned int GetPixelSize () const
 
SizeType GetRowStride () const
 
SizeType GetSliceStride () const
 
virtual itk::ImageIORegion GetSplitRegionForWritingCanStreamWrite (unsigned int ithPiece, unsigned int numberOfActualSplits, const itk::ImageIORegion &pasteRegion) const
 
void ReadBufferAsASCII (std::istream &os, void *buffer, IOComponentType ctype, SizeType numberOfBytesToBeRead)
 
bool ReadBufferAsBinary (std::istream &os, void *buffer, SizeType numberOfBytesToBeRead)
 
virtual void Reset (const bool freeDynamic=true)
 
void Resize (const unsigned int numDimensions, const unsigned int *dimensions)
 
void WriteBufferAsASCII (std::ostream &os, const void *buffer, IOComponentType ctype, SizeType numberOfBytesToWrite)
 

Protected Attributes

std::fstream m_Datafile
 
std::fstream m_Headerfile
 
int m_height
 
int m_NbBands
 
int m_width
 
- Protected Attributes inherited from otb::ImageIOBase
ByteOrder m_ByteOrder
 
IOComponentType m_ComponentType
 
std::vector< SizeValueTypem_Dimensions
 
std::vector< std::vector
< double > > 
m_Direction
 
std::string m_FileName
 
FileType m_FileType
 
bool m_Initialized
 
itk::ImageIORegion m_IORegion
 
unsigned int m_NumberOfComponents
 
unsigned int m_NumberOfDimensions
 
std::vector< double > m_Origin
 
IOPixelType m_PixelType
 
std::vector< double > m_Spacing
 
std::vector< SizeTypem_Strides
 
bool m_UseCompression
 
bool m_UseStreamedReading
 
bool m_UseStreamedWriting
 

Private Member Functions

 ONERAImageIO (const Self &)
 
void GetOneraImageFileName (const char *filename, std::string &OneraFileName)
 
void operator= (const Self &)
 

Private Attributes

int m_BytePerPixel
 
otb::ImageIOBase::ByteOrder m_FileByteOrder
 
bool m_FlagWriteImageInformation
 

Detailed Description

ImageIO object for reading (not writing) ONERA format images.

The streaming read is implemented.

Definition at line 37 of file otbONERAImageIO.h.

Member Typedef Documentation

typedef unsigned char otb::ONERAImageIO::InputPixelType

Definition at line 41 of file otbONERAImageIO.h.

Definition at line 46 of file otbONERAImageIO.h.

Standard class typedefs.

Definition at line 44 of file otbONERAImageIO.h.

Definition at line 45 of file otbONERAImageIO.h.

Constructor & Destructor Documentation

otb::ONERAImageIO::ONERAImageIO ( )
protected
otb::ONERAImageIO::~ONERAImageIO ( )
protectedvirtual

Destructor.

Definition at line 64 of file otbONERAImageIO.cxx.

References m_Datafile, and m_Headerfile.

otb::ONERAImageIO::ONERAImageIO ( const Self )
private

Member Function Documentation

bool otb::ONERAImageIO::CanReadFile ( const char *  FileNameToRead)
virtual
virtual bool otb::ONERAImageIO::CanStreamRead ( )
inlinevirtual

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

Reimplemented from otb::ImageIOBase.

Definition at line 61 of file otbONERAImageIO.h.

virtual bool otb::ONERAImageIO::CanStreamWrite ( void  )
inlinevirtual

Determine the file type. Returns true if the ImageIO can stream write the specified file

Reimplemented from otb::ImageIOBase.

Definition at line 82 of file otbONERAImageIO.h.

bool otb::ONERAImageIO::CanWriteFile ( const char *  FileNameToWrite)
virtual

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

Implements otb::ImageIOBase.

Definition at line 448 of file otbONERAImageIO.cxx.

References otb::System::GetRootName().

virtual::itk::LightObject::Pointer otb::ONERAImageIO::CreateAnother ( void  ) const
virtual const char* otb::ONERAImageIO::GetNameOfClass ( ) const
virtual

Run-time type information (and related methods).

Reimplemented from otb::ImageIOBase.

void otb::ONERAImageIO::GetOneraImageFileName ( const char *  filename,
std::string &  OneraFileName 
)
private

Analyze the input file name : if it's a directory, check that a header file exists (ENT...) and set OneraFileName to it else OneraFileName is set to filename

void otb::ONERAImageIO::InternalReadImageInformation ( )
protected
void otb::ONERAImageIO::InternalWriteImageInformation ( )
protected
static Pointer otb::ONERAImageIO::New ( )
static

Method for creation through the object factory.

bool otb::ONERAImageIO::OpenOneraDataFileForReading ( const char *  filename)
protected

Definition at line 234 of file otbONERAImageIO.cxx.

References otb::System::GetRootName(), m_Datafile, and otbMsgDebugMacro.

Referenced by InternalReadImageInformation(), and Read().

bool otb::ONERAImageIO::OpenOneraDataFileForWriting ( const char *  filename)
protected
bool otb::ONERAImageIO::OpenOneraHeaderFileForReading ( const char *  filename)
protected
bool otb::ONERAImageIO::OpenOneraHeaderFileForWriting ( const char *  filename)
protected
void otb::ONERAImageIO::operator= ( const Self )
private
void otb::ONERAImageIO::PrintSelf ( std::ostream &  os,
itk::Indent  indent 
) const
protectedvirtual

Reimplemented from otb::ImageIOBase.

Definition at line 149 of file otbONERAImageIO.cxx.

References otb::ImageIOBase::PrintSelf().

void otb::ONERAImageIO::Read ( void *  buffer)
virtual
void otb::ONERAImageIO::ReadImageInformation ( )
virtual

Set the spacing and dimention information for the set filename.

Implements otb::ImageIOBase.

Definition at line 289 of file otbONERAImageIO.cxx.

References InternalReadImageInformation().

void otb::ONERAImageIO::ReadVolume ( void *  buffer)
virtual

Reads 3D data from multiple files assuming one slice per file.

Definition at line 155 of file otbONERAImageIO.cxx.

void otb::ONERAImageIO::Write ( const void *  buffer)
virtual
void otb::ONERAImageIO::WriteImageInformation ( void  )
virtual

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

Implements otb::ImageIOBase.

Definition at line 517 of file otbONERAImageIO.cxx.

Member Data Documentation

int otb::ONERAImageIO::m_BytePerPixel
private

Nombre d'octets par pixel

Definition at line 158 of file otbONERAImageIO.h.

Referenced by InternalReadImageInformation(), InternalWriteImageInformation(), ONERAImageIO(), Read(), and Write().

std::fstream otb::ONERAImageIO::m_Datafile
protected
otb::ImageIOBase::ByteOrder otb::ONERAImageIO::m_FileByteOrder
private

File byte order

Definition at line 161 of file otbONERAImageIO.h.

Referenced by CanReadFile(), InternalReadImageInformation(), and ONERAImageIO().

bool otb::ONERAImageIO::m_FlagWriteImageInformation
private

Definition at line 159 of file otbONERAImageIO.h.

Referenced by ONERAImageIO(), and Write().

std::fstream otb::ONERAImageIO::m_Headerfile
protected
int otb::ONERAImageIO::m_height
protected

Dimension along Oy of the image

Definition at line 117 of file otbONERAImageIO.h.

Referenced by InternalReadImageInformation().

int otb::ONERAImageIO::m_NbBands
protected

Number of bands of the image

Definition at line 119 of file otbONERAImageIO.h.

Referenced by InternalReadImageInformation().

int otb::ONERAImageIO::m_width
protected

Dimension along Ox of the image

Definition at line 115 of file otbONERAImageIO.h.

Referenced by InternalReadImageInformation(), and Read().


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