File failed to load: https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.3/config/TeX-MML-AM_CHTML/MathJax.js
DGtal 2.0.0
DGtal::Image< TImageContainer > Class Template Reference

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

#include <DGtal/images/Image.h>

Public Types

typedef TImageContainer ImageContainer
 Types copied from the container.
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< TImageContainerImagePointer
 Pointer to the image container data.

Public Member Functions

 BOOST_CONCEPT_ASSERT ((concepts::CImage< TImageContainer >))
 Checking concepts.
 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
 Owning smart pointer on the image container.

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).

Definition at line 69 of file Image.h.

Member Typedef Documentation

◆ ConstRange

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

Definition at line 85 of file Image.h.

◆ Domain

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

Definition at line 82 of file Image.h.

◆ ImageContainer

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

Types copied from the container.

Definition at line 81 of file Image.h.

◆ ImagePointer

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

Pointer to the image container data.

Definition at line 90 of file Image.h.

◆ OutputIterator

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

Definition at line 87 of file Image.h.

◆ Point

Definition at line 83 of file Image.h.

◆ Range

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

Definition at line 86 of file Image.h.

◆ Value

Definition at line 84 of file Image.h.

Constructor & Destructor Documentation

◆ Image() [1/5]

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

Default constructor.

Definition at line 99 of file Image.h.

99 {
100#ifdef DEBUG_VERBOSE
101trace.warning() << "Image Ctor default "<<std::endl;
102#endif
103
104 };
Aim: implements association bewteen points lying in a digital domain and values.
Definition Image.h:70

References DGtal::trace.

Referenced by Image(), and operator=().

◆ Image() [2/5]

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.

110 :
112 {
113#ifdef DEBUG_VERBOSE
114 trace.warning() << "Image Ctor fromPointer "<<std::endl;
115#endif
116 }
ImagePointer myImagePointer
Owning smart pointer on the image container.
Definition Image.h:287

References myImagePointer, and DGtal::trace.

◆ Image() [3/5]

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.

123 :
125 {
126 #ifdef DEBUG_VERBOSE
127trace.warning() << "Image Ctor fromCow "<<std::endl;
128#endif
129 }

References myImagePointer, and DGtal::trace.

◆ Image() [4/5]

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.

136 :
138 {
139#ifdef DEBUG_VERBOSE
140trace.warning() << "Image Ctor fromConstRef "<<std::endl;
141#endif
142 }
TImageContainer ImageContainer
Types copied from the container.
Definition Image.h:81

References myImagePointer, and DGtal::trace.

◆ Image() [5/5]

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.

150 :
152 {
153 #ifdef DEBUG_VERBOSE
154trace.warning() << "Image copy Ctor "<<std::endl;
155#endif
156 }

References Image(), myImagePointer, and DGtal::trace.

◆ ~Image()

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

◆ BOOST_CONCEPT_ASSERT() [1/2]

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

Checking concepts.

◆ BOOST_CONCEPT_ASSERT() [2/2]

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

◆ constRange()

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.
Examples
tutorial-examples/volDTGranulo.cpp.

Definition at line 203 of file Image.h.

204 {
205 return myImagePointer->constRange();
206 }
ConstRange constRange() const
Definition Image.h:203

References myImagePointer.

Referenced by main(), test_image(), testImage(), and testImageFromSet().

◆ domain()

template<typename TImageContainer>
const Domain & DGtal::Image< TImageContainer >::domain ( ) const
inline

Returns a reference to the underlying image domain.

Returns
a reference to the domain.
Examples
tutorial-examples/volDTGranulo.cpp.

Definition at line 192 of file Image.h.

193 {
194 return myImagePointer->domain();
195 }
const Domain & domain() const
Definition Image.h:192

References myImagePointer.

Referenced by DGtal::SetFromImage< TSet >::append(), checkImage(), checkVoronoi(), generateRefImage(), main(), main(), randomSeeds(), test_image(), testConsistence(), testImage(), testImageOnRef(), testITKImageWithShiftDomain(), and testPNMReader().

◆ getPointer()

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.

277 {
278 return myImagePointer;
279 }

References myImagePointer.

◆ isValid()

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.

267 {
268 return (myImagePointer->isValid() );
269 }
bool isValid() const
Definition Image.h:266

References myImagePointer.

Referenced by TEST_CASE(), and testImage().

◆ operator()()

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.

232 {
233 return myImagePointer->operator()(aPoint);
234 }

References aPoint, and myImagePointer.

◆ operator=()

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.

164 {
165 #ifdef DEBUG_VERBOSE
166 trace.warning() << "Image assignment "<<std::endl;
167#endif
168 if (&other != this)
169 {
171 }
172 return *this;
173 }

References Image(), myImagePointer, and DGtal::trace.

◆ range()

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

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

Returns
a range.
Examples
tutorial-examples/volDTGranulo.cpp.

Definition at line 214 of file Image.h.

215 {
216 return myImagePointer->range();
217 }
Range range()
Definition Image.h:214

References myImagePointer.

Referenced by main(), and testImage().

◆ selfDisplay()

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.

◆ setValue()

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
images/exampleRigidtransformation2d.cpp, images/exampleRigidtransformation3d.cpp, and tutorial-examples/volDTGranulo.cpp.

Definition at line 247 of file Image.h.

248 {
250 }
void setValue(const Point &aPoint, const Value &aValue)
Definition Image.h:247

References aPoint, and myImagePointer.

Referenced by generateRefImage(), main(), main(), randomSeeds(), testGetSetVal(), testImage(), testITKImage(), testITKImageWithMetadata(), testITKImageWithShiftDomain(), and testITKMethod().

Field Documentation

◆ myImagePointer

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

Owning smart pointer on the image container.

Definition at line 287 of file Image.h.

Referenced by constRange(), domain(), getPointer(), Image(), Image(), Image(), Image(), isValid(), operator()(), operator=(), range(), and setValue().


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