soma-io  5.0.5
soma::ImageReader< T > Class Template Referenceabstract

ImageReader is a low level Image reader. More...

#include <soma-io/image/imagereader.h>

Public Member Functions

 ImageReader ()
 
virtual ~ImageReader ()
 
virtual void read (T *dest, DataSourceInfo &dsi, std::vector< int > &pos, std::vector< int > &size, std::vector< long > &stride, carto::Object options=carto::none())
 Reading a region of a Image/Volume at a given resolution to a pre-allocated buffer. More...
 
virtual void updateParams (DataSourceInfo &dsi)
 Abstract : set specialized ImageReader's parameters. More...
 
virtual void resetParams ()
 Abstract : empty specialized ImageReader's parameters. More...
 
virtual ImageReader< T > * cloneReader () const =0
 
virtual std::string formatID () const =0
 Format identifier (abstract). More...
 
virtual bool open (DataSourceInfo &dsi)
 
virtual void close (DataSourceInfo &dsi)
 
virtual bool isOpen (const DataSourceInfo &dsi) const
 

Detailed Description

template<typename T>
class soma::ImageReader< T >

ImageReader is a low level Image reader.

ImageReader is a base class for readers of data of type "volume of voxels" ( 2D or 3D plus a temporal dimension ).
Format-specific readers ( GIS, Dicom, ... ) are derived from it. They may allow partial reading if implemented, or any other specific option (multiresolution, ...).

Definition at line 56 of file imagereader.h.

Constructor & Destructor Documentation

◆ ImageReader()

template<typename T >
soma::ImageReader< T >::ImageReader ( )

Definition at line 66 of file imagereader_d.h.

◆ ~ImageReader()

template<typename T >
soma::ImageReader< T >::~ImageReader ( )
virtual

Definition at line 71 of file imagereader_d.h.

Member Function Documentation

◆ cloneReader()

template<typename T >
virtual ImageReader<T>* soma::ImageReader< T >::cloneReader ( ) const
pure virtual

◆ close()

template<typename T >
void soma::ImageReader< T >::close ( DataSourceInfo dsi)
virtual

Definition at line 104 of file imagereader_d.h.

◆ formatID()

template<typename T >
virtual std::string soma::ImageReader< T >::formatID ( ) const
pure virtual

Format identifier (abstract).

Used to match checker and reader

◆ isOpen()

template<typename T >
bool soma::ImageReader< T >::isOpen ( const DataSourceInfo dsi) const
virtual

Definition at line 110 of file imagereader_d.h.

◆ open()

template<typename T >
bool soma::ImageReader< T >::open ( DataSourceInfo dsi)
virtual

Definition at line 97 of file imagereader_d.h.

◆ read()

template<typename T >
void soma::ImageReader< T >::read ( T *  dest,
DataSourceInfo dsi,
std::vector< int > &  pos,
std::vector< int > &  size,
std::vector< long > &  stride,
carto::Object  options = carto::none() 
)
virtual

Reading a region of a Image/Volume at a given resolution to a pre-allocated buffer.

Positions are expressed in 4D (x,y,z,t). If one or more of these dimensions are of no interest for the format, they take the value 0 ( position ) or 1 ( size )

Parameters
destPre-allocated buffer. Its size must be sufficient to contain the region to read.
posPosition of the first voxel of the region to read, expressed in the referential of the chosen level (if multiresolution enbaled).
sizeSize of the region to read, expressed in the referential of the chosen level (if multiresolution enbaled).
strideMay be used to specialize the reading. Indicates the number of cells to skip to read in a given direction.
optionsCommunicates info to the reader (for example, the chosen level if multiresolution is enabled)

Definition at line 83 of file imagereader_d.h.

References soma::DataSourceList::dataSource(), soma::DataSourceInfo::list(), and soma::DataSource::url().

◆ resetParams()

template<typename T >
void soma::ImageReader< T >::resetParams ( )
virtual

Abstract : empty specialized ImageReader's parameters.

Definition at line 58 of file imagereader_d.h.

◆ updateParams()

template<typename T >
void soma::ImageReader< T >::updateParams ( DataSourceInfo dsi)
virtual

Abstract : set specialized ImageReader's parameters.

Since read() may be called several times for a sole volume (for example if the data is not contiguous on memory), it is useful to initialize only once file-specific parameters (as the size of the full volume) or to open only once the file in cases where opening may be expensive.

Definition at line 53 of file imagereader_d.h.


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