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

#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 90 of file ImageContainerByITKImage.h.

Member Typedef Documentation

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

Definition at line 114 of file ImageContainerByITKImage.h.

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

Definition at line 117 of file ImageContainerByITKImage.h.

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

Definition at line 107 of file ImageContainerByITKImage.h.

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

Definition at line 99 of file ImageContainerByITKImage.h.

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

Definition at line 108 of file ImageContainerByITKImage.h.

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

Definition at line 115 of file ImageContainerByITKImage.h.

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

Definition at line 112 of file ImageContainerByITKImage.h.

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

Definition at line 113 of file ImageContainerByITKImage.h.

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

Definition at line 105 of file ImageContainerByITKImage.h.

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

Definition at line 118 of file ImageContainerByITKImage.h.

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

Definition at line 100 of file ImageContainerByITKImage.h.

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

Definition at line 109 of file ImageContainerByITKImage.h.

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

Definition at line 98 of file ImageContainerByITKImage.h.

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

Definition at line 106 of file ImageContainerByITKImage.h.

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

Definition at line 110 of file ImageContainerByITKImage.h.

Constructor & Destructor Documentation

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

Constructor.

Parameters
aDomainthe image domain.
template<typename TDomain , typename TValue >
DGtal::ImageContainerByITKImage< TDomain, TValue >::ImageContainerByITKImage ( const ITKImagePointer aRef)

Constructor.

Parameters
aRefa reference to an ITKImage
template<typename TDomain , typename TValue >
DGtal::ImageContainerByITKImage< TDomain, TValue >::ImageContainerByITKImage ( const ImageContainerByITKImage< TDomain, TValue > &  other)

Copy constructor

Parameters
otherthe object to copy.
template<typename TDomain , typename TValue >
DGtal::ImageContainerByITKImage< TDomain, TValue >::~ImageContainerByITKImage ( )

Destructor.

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

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

Member Function Documentation

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

begin() const iterator.

Definition at line 264 of file ImageContainerByITKImage.h.

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

265  {
266  ConstIterator iter = ConstIterator(myITKImagePointer, myITKImagePointer->GetLargestPossibleRegion());
267  iter.GoToBegin();
268  return iter;
269  }
itk::ImageRegionConstIterator< ITKImage > ConstIterator
template<typename TDomain , typename TValue >
Iterator DGtal::ImageContainerByITKImage< TDomain, TValue >::begin ( )
inline

begin() const iterator.

Definition at line 276 of file ImageContainerByITKImage.h.

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

277  {
278  Iterator iter = Iterator(myITKImagePointer, myITKImagePointer->GetLargestPossibleRegion());
279  iter.GoToBegin();
280  return iter;
281  }
itk::ImageRegionIterator< ITKImage > Iterator
template<typename TDomain , typename TValue >
DGtal::ImageContainerByITKImage< TDomain, TValue >::BOOST_CONCEPT_ASSERT ( (concepts::CLabel< TValue >)  )
template<typename TDomain , typename TValue >
DGtal::ImageContainerByITKImage< TDomain, TValue >::BOOST_CONCEPT_ASSERT ( (concepts::CDomain< TDomain >)  )
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 170 of file ImageContainerByITKImage.h.

171  {
172  return ConstRange(*this);
173  }
DefaultConstImageRange< Self > ConstRange
template<typename TDomain , typename TValue >
const Domain& DGtal::ImageContainerByITKImage< TDomain, TValue >::domain ( ) const
inline
Returns
the domain associated to the image.

Definition at line 230 of file ImageContainerByITKImage.h.

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

231  {
232  return myDomain;
233  }
template<typename TDomain , typename TValue >
const ConstIterator DGtal::ImageContainerByITKImage< TDomain, TValue >::end ( ) const
inline

end() const iterator.

Definition at line 288 of file ImageContainerByITKImage.h.

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

289  {
290  ConstIterator iter = ConstIterator(myITKImagePointer, myITKImagePointer->GetLargestPossibleRegion());
291  iter.GoToEnd();
292  return iter;
293  }
itk::ImageRegionConstIterator< ITKImage > ConstIterator
template<typename TDomain , typename TValue >
Iterator DGtal::ImageContainerByITKImage< TDomain, TValue >::end ( )
inline

end() iterator.

Definition at line 300 of file ImageContainerByITKImage.h.

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

301  {
302  Iterator iter = Iterator(myITKImagePointer, myITKImagePointer->GetLargestPossibleRegion());
303  iter.GoToEnd();
304  return iter;
305  }
itk::ImageRegionIterator< ITKImage > Iterator
template<typename TDomain , typename TValue >
ITKImagePointer DGtal::ImageContainerByITKImage< TDomain, TValue >::getITKImagePointer ( ) const
inline

Returns a copy of the itkImage smartPointer

Definition at line 239 of file ImageContainerByITKImage.h.

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

240  {
241  return myITKImagePointer;
242  }
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.
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.
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.
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.
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'.
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 179 of file ImageContainerByITKImage.h.

180  {
181  return Range(*this);
182  }
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.
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.
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.
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

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

Definition at line 103 of file ImageContainerByITKImage.h.

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

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