DGtal  1.0.0
Public Types | Public Member Functions | Static Public Attributes | Protected Member Functions | Private Attributes
DGtal::ImageContainerByITKImage< TDomain, TValue > Class Template Reference

Aim: implements a model of CImageContainer using a ITK Image. More...

#include <DGtal/images/ImageContainerByITKImage.h>

Collaboration diagram for DGtal::ImageContainerByITKImage< TDomain, TValue >:
[legend]

Public Types

typedef TValue Value
 
typedef TDomain Domain
 
typedef ImageContainerByITKImage< TDomain, TValue > Self
 
typedef Domain::Point Point
 
typedef Domain::Vector Vector
 
typedef Domain::Dimension Dimension
 
typedef Domain::Integer Integer
 
typedef Domain::Size Size
 
typedef Point Vertex
 
typedef itk::Image< TValue, dimensionITKImage
 
typedef ITKImage::Pointer ITKImagePointer
 
typedef itk::ImageRegionConstIterator< ITKImageConstIterator
 
typedef itk::ImageRegionIterator< ITKImageIterator
 
typedef DefaultConstImageRange< SelfConstRange
 
typedef DefaultImageRange< SelfRange
 

Public Member Functions

 BOOST_CONCEPT_ASSERT ((concepts::CLabel< TValue >))
 
 BOOST_CONCEPT_ASSERT ((concepts::CDomain< TDomain >))
 
 ImageContainerByITKImage (const Domain &aDomain)
 
 ImageContainerByITKImage (const ITKImagePointer &aRef)
 
 ImageContainerByITKImage (const ImageContainerByITKImage &other)
 
ImageContainerByITKImageoperator= (const ImageContainerByITKImage &other)
 
 ~ImageContainerByITKImage ()
 
void updateDomain ()
 
ConstRange constRange () const
 
Range range ()
 
Value operator() (const Point &aPoint) const
 
Value operator() (const ConstIterator &it) const
 
Value operator() (const Iterator &it) const
 
void setValue (const Point &aPoint, const Value &aValue)
 
void setValue (Iterator &it, const Value &V)
 
const Domaindomain () const
 
ITKImagePointer getITKImagePointer () const
 
void selfDisplay (std::ostream &out) const
 
bool isValid () const
 
ConstIterator begin () const
 
Iterator begin ()
 
const ConstIterator end () const
 
Iterator end ()
 

Static Public Attributes

static const Domain::Dimension dimension = Domain::dimension
 

Protected Member Functions

 ImageContainerByITKImage ()
 

Private Attributes

ITKImagePointer myITKImagePointer
 
Domain myDomain
 

Detailed Description

template<typename TDomain, typename TValue>
class DGtal::ImageContainerByITKImage< TDomain, TValue >

Aim: implements a model of CImageContainer using a ITK Image.

Description of template class 'ImageContainerByITKImage'

Using this container, you can switch from DGtal alogrithms to ITK processing pipeline. The Ownership of the underlying ITK image is shared between the wrapper and the ITK pipeline. If the ITK image region is modified, one should manually update the domain of the wrapper. This is done by calling the updateDomain() method.

See also
testITKImage.cpp

Definition at line 91 of file ImageContainerByITKImage.h.

Member Typedef Documentation

◆ ConstIterator

template<typename TDomain, typename TValue>
typedef itk::ImageRegionConstIterator< ITKImage > DGtal::ImageContainerByITKImage< TDomain, TValue >::ConstIterator

Definition at line 115 of file ImageContainerByITKImage.h.

◆ ConstRange

template<typename TDomain, typename TValue>
typedef DefaultConstImageRange<Self> DGtal::ImageContainerByITKImage< TDomain, TValue >::ConstRange

Definition at line 118 of file ImageContainerByITKImage.h.

◆ Dimension

template<typename TDomain, typename TValue>
typedef Domain::Dimension DGtal::ImageContainerByITKImage< TDomain, TValue >::Dimension

Definition at line 108 of file ImageContainerByITKImage.h.

◆ Domain

template<typename TDomain, typename TValue>
typedef TDomain DGtal::ImageContainerByITKImage< TDomain, TValue >::Domain

Definition at line 100 of file ImageContainerByITKImage.h.

◆ Integer

template<typename TDomain, typename TValue>
typedef Domain::Integer DGtal::ImageContainerByITKImage< TDomain, TValue >::Integer

Definition at line 109 of file ImageContainerByITKImage.h.

◆ Iterator

template<typename TDomain, typename TValue>
typedef itk::ImageRegionIterator< ITKImage > DGtal::ImageContainerByITKImage< TDomain, TValue >::Iterator

Definition at line 116 of file ImageContainerByITKImage.h.

◆ ITKImage

template<typename TDomain, typename TValue>
typedef itk::Image< TValue, dimension> DGtal::ImageContainerByITKImage< TDomain, TValue >::ITKImage

Definition at line 113 of file ImageContainerByITKImage.h.

◆ ITKImagePointer

template<typename TDomain, typename TValue>
typedef ITKImage::Pointer DGtal::ImageContainerByITKImage< TDomain, TValue >::ITKImagePointer

Definition at line 114 of file ImageContainerByITKImage.h.

◆ Point

template<typename TDomain, typename TValue>
typedef Domain::Point DGtal::ImageContainerByITKImage< TDomain, TValue >::Point

Definition at line 106 of file ImageContainerByITKImage.h.

◆ Range

template<typename TDomain, typename TValue>
typedef DefaultImageRange<Self> DGtal::ImageContainerByITKImage< TDomain, TValue >::Range

Definition at line 119 of file ImageContainerByITKImage.h.

◆ Self

template<typename TDomain, typename TValue>
typedef ImageContainerByITKImage<TDomain, TValue> DGtal::ImageContainerByITKImage< TDomain, TValue >::Self

Definition at line 101 of file ImageContainerByITKImage.h.

◆ Size

template<typename TDomain, typename TValue>
typedef Domain::Size DGtal::ImageContainerByITKImage< TDomain, TValue >::Size

Definition at line 110 of file ImageContainerByITKImage.h.

◆ Value

template<typename TDomain, typename TValue>
typedef TValue DGtal::ImageContainerByITKImage< TDomain, TValue >::Value

Definition at line 99 of file ImageContainerByITKImage.h.

◆ Vector

template<typename TDomain, typename TValue>
typedef Domain::Vector DGtal::ImageContainerByITKImage< TDomain, TValue >::Vector

Definition at line 107 of file ImageContainerByITKImage.h.

◆ Vertex

template<typename TDomain, typename TValue>
typedef Point DGtal::ImageContainerByITKImage< TDomain, TValue >::Vertex

Definition at line 111 of file ImageContainerByITKImage.h.

Constructor & Destructor Documentation

◆ ImageContainerByITKImage() [1/4]

template<typename TDomain, typename TValue>
DGtal::ImageContainerByITKImage< TDomain, TValue >::ImageContainerByITKImage ( const Domain aDomain)

Constructor.

Parameters
aDomainthe image domain.

◆ ImageContainerByITKImage() [2/4]

template<typename TDomain, typename TValue>
DGtal::ImageContainerByITKImage< TDomain, TValue >::ImageContainerByITKImage ( const ITKImagePointer aRef)

Constructor.

Parameters
aRefa reference to an ITKImage

◆ ImageContainerByITKImage() [3/4]

template<typename TDomain, typename TValue>
DGtal::ImageContainerByITKImage< TDomain, TValue >::ImageContainerByITKImage ( const ImageContainerByITKImage< TDomain, TValue > &  other)

Copy constructor

Parameters
otherthe object to copy.

◆ ~ImageContainerByITKImage()

template<typename TDomain, typename TValue>
DGtal::ImageContainerByITKImage< TDomain, TValue >::~ImageContainerByITKImage ( )

Destructor.

◆ ImageContainerByITKImage() [4/4]

template<typename TDomain, typename TValue>
DGtal::ImageContainerByITKImage< TDomain, TValue >::ImageContainerByITKImage ( )
protected

Constructor. Forbidden by default (protected to avoid g++ warnings).

Member Function Documentation

◆ begin() [1/2]

template<typename TDomain, typename TValue>
ConstIterator DGtal::ImageContainerByITKImage< TDomain, TValue >::begin ( ) const
inline

begin() const iterator.

Definition at line 265 of file ImageContainerByITKImage.h.

266  {
267  ConstIterator iter = ConstIterator(myITKImagePointer, myITKImagePointer->GetLargestPossibleRegion());
268  iter.GoToBegin();
269  return iter;
270  }
MyDigitalSurface::ConstIterator ConstIterator
itk::ImageRegionConstIterator< ITKImage > ConstIterator

References DGtal::ImageContainerByITKImage< TDomain, TValue >::myITKImagePointer.

◆ begin() [2/2]

template<typename TDomain, typename TValue>
Iterator DGtal::ImageContainerByITKImage< TDomain, TValue >::begin ( )
inline

begin() const iterator.

Definition at line 277 of file ImageContainerByITKImage.h.

278  {
279  Iterator iter = Iterator(myITKImagePointer, myITKImagePointer->GetLargestPossibleRegion());
280  iter.GoToBegin();
281  return iter;
282  }
itk::ImageRegionIterator< ITKImage > Iterator

References DGtal::ImageContainerByITKImage< TDomain, TValue >::myITKImagePointer.

◆ BOOST_CONCEPT_ASSERT() [1/2]

template<typename TDomain, typename TValue>
DGtal::ImageContainerByITKImage< TDomain, TValue >::BOOST_CONCEPT_ASSERT ( (concepts::CLabel< TValue >)  )

◆ BOOST_CONCEPT_ASSERT() [2/2]

template<typename TDomain, typename TValue>
DGtal::ImageContainerByITKImage< TDomain, TValue >::BOOST_CONCEPT_ASSERT ( (concepts::CDomain< TDomain >)  )

◆ constRange()

template<typename TDomain, typename TValue>
ConstRange DGtal::ImageContainerByITKImage< TDomain, TValue >::constRange ( ) const
inline
Returns
the range providing begin and end iterators to scan the values of image.

Definition at line 171 of file ImageContainerByITKImage.h.

172  {
173  return ConstRange(*this);
174  }
DefaultConstImageRange< Self > ConstRange

◆ domain()

template<typename TDomain, typename TValue>
const Domain& DGtal::ImageContainerByITKImage< TDomain, TValue >::domain ( ) const
inline
Returns
the domain associated to the image.

Definition at line 231 of file ImageContainerByITKImage.h.

232  {
233  return myDomain;
234  }

References DGtal::ImageContainerByITKImage< TDomain, TValue >::myDomain.

◆ end() [1/2]

template<typename TDomain, typename TValue>
const ConstIterator DGtal::ImageContainerByITKImage< TDomain, TValue >::end ( ) const
inline

end() const iterator.

Definition at line 289 of file ImageContainerByITKImage.h.

290  {
291  ConstIterator iter = ConstIterator(myITKImagePointer, myITKImagePointer->GetLargestPossibleRegion());
292  iter.GoToEnd();
293  return iter;
294  }
MyDigitalSurface::ConstIterator ConstIterator
itk::ImageRegionConstIterator< ITKImage > ConstIterator

References DGtal::ImageContainerByITKImage< TDomain, TValue >::myITKImagePointer.

◆ end() [2/2]

template<typename TDomain, typename TValue>
Iterator DGtal::ImageContainerByITKImage< TDomain, TValue >::end ( )
inline

end() iterator.

Definition at line 301 of file ImageContainerByITKImage.h.

302  {
303  Iterator iter = Iterator(myITKImagePointer, myITKImagePointer->GetLargestPossibleRegion());
304  iter.GoToEnd();
305  return iter;
306  }
itk::ImageRegionIterator< ITKImage > Iterator

References DGtal::ImageContainerByITKImage< TDomain, TValue >::myITKImagePointer.

◆ getITKImagePointer()

template<typename TDomain, typename TValue>
ITKImagePointer DGtal::ImageContainerByITKImage< TDomain, TValue >::getITKImagePointer ( ) const
inline

Returns a copy of the itkImage smartPointer

Definition at line 240 of file ImageContainerByITKImage.h.

241  {
242  return myITKImagePointer;
243  }

References DGtal::ImageContainerByITKImage< TDomain, TValue >::myITKImagePointer.

◆ isValid()

template<typename TDomain, typename TValue>
bool DGtal::ImageContainerByITKImage< TDomain, TValue >::isValid ( ) const

Checks the validity/consistency of the object.

Returns
'true' if the object is valid, 'false' otherwise.

◆ operator()() [1/3]

template<typename TDomain, typename TValue>
Value DGtal::ImageContainerByITKImage< TDomain, TValue >::operator() ( const Point aPoint) const

Get the value of an image at a given position.

Parameters
aPointposition in the image.
Returns
the value at aPoint.

◆ operator()() [2/3]

template<typename TDomain, typename TValue>
Value DGtal::ImageContainerByITKImage< TDomain, TValue >::operator() ( const ConstIterator it) const

Get the value of an image at a given position.

Parameters
itposition in the image.
Returns
the value at aPoint.

◆ operator()() [3/3]

template<typename TDomain, typename TValue>
Value DGtal::ImageContainerByITKImage< TDomain, TValue >::operator() ( const Iterator it) const

Get the value of an image at a given position.

Parameters
itposition in the image.
Returns
the value at aPoint.

◆ operator=()

template<typename TDomain, typename TValue>
ImageContainerByITKImage& DGtal::ImageContainerByITKImage< TDomain, TValue >::operator= ( const ImageContainerByITKImage< TDomain, TValue > &  other)

Assignment.

Parameters
otherthe object to copy.
Returns
a reference on 'this'.

◆ range()

template<typename TDomain, typename TValue>
Range DGtal::ImageContainerByITKImage< TDomain, TValue >::range ( )
inline
Returns
the range providing begin and end iterators to scan the values of image.

Definition at line 180 of file ImageContainerByITKImage.h.

181  {
182  return Range(*this);
183  }

◆ selfDisplay()

template<typename TDomain, typename TValue>
void DGtal::ImageContainerByITKImage< TDomain, TValue >::selfDisplay ( std::ostream &  out) const

Writes/Displays the object on an output stream.

Parameters
outthe output stream where the object is written.

◆ setValue() [1/2]

template<typename TDomain, typename TValue>
void DGtal::ImageContainerByITKImage< TDomain, TValue >::setValue ( const Point aPoint,
const Value aValue 
)

Set a value on an Image at aPoint.

Parameters
aPointlocation of the point to associate with aValue.
aValuethe value.

◆ setValue() [2/2]

template<typename TDomain, typename TValue>
void DGtal::ImageContainerByITKImage< TDomain, TValue >::setValue ( Iterator it,
const Value V 
)

Set a value on an Image at aPoint.

Parameters
itlocation of the point (Iterator) to associate with aValue.
Vthe value.

◆ updateDomain()

template<typename TDomain, typename TValue>
void DGtal::ImageContainerByITKImage< TDomain, TValue >::updateDomain ( )

update internal domain cache. should be called after modifying underlying ITK image.

Field Documentation

◆ dimension

template<typename TDomain, typename TValue>
const Domain::Dimension DGtal::ImageContainerByITKImage< TDomain, TValue >::dimension = Domain::dimension
static

Definition at line 104 of file ImageContainerByITKImage.h.

◆ myDomain

template<typename TDomain, typename TValue>
Domain DGtal::ImageContainerByITKImage< TDomain, TValue >::myDomain
private

◆ myITKImagePointer

template<typename TDomain, typename TValue>
ITKImagePointer DGtal::ImageContainerByITKImage< TDomain, TValue >::myITKImagePointer
private

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