DGtal  0.9.4beta
Public Types | Public Member Functions | Protected Attributes
DGtal::Image< TImageContainer > Class Template Reference

#include <DGtal/images/Image.h>

Collaboration diagram for DGtal::Image< TImageContainer >:
[legend]

Public Types

typedef TImageContainer ImageContainer
 
typedef TImageContainer::Domain Domain
 
typedef TImageContainer::Point Point
 
typedef TImageContainer::Value Value
 
typedef TImageContainer::ConstRange ConstRange
 
typedef TImageContainer::Range Range
 
typedef TImageContainer::OutputIterator OutputIterator
 
typedef CowPtr< TImageContainer > ImagePointer
 

Public Member Functions

 BOOST_CONCEPT_ASSERT ((concepts::CImage< TImageContainer >))
 
 BOOST_CONCEPT_ASSERT ((concepts::CVertexMap< TImageContainer >))
 
 Image ()
 
 Image (ImageContainer *anImageContainer)
 
 Image (const CowPtr< ImageContainer > &anImageContainerCowPointer)
 
 Image (const ImageContainer &other)
 
 Image (const Image &other)
 
Imageoperator= (const Image &other)
 
 ~Image ()
 
const Domaindomain () const
 
ConstRange constRange () const
 
Range range ()
 
Value operator() (const Point &aPoint) const
 
void setValue (const Point &aPoint, const Value &aValue)
 
void selfDisplay (std::ostream &out) const
 
bool isValid () const
 
const ImagePointer getPointer () const
 

Protected Attributes

ImagePointer myImagePointer
 

Detailed Description

template<typename TImageContainer>
class DGtal::Image< TImageContainer >

Aim: implements association bewteen points lying in a digital domain and values.

Description of template class 'Image'

This class is a lightweight proxy on ImageContainers (models of CImage). Image class is also a model of CImage.

Template Parameters
TImageContaineran image container type (model of CImage).
Examples:
examples/tutorial-examples/polyhedralizer.cpp, geometry/curves/exampleGridCurve3d-2.cpp, geometry/surfaces/dvcm-3d.cpp, geometry/surfaces/greedy-plane-segmentation-ex2.cpp, geometry/surfaces/greedy-plane-segmentation.cpp, geometry/volumes/distance/distancetransform2D.cpp, geometry/volumes/distance/distancetransform3D.cpp, geometry/volumes/distance/toricdomainvolumetric.cpp, graph/volDistanceTraversal.cpp, images/exampleConstImageAdapter.cpp, images/exampleImageFactoryFromHDF5.cpp, images/exampleRigidtransformation2d.cpp, images/exampleRigidtransformation3d.cpp, images/raw2HDF5.cpp, io/digitalSetFromVol.cpp, io/display3DToOFF.cpp, shapes/viewMarchingCubes.cpp, shapes/viewPolygonalMarchingCubes.cpp, topology/3dBorderExtractionImg.cpp, topology/ctopo-2-3d.cpp, topology/ctopo-2.cpp, topology/digitalSurfaceSlice.cpp, topology/frontierAndBoundary.cpp, topology/volBreadthFirstTraversal.cpp, topology/volMarchingCubes.cpp, topology/volScanBoundary.cpp, topology/volToOFF.cpp, topology/volTrackBoundary.cpp, tutorial-examples/freemanChainFromImage.cpp, tutorial-examples/polyhedralizer.cpp, and tutorial-examples/volDTGranulo.cpp.

Definition at line 69 of file Image.h.

Member Typedef Documentation

template<typename TImageContainer >
typedef TImageContainer::ConstRange DGtal::Image< TImageContainer >::ConstRange

Definition at line 85 of file Image.h.

template<typename TImageContainer >
typedef TImageContainer::Domain DGtal::Image< TImageContainer >::Domain

Definition at line 82 of file Image.h.

template<typename TImageContainer >
typedef TImageContainer DGtal::Image< TImageContainer >::ImageContainer

Types copied from the container.

Definition at line 81 of file Image.h.

template<typename TImageContainer >
typedef CowPtr<TImageContainer> DGtal::Image< TImageContainer >::ImagePointer

Pointer to the image container data.

Definition at line 90 of file Image.h.

template<typename TImageContainer >
typedef TImageContainer::OutputIterator DGtal::Image< TImageContainer >::OutputIterator

Definition at line 87 of file Image.h.

template<typename TImageContainer >
typedef TImageContainer::Point DGtal::Image< TImageContainer >::Point

Definition at line 83 of file Image.h.

template<typename TImageContainer >
typedef TImageContainer::Range DGtal::Image< TImageContainer >::Range

Definition at line 86 of file Image.h.

template<typename TImageContainer >
typedef TImageContainer::Value DGtal::Image< TImageContainer >::Value

Definition at line 84 of file Image.h.

Constructor & Destructor Documentation

template<typename TImageContainer >
DGtal::Image< TImageContainer >::Image ( )
inline

Default constructor.

Definition at line 99 of file Image.h.

References DGtal::trace, and DGtal::Trace::warning().

99  {
100 #ifdef DEBUG_VERBOSE
101 trace.warning() << "Image Ctor default "<<std::endl;
102 #endif
103 
104  };
Trace trace
Definition: Common.h:137
std::ostream & warning()
template<typename TImageContainer >
DGtal::Image< TImageContainer >::Image ( ImageContainer anImageContainer)
inline

Constructor from a pointer on the underlying image container. (data pointer is acquired, ownership transfer)

Definition at line 110 of file Image.h.

References DGtal::trace, and DGtal::Trace::warning().

110  :
111  myImagePointer(anImageContainer)
112  {
113 #ifdef DEBUG_VERBOSE
114  trace.warning() << "Image Ctor fromPointer "<<std::endl;
115 #endif
116  }
Trace trace
Definition: Common.h:137
ImagePointer myImagePointer
Owning smart pointer on the image container.
Definition: Image.h:287
std::ostream & warning()
template<typename TImageContainer >
DGtal::Image< TImageContainer >::Image ( const CowPtr< ImageContainer > &  anImageContainerCowPointer)
inline

Constructor from Copy on write pointer. (data is not copied if read-only)

Parameters
anImageContainerCowPointera COW-pointer on the underlying container.

Definition at line 123 of file Image.h.

References DGtal::trace, and DGtal::Trace::warning().

123  :
124  myImagePointer(anImageContainerCowPointer)
125  {
126  #ifdef DEBUG_VERBOSE
127 trace.warning() << "Image Ctor fromCow "<<std::endl;
128 #endif
129  }
Trace trace
Definition: Common.h:137
ImagePointer myImagePointer
Owning smart pointer on the image container.
Definition: Image.h:287
std::ostream & warning()
template<typename TImageContainer >
DGtal::Image< TImageContainer >::Image ( const ImageContainer other)
inline

Constructor from ImageContainer const reference (data is duplicated).

Parameters
otheran object of same type to copy.

Definition at line 136 of file Image.h.

References DGtal::trace, and DGtal::Trace::warning().

136  :
137  myImagePointer(new ImageContainer(other) )
138  {
139 #ifdef DEBUG_VERBOSE
140 trace.warning() << "Image Ctor fromConstRef "<<std::endl;
141 #endif
142  }
TImageContainer ImageContainer
Types copied from the container.
Definition: Image.h:81
Trace trace
Definition: Common.h:137
ImagePointer myImagePointer
Owning smart pointer on the image container.
Definition: Image.h:287
std::ostream & warning()
template<typename TImageContainer >
DGtal::Image< TImageContainer >::Image ( const Image< TImageContainer > &  other)
inline

Copy Constructor (data is not copied here).

Parameters
otheran object of same type to copy.

Definition at line 150 of file Image.h.

References DGtal::trace, and DGtal::Trace::warning().

150  :
151  myImagePointer(other.myImagePointer )
152  {
153  #ifdef DEBUG_VERBOSE
154 trace.warning() << "Image copy Ctor "<<std::endl;
155 #endif
156  }
Trace trace
Definition: Common.h:137
ImagePointer myImagePointer
Owning smart pointer on the image container.
Definition: Image.h:287
std::ostream & warning()
template<typename TImageContainer >
DGtal::Image< TImageContainer >::~Image ( )
inline

Destructor. Does nothing, the cow pointer takes care of everything

Definition at line 180 of file Image.h.

180 {}

Member Function Documentation

template<typename TImageContainer >
DGtal::Image< TImageContainer >::BOOST_CONCEPT_ASSERT ( (concepts::CImage< TImageContainer >)  )

Checking concepts.

template<typename TImageContainer >
DGtal::Image< TImageContainer >::BOOST_CONCEPT_ASSERT ( (concepts::CVertexMap< TImageContainer >)  )
template<typename TImageContainer >
ConstRange DGtal::Image< TImageContainer >::constRange ( ) const
inline

Returns the range of the underlying image to iterate over its values

Returns
a range.

Definition at line 203 of file Image.h.

References DGtal::Image< TImageContainer >::myImagePointer.

204  {
205  return myImagePointer->constRange();
206  }
ImagePointer myImagePointer
Owning smart pointer on the image container.
Definition: Image.h:287
template<typename TImageContainer >
const Domain& DGtal::Image< TImageContainer >::domain ( ) const
inline
template<typename TImageContainer >
const ImagePointer DGtal::Image< TImageContainer >::getPointer ( ) const
inline

Returns the smart pointer on the Image container data.

Returns
a const ImagePointer.

Definition at line 276 of file Image.h.

References DGtal::Image< TImageContainer >::myImagePointer.

277  {
278  return myImagePointer;
279  }
ImagePointer myImagePointer
Owning smart pointer on the image container.
Definition: Image.h:287
template<typename TImageContainer >
bool DGtal::Image< TImageContainer >::isValid ( ) const
inline

Checks the validity/consistency of the object.

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

Definition at line 266 of file Image.h.

References DGtal::CowPtr< T >::isValid(), and DGtal::Image< TImageContainer >::myImagePointer.

267  {
268  return (myImagePointer->isValid() );
269  }
ImagePointer myImagePointer
Owning smart pointer on the image container.
Definition: Image.h:287
bool isValid() const
template<typename TImageContainer >
Value DGtal::Image< TImageContainer >::operator() ( const Point aPoint) const
inline

Get the value of an image at a given position given by a Point.

Precondition
the point must be in the domain
Parameters
aPointthe point.
Returns
the value at aPoint.

Definition at line 231 of file Image.h.

References DGtal::Image< TImageContainer >::myImagePointer.

232  {
233  return myImagePointer->operator()(aPoint);
234  }
ImagePointer myImagePointer
Owning smart pointer on the image container.
Definition: Image.h:287
template<typename TImageContainer >
Image& DGtal::Image< TImageContainer >::operator= ( const Image< TImageContainer > &  other)
inline

Assignment.

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

Definition at line 163 of file Image.h.

References DGtal::Image< TImageContainer >::myImagePointer, DGtal::trace, and DGtal::Trace::warning().

164  {
165  #ifdef DEBUG_VERBOSE
166  trace.warning() << "Image assignment "<<std::endl;
167 #endif
168  if (&other != this)
169  {
170  myImagePointer = other.myImagePointer;
171  }
172  return *this;
173  }
Trace trace
Definition: Common.h:137
ImagePointer myImagePointer
Owning smart pointer on the image container.
Definition: Image.h:287
std::ostream & warning()
template<typename TImageContainer >
Range DGtal::Image< TImageContainer >::range ( )
inline

Returns the range of the underlying image to iterate over its values

Returns
a range.

Definition at line 214 of file Image.h.

References DGtal::Image< TImageContainer >::myImagePointer.

215  {
216  return myImagePointer->range();
217  }
ImagePointer myImagePointer
Owning smart pointer on the image container.
Definition: Image.h:287
template<typename TImageContainer >
void DGtal::Image< TImageContainer >::selfDisplay ( std::ostream &  out) const

Writes/Displays the object on an output stream.

Parameters
outthe output stream where the object is written.
template<typename TImageContainer >
void DGtal::Image< TImageContainer >::setValue ( const Point aPoint,
const Value aValue 
)
inline

Set a value on an Image at a position specified by a Point.

Precondition
it must be a point in the image domain.
Parameters
aPointthe point.
aValuethe value.
Examples:
geometry/volumes/distance/distancetransform2D.cpp, geometry/volumes/distance/distancetransform3D.cpp, geometry/volumes/distance/toricdomainvolumetric.cpp, images/exampleRigidtransformation2d.cpp, images/exampleRigidtransformation3d.cpp, and topology/frontierAndBoundary.cpp.

Definition at line 247 of file Image.h.

References DGtal::Image< TImageContainer >::myImagePointer.

248  {
249  myImagePointer->setValue(aPoint,aValue);
250  }
ImagePointer myImagePointer
Owning smart pointer on the image container.
Definition: Image.h:287

Field Documentation

template<typename TImageContainer >
ImagePointer DGtal::Image< TImageContainer >::myImagePointer
protected

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