DGtal
1.5.beta
|
Aim: implements a model of CImageContainer using a ITK Image. More...
#include <DGtal/images/ImageContainerByITKImage.h>
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 PointVector< dimension, double > | RealPoint |
typedef RealPoint | PhysicalPoint |
typedef itk::Image< TValue, dimension > | ITKImage |
typedef itk::ImageBase< dimension >::SpacingValueType | ITKSpacingValueType |
typedef RealPoint | ImageSpacing |
typedef ITKImage::Pointer | ITKImagePointer |
typedef ITKImage::PixelContainer | Container |
typedef itk::ImageRegionConstIterator< ITKImage > | ConstIterator |
typedef itk::ImageRegionIterator< ITKImage > | Iterator |
typedef DefaultConstImageRange< Self > | ConstRange |
typedef DefaultImageRange< Self > | Range |
Static Public Attributes | |
static const Domain::Dimension | dimension = Domain::dimension |
Protected Member Functions | |
ImageContainerByITKImage () | |
Private Attributes | |
ITKImagePointer | myITKImagePointer |
Domain | myDomain |
Point | myDomainShift = Point() |
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.
Definition at line 93 of file ImageContainerByITKImage.h.
typedef itk::ImageRegionConstIterator< ITKImage > DGtal::ImageContainerByITKImage< TDomain, TValue >::ConstIterator |
Definition at line 122 of file ImageContainerByITKImage.h.
typedef DefaultConstImageRange<Self> DGtal::ImageContainerByITKImage< TDomain, TValue >::ConstRange |
Definition at line 125 of file ImageContainerByITKImage.h.
typedef ITKImage::PixelContainer DGtal::ImageContainerByITKImage< TDomain, TValue >::Container |
Definition at line 121 of file ImageContainerByITKImage.h.
typedef Domain::Dimension DGtal::ImageContainerByITKImage< TDomain, TValue >::Dimension |
Definition at line 110 of file ImageContainerByITKImage.h.
typedef TDomain DGtal::ImageContainerByITKImage< TDomain, TValue >::Domain |
Definition at line 102 of file ImageContainerByITKImage.h.
typedef RealPoint DGtal::ImageContainerByITKImage< TDomain, TValue >::ImageSpacing |
Definition at line 119 of file ImageContainerByITKImage.h.
typedef Domain::Integer DGtal::ImageContainerByITKImage< TDomain, TValue >::Integer |
Definition at line 111 of file ImageContainerByITKImage.h.
typedef itk::ImageRegionIterator< ITKImage > DGtal::ImageContainerByITKImage< TDomain, TValue >::Iterator |
Definition at line 123 of file ImageContainerByITKImage.h.
typedef itk::Image< TValue, dimension> DGtal::ImageContainerByITKImage< TDomain, TValue >::ITKImage |
Definition at line 117 of file ImageContainerByITKImage.h.
typedef ITKImage::Pointer DGtal::ImageContainerByITKImage< TDomain, TValue >::ITKImagePointer |
Definition at line 120 of file ImageContainerByITKImage.h.
typedef itk::ImageBase<dimension>::SpacingValueType DGtal::ImageContainerByITKImage< TDomain, TValue >::ITKSpacingValueType |
Definition at line 118 of file ImageContainerByITKImage.h.
typedef RealPoint DGtal::ImageContainerByITKImage< TDomain, TValue >::PhysicalPoint |
Definition at line 115 of file ImageContainerByITKImage.h.
typedef Domain::Point DGtal::ImageContainerByITKImage< TDomain, TValue >::Point |
Definition at line 108 of file ImageContainerByITKImage.h.
typedef DefaultImageRange<Self> DGtal::ImageContainerByITKImage< TDomain, TValue >::Range |
Definition at line 126 of file ImageContainerByITKImage.h.
typedef PointVector<dimension, double> DGtal::ImageContainerByITKImage< TDomain, TValue >::RealPoint |
Definition at line 114 of file ImageContainerByITKImage.h.
typedef ImageContainerByITKImage<TDomain, TValue> DGtal::ImageContainerByITKImage< TDomain, TValue >::Self |
Definition at line 103 of file ImageContainerByITKImage.h.
typedef Domain::Size DGtal::ImageContainerByITKImage< TDomain, TValue >::Size |
Definition at line 112 of file ImageContainerByITKImage.h.
typedef TValue DGtal::ImageContainerByITKImage< TDomain, TValue >::Value |
Definition at line 101 of file ImageContainerByITKImage.h.
typedef Domain::Vector DGtal::ImageContainerByITKImage< TDomain, TValue >::Vector |
Definition at line 109 of file ImageContainerByITKImage.h.
typedef Point DGtal::ImageContainerByITKImage< TDomain, TValue >::Vertex |
Definition at line 113 of file ImageContainerByITKImage.h.
DGtal::ImageContainerByITKImage< TDomain, TValue >::ImageContainerByITKImage | ( | const Domain & | aDomain | ) |
Constructor.
aDomain | the image domain. |
DGtal::ImageContainerByITKImage< TDomain, TValue >::ImageContainerByITKImage | ( | const ITKImagePointer & | aRef | ) |
Constructor.
aRef | a reference to an ITKImage |
DGtal::ImageContainerByITKImage< TDomain, TValue >::ImageContainerByITKImage | ( | const ImageContainerByITKImage< TDomain, TValue > & | other | ) |
Copy constructor
other | the object to copy. |
DGtal::ImageContainerByITKImage< TDomain, TValue >::~ImageContainerByITKImage | ( | ) |
Destructor.
|
protected |
Constructor. Forbidden by default (protected to avoid g++ warnings).
|
inline |
begin() const iterator.
Definition at line 311 of file ImageContainerByITKImage.h.
References DGtal::ImageContainerByITKImage< TDomain, TValue >::myITKImagePointer.
|
inline |
begin() const iterator.
Definition at line 299 of file ImageContainerByITKImage.h.
References DGtal::ImageContainerByITKImage< TDomain, TValue >::myITKImagePointer.
DGtal::ImageContainerByITKImage< TDomain, TValue >::BOOST_CONCEPT_ASSERT | ( | (concepts::CDomain< TDomain >) | ) |
DGtal::ImageContainerByITKImage< TDomain, TValue >::BOOST_CONCEPT_ASSERT | ( | (concepts::CLabel< TValue >) | ) |
|
inline |
Definition at line 182 of file ImageContainerByITKImage.h.
|
inline |
Give access to the underlying container.
Definition at line 208 of file ImageContainerByITKImage.h.
References DGtal::ImageContainerByITKImage< TDomain, TValue >::myITKImagePointer.
|
inline |
Give access to the underlying container.
Definition at line 200 of file ImageContainerByITKImage.h.
References DGtal::ImageContainerByITKImage< TDomain, TValue >::myITKImagePointer.
|
inline |
Definition at line 259 of file ImageContainerByITKImage.h.
References DGtal::ImageContainerByITKImage< TDomain, TValue >::myDomain.
|
inline |
end() iterator.
Definition at line 335 of file ImageContainerByITKImage.h.
References DGtal::ImageContainerByITKImage< TDomain, TValue >::myITKImagePointer.
|
inline |
end() const iterator.
Definition at line 323 of file ImageContainerByITKImage.h.
References DGtal::ImageContainerByITKImage< TDomain, TValue >::myITKImagePointer.
|
inline |
IndexPoint refers to a valid ITKImage::IndexPoint DomainPoint refers to a Point between lowerBound and upperBound of myDomain. They are different only when myDomainShift is different than Zero.
indexPoint | a point holding valid index coordinates of the ITK image. |
|
inline |
The same as getDomainPointFromItkIndex and getIndexFromDomainPoint but using ITK types.
itkIndexPoint | an IndexType of ITK. |
|
inline |
|
inline |
Definition at line 274 of file ImageContainerByITKImage.h.
References DGtal::ImageContainerByITKImage< TDomain, TValue >::myDomainShift.
|
inline |
Get the image spacing specific to the ITK Image.
|
inline |
|
inline |
Returns a copy of the itkImage smartPointer
Definition at line 268 of file ImageContainerByITKImage.h.
References DGtal::ImageContainerByITKImage< TDomain, TValue >::myITKImagePointer.
|
inline |
|
inline |
Returns the lower and upper bounds as physical points. Note that the location of pixels in ITK are in the center of the square. But in DGtal a lowerBound is in the south-west corner of that square. And an upperBound is the north-east corner of the last pixel.
|
inline |
Get PhysicalPoints from a domain point in DGtal and viceversa.
Remember that GetOrigin() in ITK is the physical location of the index {0,0...}. Not the location of the start index of the region.
domainPoint | a point holding a point in the DGtal domain. It will be converted to a valid index of the ITK image, taking into account the value of myDomainShift. |
|
inline |
bool DGtal::ImageContainerByITKImage< TDomain, TValue >::isValid | ( | ) | const |
Checks the validity/consistency of the object.
Value DGtal::ImageContainerByITKImage< TDomain, TValue >::operator() | ( | const ConstIterator & | it | ) | const |
Get the value of an image at a given position.
it | position in the image. |
Value DGtal::ImageContainerByITKImage< TDomain, TValue >::operator() | ( | const Iterator & | it | ) | const |
Get the value of an image at a given position.
it | position in the image. |
Value DGtal::ImageContainerByITKImage< TDomain, TValue >::operator() | ( | const Point & | domainPoint | ) | const |
Get the value of an image at a given position.
domainPoint | position in the image. |
ImageContainerByITKImage& DGtal::ImageContainerByITKImage< TDomain, TValue >::operator= | ( | const ImageContainerByITKImage< TDomain, TValue > & | other | ) |
Assignment.
other | the object to copy. |
|
inline |
Definition at line 191 of file ImageContainerByITKImage.h.
void DGtal::ImageContainerByITKImage< TDomain, TValue >::selfDisplay | ( | std::ostream & | out | ) | const |
Writes/Displays the object on an output stream.
out | the output stream where the object is written. |
|
inline |
Set the image spacing specific to the ITK Image.
s | an image spacing point representing the spacing values of each dimension of the space. |
void DGtal::ImageContainerByITKImage< TDomain, TValue >::setValue | ( | const Point & | domainPoint, |
const Value & | aValue | ||
) |
Set a value on an Image at domainPoint.
domainPoint | location of the point to associate with aValue. |
aValue | the value. |
void DGtal::ImageContainerByITKImage< TDomain, TValue >::setValue | ( | Iterator & | it, |
const Value & | V | ||
) |
Set a value on an Image at a given position
it | location of the point (Iterator) to associate with aValue. |
V | the value. |
void DGtal::ImageContainerByITKImage< TDomain, TValue >::updateDomain | ( | const Point & | inputDomainShift = Point() | ) |
update internal domain cache. should be called after modifying underlying ITK image or to set myDomainShift.
inputDomainShift | applies a domainShift to the lowerBound and upperBound of myDomain. |
|
static |
Definition at line 106 of file ImageContainerByITKImage.h.
|
private |
Definition at line 424 of file ImageContainerByITKImage.h.
Referenced by DGtal::ImageContainerByITKImage< TDomain, TValue >::domain().
|
private |
Apply a shift in the lower and upper bounds. Useful to represent multiple images, or images with physical information, i.e with non-default Origin (see ITK for Origin, Spacing and Direction metadata)
Set it using the function updateDomain(inputDomainShift)
Please note that this is a workaround, DGtal cannot fully work in the Physical Domain. The spacing in DGtal is fixed to 1. This allows to work to represent multiple images with different Origins, but they need to have the same Spacing and Direction for the visualization to be meaningful.
Default to zero.
When is not zero, use getIndexFromDomainPoint and getDomainPointFromIndex to switch between points in the domain and indices in the itk image.
Definition at line 442 of file ImageContainerByITKImage.h.
Referenced by DGtal::ImageContainerByITKImage< TDomain, TValue >::getDomainShift().
|
private |
Definition at line 423 of file ImageContainerByITKImage.h.
Referenced by DGtal::ImageContainerByITKImage< TDomain, TValue >::begin(), DGtal::ImageContainerByITKImage< TDomain, TValue >::container(), DGtal::ImageContainerByITKImage< TDomain, TValue >::end(), and DGtal::ImageContainerByITKImage< TDomain, TValue >::getITKImagePointer().