Aim: Raw binary import of an Image.
More...
#include <DGtal/io/readers/RawReader.h>
template<typename TImageContainer, typename TFunctor = functors::Cast< typename TImageContainer::Value >>
struct DGtal::RawReader< TImageContainer, TFunctor >
Aim: Raw binary import of an Image.
Description of template class 'RawReader'
The import methods importRaw8
, importRaw16
and importRaw32
read raw files (little-endian format) containing unsigned integer values of, respectively, 8 bits, 16 bits and 32 bits width. The method importRaw
can read any type of values, signed integers, floating point types or even structures.
All these methods return an instance of the template parameter TImageContainer
. A functor can be specified to convert raw values to image values.
Example usage:
...
...
Aim: Parallelepidec region of a digital space, model of a 'CDomain'.
Aim: Raw binary import of an Image.
static ImageContainer importRaw8(const std::string &filename, const Vector &extent, const Functor &aFunctor=Functor())
ImageContainerBySTLVector< Domain, Value > Image
- Template Parameters
-
TImageContainer | the image container to use. |
TFunctor | the type of functor used in the import (by default set to functors::Cast< TImageContainer::Value>) . |
- See also
- RawWriter
-
testRawReader.cpp
Definition at line 93 of file RawReader.h.
◆ Functor
template<typename TImageContainer , typename TFunctor = functors::Cast< typename TImageContainer::Value >>
◆ ImageContainer
template<typename TImageContainer , typename TFunctor = functors::Cast< typename TImageContainer::Value >>
◆ Value
template<typename TImageContainer , typename TFunctor = functors::Cast< typename TImageContainer::Value >>
◆ Vector
template<typename TImageContainer , typename TFunctor = functors::Cast< typename TImageContainer::Value >>
◆ importRaw()
template<typename TImageContainer , typename TFunctor = functors::Cast< typename TImageContainer::Value >>
template<typename Word >
Method to import a Raw (any type stored in little-endian format) into an instance of the template parameter ImageContainer.
- Template Parameters
-
- Parameters
-
filename | the file name to import. |
extent | the size of the raw data set. |
aFunctor | the functor used to import and cast the source image values into the type of the image container value (by default set to functors::Cast < TImageContainer::Value > ). aFunctor must accept Word as input. |
- Returns
- an instance of the ImageContainer.
◆ importRaw16()
template<typename TImageContainer , typename TFunctor = functors::Cast< typename TImageContainer::Value >>
Method to import a Raw (unsigned 16bits little endian, uint16_t, unsigned short) into an instance of the template parameter ImageContainer.
- Parameters
-
filename | the file name to import. |
extent | the size of the raw data set. |
aFunctor | the functor used to import and cast the source image values into the type of the image container value (by default set to functors::Cast < TImageContainer::Value > ). aFunctor must accept uint16_t as input. |
- Returns
- an instance of the ImageContainer.
◆ importRaw32()
template<typename TImageContainer , typename TFunctor = functors::Cast< typename TImageContainer::Value >>
Method to import a Raw (unsigned 32bits little endian, uint32_t, unsigned int) into an instance of the template parameter ImageContainer.
- Parameters
-
filename | the file name to import. |
extent | the size of the raw data set. |
aFunctor | the functor used to import and cast the source image values into the type of the image container value (by default set to functors::Cast < TImageContainer::Value > ). aFunctor must accept uint32_t as input. |
- Returns
- an instance of the ImageContainer.
Referenced by DGtal::GenericReader< TContainer, 3, DGtal::uint32_t >::importWithValueFunctor().
◆ importRaw8()
template<typename TImageContainer , typename TFunctor = functors::Cast< typename TImageContainer::Value >>
The documentation for this struct was generated from the following file: