MDSTk Libraries  1.1.0
Medical Data Segmentation Toolkit
Public Types | Public Member Functions | Public Attributes | Protected Types | Protected Member Functions | Protected Attributes
mds::lbp::CCircularSampler< I > Class Template Reference

Class for getting along samples in a circular neighborhood around a given center pixel. More...

#include <mdsCircularSampler.h>

Inheritance diagram for mds::lbp::CCircularSampler< I >:
Inheritance graph
[legend]

List of all members.

Public Types

enum  { TEMPLATE_PARAMETER_IS_NOT_IMAGE = I::CLASS_IMAGE }
 Check that I is an image. More...
typedef I::tImage tImage
 Image type.
typedef I::tPixel tPixel
 Image pixel type.
typedef std::vector< tPixeltSamples
 Vector of samples.

Public Member Functions

 CCircularSampler (int NumOfSamples=CircularSampler::DEFAULT_NUM_OF_SAMPLES, mds::img::tCoordinate Radius=CircularSampler::DEFAULT_RADIUS)
 Default constructor.
template<class Function >
Function forEach (tSize x, tSize y, Function Func)
template<class Function >
Function forEach (tSize x, tSize y, Function Func)
 Applies a given functor to all samples in circular neighbourhood of a given center pixel.
tPixel getCenter (tSize x, tSize y)
 Returns value of the center pixel.
mds::tSize getMinMargin () const
 Returns margin needed for sampled pixels to be inside an image.
int getNumOfSamples () const
 Returns samples count.
mds::img::tCoordinate getRadius () const
 Returns radius of the neighbourhood.
bool getSamples (tSize x, tSize y, tSamples &Result)
 Returns samples from circular neighborhood of a given center pixel.
CCircularSamplersetImage (tImage *pImage)
 Sets the image.
 ~CCircularSampler ()
 Destructor.

Public Attributes

mds::img::tCoordinate tCoordinate
 Float coordinates.

Protected Types

typedef std::vector
< mds::img::CPoint3D
tCoords
 Relative coordinates of samples.

Protected Member Functions

void updateCoords ()
 Update relative coordinates of samples.

Protected Attributes

tCoords m_Coords
 Relative coordinates of points to be sampled.
int m_NumOfSamples
 Number of samples.
mds::img::tCoordinate m_Radius
 Neighbourhood radius.
tImage::tSmartPtr m_spImage
 Image to obtain samples from.

Detailed Description

template<class I>
class mds::lbp::CCircularSampler< I >

Class for getting along samples in a circular neighborhood around a given center pixel.

Samples are equally spaced pixels on a circle of a specified radius. Number of samples and the radius can be set. Samples which don't exactly fit the pixel grid are interpolated.


Member Typedef Documentation

template<class I>
typedef std::vector<mds::img::CPoint3D> mds::lbp::CCircularSampler< I >::tCoords [protected]

Relative coordinates of samples.

template<class I>
typedef I::tImage mds::lbp::CCircularSampler< I >::tImage

Image type.

template<class I>
typedef I::tPixel mds::lbp::CCircularSampler< I >::tPixel

Image pixel type.

template<class I>
typedef std::vector<tPixel> mds::lbp::CCircularSampler< I >::tSamples

Vector of samples.


Member Enumeration Documentation

template<class I>
anonymous enum

Check that I is an image.

You will see name of this enum somewhere in compiler error message if the type I is not image.

Enumerator:
TEMPLATE_PARAMETER_IS_NOT_IMAGE 

Constructor & Destructor Documentation

Default constructor.

template<class I>
mds::lbp::CCircularSampler< I >::~CCircularSampler ( )

Destructor.


Member Function Documentation

template<class I>
template<class Function >
Function mds::lbp::CCircularSampler< I >::forEach ( tSize  x,
tSize  y,
Function  Func 
)
template<class I >
template<class Function >
Function mds::lbp::CCircularSampler< I >::forEach ( tSize  x,
tSize  y,
Function  Func 
)

Applies a given functor to all samples in circular neighbourhood of a given center pixel.

template<class I >
CCircularSampler< I >::tPixel CCircularSampler::getCenter ( tSize  x,
tSize  y 
)

Returns value of the center pixel.

template<class I>
mds::tSize mds::lbp::CCircularSampler< I >::getMinMargin ( ) const

Returns margin needed for sampled pixels to be inside an image.

template<class I>
int mds::lbp::CCircularSampler< I >::getNumOfSamples ( ) const

Returns samples count.

template<class I>
mds::img::tCoordinate mds::lbp::CCircularSampler< I >::getRadius ( ) const

Returns radius of the neighbourhood.

template<class I >
bool CCircularSampler::getSamples ( tSize  x,
tSize  y,
tSamples Result 
)

Returns samples from circular neighborhood of a given center pixel.

template<class I>
CCircularSampler& mds::lbp::CCircularSampler< I >::setImage ( tImage pImage)

Sets the image.

template<class I >
void CCircularSampler::updateCoords ( ) [protected]

Update relative coordinates of samples.


Member Data Documentation

template<class I>
tCoords mds::lbp::CCircularSampler< I >::m_Coords [protected]

Relative coordinates of points to be sampled.

First one has coordinates [radius,0], others following CCW.

template<class I>
int mds::lbp::CCircularSampler< I >::m_NumOfSamples [protected]

Number of samples.

template<class I>
mds::img::tCoordinate mds::lbp::CCircularSampler< I >::m_Radius [protected]

Neighbourhood radius.

template<class I>
tImage::tSmartPtr mds::lbp::CCircularSampler< I >::m_spImage [protected]

Image to obtain samples from.

Float coordinates.


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