OTB  9.0.0
Orfeo Toolbox
Public Types | Public Member Functions | Static Public Member Functions | List of all members
otb::ImageFileReader< TOutputImage, ConvertPixelTraits > Class Template Reference

#include <otbImageFileReader.h>

+ Inheritance diagram for otb::ImageFileReader< TOutputImage, ConvertPixelTraits >:
+ Collaboration diagram for otb::ImageFileReader< TOutputImage, ConvertPixelTraits >:

Public Types

typedef ExtendedFilenameToReaderOptions FNameHelperType
 
typedef TOutputImage::RegionType ImageRegionType
 
typedef TOutputImage::IndexType IndexType
 
typedef TOutputImage::InternalPixelType OutputImagePixelType
 
typedef itk::SmartPointer< SelfPointer
 
typedef ImageFileReader Self
 
typedef TOutputImage::SizeType SizeType
 
typedef itk::ImageSource< TOutputImage > Superclass
 

Public Member Functions

virtual ::itk::LightObject::Pointer CreateAnother (void) const
 
void EnlargeOutputRequestedRegion (itk::DataObject *output) override
 
void GenerateData () override
 
void GenerateOutputInformation (void) override
 
virtual const char * GetNameOfClass () const
 

Static Public Member Functions

static Pointer New ()
 
otb::ImageIOBase::Pointer m_ImageIO
 
bool m_UserSpecifiedImageIO
 
std::string m_FileName
 
bool m_UseStreaming
 
itk::ImageIORegion m_ActualIORegion
 
FNameHelperType::Pointer m_FilenameHelper
 
unsigned int m_AdditionalNumber
 
std::vector< unsigned int > m_BandList
 
unsigned int m_IOComponents
 
static std::string GetDerivedDatasetSourceFileName (const std::string &filename)
 
void SetImageIO (otb::ImageIOBase *imageIO)
 
 itkGetObjectMacro (ImageIO, otb::ImageIOBase)
 
virtual void SetFileName (const std::string &extendedFileName)
 
virtual const char * GetFileName () const
 
unsigned int GetOverviewsCount ()
 
std::vector< std::string > GetOverviewsInfo ()
 
 ImageFileReader ()
 
 ~ImageFileReader () override
 
void PrintSelf (std::ostream &os, itk::Indent indent) const override
 
void DoConvertBuffer (void *buffer, vcl_size_t numberOfPixels)
 
void TestValidImageIO ()
 
bool GetGdalReadImageFileName (const std::string &filename, std::string &GdalFileName)
 
 ImageFileReader (const Self &)=delete
 
void operator= (const Self &)=delete
 

Detailed Description

template<class TOutputImage, class ConvertPixelTraits = DefaultConvertPixelTraits<typename TOutputImage::IOPixelType>>
class otb::ImageFileReader< TOutputImage, ConvertPixelTraits >

Reads image data.

ImageFileReader reads its output data from a single output file. It interfaces with an ImageIO class to read in the data and supports streaming (partial reading) if the source dataset does so.

ImageFileReader supports extended filenames, which allow controlling how the source dataset is read. See http://wiki.orfeo-toolbox.org/index.php/ExtendedFileName for more information.

See also
ExtendedFilenameToReaderOptions
ImageSeriesReader
ImageIOBase
Examples
DisparityMap/FineRegistrationImageFilterExample.cxx, DisparityMap/NCCRegistrationFilterExample.cxx, FeatureExtraction/CloudDetectionExample.cxx, Fusion/BayesianFusionImageFilter.cxx, Fusion/PanSharpeningExample.cxx, Markov/MarkovClassification1Example.cxx, Markov/MarkovClassification2Example.cxx, Markov/MarkovRegularizationExample.cxx, Markov/MarkovRestorationExample.cxx, Patented/SIFTExample.cxx, Patented/SIFTFastExample.cxx, Projections/VectorDataExtractROIExample.cxx, Projections/VectorDataProjectionExample.cxx, and Radiometry/AtmosphericCorrectionSequencement.cxx.

Definition at line 68 of file otbImageFileReader.h.

Member Typedef Documentation

◆ FNameHelperType

template<class TOutputImage , class ConvertPixelTraits = DefaultConvertPixelTraits<typename TOutputImage::IOPixelType>>
typedef ExtendedFilenameToReaderOptions otb::ImageFileReader< TOutputImage, ConvertPixelTraits >::FNameHelperType

The Filename Helper.

Definition at line 95 of file otbImageFileReader.h.

◆ ImageRegionType

template<class TOutputImage , class ConvertPixelTraits = DefaultConvertPixelTraits<typename TOutputImage::IOPixelType>>
typedef TOutputImage::RegionType otb::ImageFileReader< TOutputImage, ConvertPixelTraits >::ImageRegionType

The region of the output image.

Definition at line 89 of file otbImageFileReader.h.

◆ IndexType

template<class TOutputImage , class ConvertPixelTraits = DefaultConvertPixelTraits<typename TOutputImage::IOPixelType>>
typedef TOutputImage::IndexType otb::ImageFileReader< TOutputImage, ConvertPixelTraits >::IndexType

The size of the output image.

Definition at line 86 of file otbImageFileReader.h.

◆ OutputImagePixelType

template<class TOutputImage , class ConvertPixelTraits = DefaultConvertPixelTraits<typename TOutputImage::IOPixelType>>
typedef TOutputImage::InternalPixelType otb::ImageFileReader< TOutputImage, ConvertPixelTraits >::OutputImagePixelType

The pixel type of the output image.

Definition at line 92 of file otbImageFileReader.h.

◆ Pointer

template<class TOutputImage , class ConvertPixelTraits = DefaultConvertPixelTraits<typename TOutputImage::IOPixelType>>
typedef itk::SmartPointer<Self> otb::ImageFileReader< TOutputImage, ConvertPixelTraits >::Pointer

Definition at line 74 of file otbImageFileReader.h.

◆ Self

template<class TOutputImage , class ConvertPixelTraits = DefaultConvertPixelTraits<typename TOutputImage::IOPixelType>>
typedef ImageFileReader otb::ImageFileReader< TOutputImage, ConvertPixelTraits >::Self

Standard class typedefs.

Definition at line 72 of file otbImageFileReader.h.

◆ SizeType

template<class TOutputImage , class ConvertPixelTraits = DefaultConvertPixelTraits<typename TOutputImage::IOPixelType>>
typedef TOutputImage::SizeType otb::ImageFileReader< TOutputImage, ConvertPixelTraits >::SizeType

The size of the output image.

Definition at line 80 of file otbImageFileReader.h.

◆ Superclass

template<class TOutputImage , class ConvertPixelTraits = DefaultConvertPixelTraits<typename TOutputImage::IOPixelType>>
typedef itk::ImageSource<TOutputImage> otb::ImageFileReader< TOutputImage, ConvertPixelTraits >::Superclass

Definition at line 73 of file otbImageFileReader.h.

Constructor & Destructor Documentation

◆ ImageFileReader() [1/2]

template<class TOutputImage , class ConvertPixelTraits >
otb::ImageFileReader< TOutputImage, ConvertPixelTraits >::ImageFileReader
protected

Mapping between origin components and output components (before any conversion)

Definition at line 66 of file otbImageFileReader.hxx.

◆ ~ImageFileReader()

template<class TOutputImage , class ConvertPixelTraits >
otb::ImageFileReader< TOutputImage, ConvertPixelTraits >::~ImageFileReader
overrideprotected

Mapping between origin components and output components (before any conversion)

Definition at line 79 of file otbImageFileReader.hxx.

◆ ImageFileReader() [2/2]

template<class TOutputImage , class ConvertPixelTraits = DefaultConvertPixelTraits<typename TOutputImage::IOPixelType>>
otb::ImageFileReader< TOutputImage, ConvertPixelTraits >::ImageFileReader ( const Self )
privatedelete

Mapping between origin components and output components (before any conversion)

Member Function Documentation

◆ CreateAnother()

template<class TOutputImage , class ConvertPixelTraits = DefaultConvertPixelTraits<typename TOutputImage::IOPixelType>>
virtual::itk::LightObject::Pointer otb::ImageFileReader< TOutputImage, ConvertPixelTraits >::CreateAnother ( void  ) const

◆ DoConvertBuffer()

template<class TOutputImage , class ConvertPixelTraits >
void otb::ImageFileReader< TOutputImage, ConvertPixelTraits >::DoConvertBuffer ( void *  buffer,
vcl_size_t  numberOfPixels 
)
protected

Convert a block of pixels from one type to another.

Definition at line 665 of file otbImageFileReader.hxx.

References otb::ImageIOBase::GetComponentTypeAsString(), OTB_CONVERT_BUFFER_IF_BLOCK, and OTB_CONVERT_CBUFFER_IF_BLOCK.

◆ EnlargeOutputRequestedRegion()

template<class TOutputImage , class ConvertPixelTraits >
void otb::ImageFileReader< TOutputImage, ConvertPixelTraits >::EnlargeOutputRequestedRegion ( itk::DataObject *  output)
override

Give the reader a chance to indicate that it will produce more output than it was requested to produce. ImageFileReader cannot currently read a portion of an image (since the ImageIO objects cannot read a portion of an image), so the ImageFileReader must enlarge the RequestedRegion to the size of the image on disk.

Definition at line 215 of file otbImageFileReader.hxx.

◆ GenerateData()

template<class TOutputImage , class ConvertPixelTraits >
void otb::ImageFileReader< TOutputImage, ConvertPixelTraits >::GenerateData
override

Does the real work.

Definition at line 118 of file otbImageFileReader.hxx.

References otb::mpl::GetNumberOfComponents().

◆ GenerateOutputInformation()

template<class TOutputImage , class ConvertPixelTraits >
void otb::ImageFileReader< TOutputImage, ConvertPixelTraits >::GenerateOutputInformation ( void  )
override

◆ GetDerivedDatasetSourceFileName()

template<class TOutputImage , class ConvertPixelTraits >
std::string otb::ImageFileReader< TOutputImage, ConvertPixelTraits >::GetDerivedDatasetSourceFileName ( const std::string &  filename)
static

Mapping between origin components and output components (before any conversion)

Definition at line 512 of file otbImageFileReader.hxx.

References otb::DerivedSubdatasetPrefix, and otb::DerivedSubdatasetPrefixLength.

◆ GetFileName()

template<class TOutputImage , class ConvertPixelTraits >
const char * otb::ImageFileReader< TOutputImage, ConvertPixelTraits >::GetFileName
virtual

Mapping between origin components and output components (before any conversion)

Definition at line 642 of file otbImageFileReader.hxx.

◆ GetGdalReadImageFileName()

template<class TOutputImage , class ConvertPixelTraits >
bool otb::ImageFileReader< TOutputImage, ConvertPixelTraits >::GetGdalReadImageFileName ( const std::string &  filename,
std::string &  GdalFileName 
)
private

Generate the filename (for GDALImageI for example). If filename is a directory, look if is a CEOS product (file "DAT...") In this case, the GdalFileName contain the open image file.

Definition at line 553 of file otbImageFileReader.hxx.

References otb::System::GetRootName(), and otb::System::Readdir().

◆ GetNameOfClass()

template<class TOutputImage , class ConvertPixelTraits = DefaultConvertPixelTraits<typename TOutputImage::IOPixelType>>
virtual const char* otb::ImageFileReader< TOutputImage, ConvertPixelTraits >::GetNameOfClass ( ) const
virtual

Run-time type information (and related methods).

◆ GetOverviewsCount()

template<class TOutputImage , class ConvertPixelTraits >
unsigned int otb::ImageFileReader< TOutputImage, ConvertPixelTraits >::GetOverviewsCount

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

Definition at line 648 of file otbImageFileReader.hxx.

◆ GetOverviewsInfo()

template<class TOutputImage , class ConvertPixelTraits >
std::vector< std::string > otb::ImageFileReader< TOutputImage, ConvertPixelTraits >::GetOverviewsInfo

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

Definition at line 657 of file otbImageFileReader.hxx.

◆ itkGetObjectMacro()

template<class TOutputImage , class ConvertPixelTraits = DefaultConvertPixelTraits<typename TOutputImage::IOPixelType>>
otb::ImageFileReader< TOutputImage, ConvertPixelTraits >::itkGetObjectMacro ( ImageIO  ,
otb::ImageIOBase   
)

Mapping between origin components and output components (before any conversion)

◆ New()

template<class TOutputImage , class ConvertPixelTraits = DefaultConvertPixelTraits<typename TOutputImage::IOPixelType>>
static Pointer otb::ImageFileReader< TOutputImage, ConvertPixelTraits >::New ( )
static

Method for creation through the object factory.

◆ operator=()

template<class TOutputImage , class ConvertPixelTraits = DefaultConvertPixelTraits<typename TOutputImage::IOPixelType>>
void otb::ImageFileReader< TOutputImage, ConvertPixelTraits >::operator= ( const Self )
privatedelete

Mapping between origin components and output components (before any conversion)

◆ PrintSelf()

template<class TOutputImage , class ConvertPixelTraits >
void otb::ImageFileReader< TOutputImage, ConvertPixelTraits >::PrintSelf ( std::ostream &  os,
itk::Indent  indent 
) const
overrideprotected

Mapping between origin components and output components (before any conversion)

Definition at line 84 of file otbImageFileReader.hxx.

◆ SetFileName()

template<class TOutputImage , class ConvertPixelTraits >
void otb::ImageFileReader< TOutputImage, ConvertPixelTraits >::SetFileName ( const std::string &  extendedFileName)
virtual

◆ SetImageIO()

template<class TOutputImage , class ConvertPixelTraits >
void otb::ImageFileReader< TOutputImage, ConvertPixelTraits >::SetImageIO ( otb::ImageIOBase imageIO)

Set/Get the ImageIO helper class. Often this is created via the object factory mechanism that determines whether a particular ImageIO can read a certain file. This method provides a way to get the ImageIO instance that is created. Or you can directly specify the ImageIO to use to read a particular file in case the factory mechanism will not work properly (e.g., unknown or unusual extension).

Definition at line 107 of file otbImageFileReader.hxx.

◆ TestValidImageIO()

template<class TOutputImage , class ConvertPixelTraits >
void otb::ImageFileReader< TOutputImage, ConvertPixelTraits >::TestValidImageIO
private

Test whether m_ImageIO is valid (not NULL). This is intended to be called after trying to create it via an ImageIOFactory. Throws an exception with an appropriate message otherwise.

Definition at line 531 of file otbImageFileReader.hxx.

Member Data Documentation

◆ m_ActualIORegion

template<class TOutputImage , class ConvertPixelTraits = DefaultConvertPixelTraits<typename TOutputImage::IOPixelType>>
itk::ImageIORegion otb::ImageFileReader< TOutputImage, ConvertPixelTraits >::m_ActualIORegion
private

Mapping between origin components and output components (before any conversion)

Definition at line 168 of file otbImageFileReader.h.

◆ m_AdditionalNumber

template<class TOutputImage , class ConvertPixelTraits = DefaultConvertPixelTraits<typename TOutputImage::IOPixelType>>
unsigned int otb::ImageFileReader< TOutputImage, ConvertPixelTraits >::m_AdditionalNumber
private

Mapping between origin components and output components (before any conversion)

Definition at line 172 of file otbImageFileReader.h.

◆ m_BandList

template<class TOutputImage , class ConvertPixelTraits = DefaultConvertPixelTraits<typename TOutputImage::IOPixelType>>
std::vector<unsigned int> otb::ImageFileReader< TOutputImage, ConvertPixelTraits >::m_BandList
private

Mapping between origin components and output components (before any conversion)

Definition at line 176 of file otbImageFileReader.h.

◆ m_FileName

template<class TOutputImage , class ConvertPixelTraits = DefaultConvertPixelTraits<typename TOutputImage::IOPixelType>>
std::string otb::ImageFileReader< TOutputImage, ConvertPixelTraits >::m_FileName
private

Mapping between origin components and output components (before any conversion)

Definition at line 162 of file otbImageFileReader.h.

◆ m_FilenameHelper

template<class TOutputImage , class ConvertPixelTraits = DefaultConvertPixelTraits<typename TOutputImage::IOPixelType>>
FNameHelperType::Pointer otb::ImageFileReader< TOutputImage, ConvertPixelTraits >::m_FilenameHelper
private

Mapping between origin components and output components (before any conversion)

Definition at line 170 of file otbImageFileReader.h.

◆ m_ImageIO

template<class TOutputImage , class ConvertPixelTraits = DefaultConvertPixelTraits<typename TOutputImage::IOPixelType>>
otb::ImageIOBase::Pointer otb::ImageFileReader< TOutputImage, ConvertPixelTraits >::m_ImageIO
private

Mapping between origin components and output components (before any conversion)

Definition at line 158 of file otbImageFileReader.h.

◆ m_IOComponents

template<class TOutputImage , class ConvertPixelTraits = DefaultConvertPixelTraits<typename TOutputImage::IOPixelType>>
unsigned int otb::ImageFileReader< TOutputImage, ConvertPixelTraits >::m_IOComponents
private

Store the number of components to be exported to the output image This variable can be the number of components in m_ImageIO or the number of components in the m_BandList (if used)

Definition at line 181 of file otbImageFileReader.h.

◆ m_UserSpecifiedImageIO

template<class TOutputImage , class ConvertPixelTraits = DefaultConvertPixelTraits<typename TOutputImage::IOPixelType>>
bool otb::ImageFileReader< TOutputImage, ConvertPixelTraits >::m_UserSpecifiedImageIO
private

Mapping between origin components and output components (before any conversion)

Definition at line 159 of file otbImageFileReader.h.

◆ m_UseStreaming

template<class TOutputImage , class ConvertPixelTraits = DefaultConvertPixelTraits<typename TOutputImage::IOPixelType>>
bool otb::ImageFileReader< TOutputImage, ConvertPixelTraits >::m_UseStreaming
private

Mapping between origin components and output components (before any conversion)

Definition at line 164 of file otbImageFileReader.h.


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