aimstil  5.0.5
til::ImageC< T > Class Template Reference

Image class using contiguous memory. More...

#include <til/ConstImageLinearIterator.h>

Inheritance diagram for til::ImageC< T >:
Collaboration diagram for til::ImageC< T >:

Public Types

typedef ImageC< T > Self
 
typedef T value_type
 

Public Member Functions

 ImageC ()
 
 ImageC (const numeric_array< int, 3 > &dim, const numeric_array< t_voxsize, 3 > &vdim)
 
 ImageC (const ImageParameter &param)
 
 ImageC (T *data, const numeric_array< int, 3 > &dim, const numeric_array< t_voxsize, 3 > &vdim)
 
 ImageC (const Self &im)
 Shallow copy. More...
 
 ~ImageC ()
 Destructor. More...
 
void init (T *data, const numeric_array< int, 3 > &dim, const numeric_array< t_voxsize, 3 > &vdim)
 
void init (const numeric_array< int, 3 > &dim, const numeric_array< t_voxsize, 3 > &vdim)
 
void init (const Self &im)
 
void init (const ImageParameter &param)
 
T & operator() (const numeric_array< int, 3 > &p)
 
const T & operator() (const numeric_array< int, 3 > &p) const
 
void setValue (const T &v, const numeric_array< int, 3 > &p)
 
getUnsafeValue (const numeric_array< int, 3 > &p) const
 
T * getPointer ()
 
const T * getPointer () const
 
bool isAllocated () const
 Check whether data has been allocated or not. More...
 
void myreset ()
 
void reset ()
 Set all values to default value (0 for numerical types) More...
 
void copy (const Self &im)
 Copy an image. More...
 
void shallowCopy (const Self &im)
 Shallow copy of an image. More...
 
bool operator!= (const Self &im) const
 Check whether images point on the same buffer. More...
 
bool operator== (const Self &im) const
 Check whether images point on the same buffer. More...
 
- Public Member Functions inherited from til::ImageBase
const numeric_array< int, 3 > & dim () const
 get image dimension More...
 
int size () const
 Get total number of elements in image. More...
 
const numeric_array< t_voxsize, 3 > & vdim () const
 get voxel size More...
 
void set_vdim (const numeric_array< t_voxsize, 3 > &vdim)
 Set the voxel coordinates. More...
 

Friends

class ConstVolumetricIterator< Self >
 

Additional Inherited Members

- Protected Member Functions inherited from til::ImageBase
void set_dim (const numeric_array< int, 3 > &dim)
 
bool contains (const numeric_array< int, 3 > &p) const
 

Detailed Description

template<typename T>
class til::ImageC< T >

Image class using contiguous memory.

Definition at line 13 of file ConstImageLinearIterator.h.

Member Typedef Documentation

◆ Self

template<typename T>
typedef ImageC<T> til::ImageC< T >::Self

Definition at line 45 of file ImageC.h.

◆ value_type

template<typename T>
typedef T til::ImageC< T >::value_type

Definition at line 46 of file ImageC.h.

Constructor & Destructor Documentation

◆ ImageC() [1/5]

template<typename T >
til::ImageC< T >::ImageC ( )

Definition at line 275 of file ImageC.h.

◆ ImageC() [2/5]

template<typename T >
til::ImageC< T >::ImageC ( const numeric_array< int, 3 > &  dim,
const numeric_array< t_voxsize, 3 > &  vdim 
)

Definition at line 315 of file ImageC.h.

◆ ImageC() [3/5]

template<typename T >
til::ImageC< T >::ImageC ( const ImageParameter param)

Definition at line 322 of file ImageC.h.

◆ ImageC() [4/5]

template<typename T >
til::ImageC< T >::ImageC ( T *  data,
const numeric_array< int, 3 > &  dim,
const numeric_array< t_voxsize, 3 > &  vdim 
)

Definition at line 337 of file ImageC.h.

◆ ImageC() [5/5]

template<typename T>
til::ImageC< T >::ImageC ( const Self im)
inline

◆ ~ImageC()

template<typename T >
til::ImageC< T >::~ImageC ( )

Destructor.

Definition at line 377 of file ImageC.h.

Referenced by til::ImageC< T >::ImageC().

Member Function Documentation

◆ copy()

template<typename T >
void til::ImageC< T >::copy ( const Self im)

Copy an image.

NB: it is put here, rather than in a separate function, for optimization reasons, that cannot be templated. Using memcopy is (supposedly) much faster than any iterator. But of course the use of memcopy depends on the implementation of the class. Also, there is intentionally no copy constructor or operator= in order that copy is always explicit.

Definition at line 436 of file ImageC.h.

References til::ImageBase::dim(), til::ImageC< T >::getPointer(), til::isAllocated(), til::ImageC< T >::isAllocated(), and til::ImageBase::vdim().

Referenced by til::ImageC< T >::myreset().

◆ getPointer() [1/2]

template<typename T>
T* til::ImageC< T >::getPointer ( )
inline

◆ getPointer() [2/2]

template<typename T>
const T* til::ImageC< T >::getPointer ( ) const
inline

Definition at line 127 of file ImageC.h.

◆ getUnsafeValue()

template<typename T>
T til::ImageC< T >::getUnsafeValue ( const numeric_array< int, 3 > &  p) const
inline

Definition at line 118 of file ImageC.h.

◆ init() [1/4]

template<typename T >
void til::ImageC< T >::init ( T *  data,
const numeric_array< int, 3 > &  dim,
const numeric_array< t_voxsize, 3 > &  vdim 
)

Definition at line 345 of file ImageC.h.

References til::ImageBase::set_dim(), and til::ImageBase::set_vdim().

Referenced by til::ImageC< T >::ImageC().

◆ init() [2/4]

template<typename T >
void til::ImageC< T >::init ( const numeric_array< int, 3 > &  dim,
const numeric_array< t_voxsize, 3 > &  vdim 
)

Definition at line 302 of file ImageC.h.

References til::ImageC< T >::reset().

◆ init() [3/4]

template<typename T>
void til::ImageC< T >::init ( const Self im)

◆ init() [4/4]

template<typename T >
void til::ImageC< T >::init ( const ImageParameter param)

Definition at line 329 of file ImageC.h.

References til::ImageParameter::m_dim, and til::ImageParameter::m_vDim.

◆ isAllocated()

template<typename T>
bool til::ImageC< T >::isAllocated ( ) const
inline

Check whether data has been allocated or not.

Definition at line 134 of file ImageC.h.

Referenced by til::ImageC< T >::copy().

◆ myreset()

template<typename T>
void til::ImageC< T >::myreset ( )
inline

Definition at line 137 of file ImageC.h.

References til::ImageC< T >::copy(), and til::ImageC< T >::reset().

◆ operator!=()

template<typename T>
bool til::ImageC< T >::operator!= ( const Self im) const
inline

Check whether images point on the same buffer.

Definition at line 169 of file ImageC.h.

◆ operator()() [1/2]

template<typename T>
T& til::ImageC< T >::operator() ( const numeric_array< int, 3 > &  p)
inline

Definition at line 103 of file ImageC.h.

◆ operator()() [2/2]

template<typename T>
const T& til::ImageC< T >::operator() ( const numeric_array< int, 3 > &  p) const
inline

Definition at line 104 of file ImageC.h.

◆ operator==()

template<typename T>
bool til::ImageC< T >::operator== ( const Self im) const
inline

Check whether images point on the same buffer.

Definition at line 174 of file ImageC.h.

◆ reset()

template<typename T >
void til::ImageC< T >::reset ( )

Set all values to default value (0 for numerical types)

Definition at line 386 of file ImageC.h.

References til::ImageC< T >::getPointer(), and til::ImageBase::size().

Referenced by til::ImageC< T >::init(), and til::ImageC< T >::myreset().

◆ setValue()

template<typename T>
void til::ImageC< T >::setValue ( const T &  v,
const numeric_array< int, 3 > &  p 
)
inline

Definition at line 108 of file ImageC.h.

◆ shallowCopy()

template<typename T>
void til::ImageC< T >::shallowCopy ( const Self im)
inline

Shallow copy of an image.

A shallow copy does not duplicate the buffer: it points to the same buffer as the original image

Definition at line 159 of file ImageC.h.

References til::param().

Referenced by til::ImageC< T >::ImageC().

Friends And Related Function Documentation

◆ ConstVolumetricIterator< Self >

template<typename T>
friend class ConstVolumetricIterator< Self >
friend

Definition at line 182 of file ImageC.h.


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