soma-io  5.0.5
soma::ImageWriter< T > Class Template Reference

ImageWriter is a low level Image writer. More...

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

Public Member Functions

 ImageWriter ()
 
virtual ~ImageWriter ()
 
virtual void write (const T *source, DataSourceInfo &dsi, const std::vector< int > &pos, const std::vector< int > &size, const std::vector< long > &strides, carto::Object options=carto::none())
 Reading a region of a Image/Volume at a given resolution to a pre-allocated buffer. More...
 
virtual DataSourceInfo writeHeader (DataSourceInfo &dsi, const T *source, const std::vector< int > &pos, const std::vector< int > &size, const std::vector< long > &strides, carto::Object options=carto::none())
 This function is called before the actual writing by a FormatWriter. More...
 
virtual void updateParams (DataSourceInfo &dsi)
 Abstract : set specialized ImageWriter's parameters. More...
 
virtual void resetParams ()
 Abstract : empty specialized ImageWriter's parameters. More...
 

Detailed Description

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

ImageWriter is a low level Image writer.

ImageWriter is a base class for writers of data of type "volume of voxels" ( 2D or 3D plus a temporal dimension ).
Format-specific writers ( 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 imagewriter.h.

Constructor & Destructor Documentation

◆ ImageWriter()

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

Definition at line 66 of file imagewriter_d.h.

◆ ~ImageWriter()

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

Definition at line 71 of file imagewriter_d.h.

Member Function Documentation

◆ resetParams()

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

Abstract : empty specialized ImageWriter's parameters.

Definition at line 58 of file imagewriter_d.h.

◆ updateParams()

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

Abstract : set specialized ImageWriter's parameters.

Definition at line 53 of file imagewriter_d.h.

◆ write()

template<typename T >
void soma::ImageWriter< T >::write ( const T *  source,
DataSourceInfo dsi,
const std::vector< int > &  pos,
const std::vector< int > &  size,
const std::vector< long > &  strides,
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 ( pos ) or 1 ( size )

Parameters
sourceBuffer containing the region to write. It must be of length size[0]*size[1]*size[2]*size[3]*sizeof(T). A NULL pointer is allowed here, and means that data is unallocated in memory. In such a case, the writer will write the correct amount of zero data.
posPosition of the first voxel of the region to write.
sizeSize of the region to write.
stridesOffsets between voxels in each direction.
optionsCommunicates info to the writer (for example, enabling of partial writing).

Definition at line 83 of file imagewriter_d.h.

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

◆ writeHeader()

template<typename T >
DataSourceInfo soma::ImageWriter< T >::writeHeader ( DataSourceInfo dsi,
const T *  source,
const std::vector< int > &  pos,
const std::vector< int > &  size,
const std::vector< long > &  strides,
carto::Object  options = carto::none() 
)
virtual

This function is called before the actual writing by a FormatWriter.

It builds dsi's DataSourceList and writes the header if any is needed. Image data is also passed because some formats may make use of it to build some specific header information (like scale factors).

Definition at line 96 of file imagewriter_d.h.

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


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