OPAL
Public Types | Public Member Functions | List of all members
SSD< TDb > Class Template Reference

Class responsible for SSD calculation between patches of images. More...

#include <SSD.h>

Public Types

using ValueType = typename TDb::ImgPixelType
 
using ImgType = typename TDb::ImgType
 

Public Member Functions

 SSD (const TDb &db, size_t idx, size_t ctrFixedX, size_t ctrFixedY, size_t ctrMovingX, size_t ctrMovingY, size_t radius)
 Constructor from coordinates of centers of patches. More...
 
ValueType GetValue () const
 
 operator ValueType () const
 
bool operator< (const SSD &other) const
 
ValueType ShiftRight ()
 Same moving image, (x+1,y) on both fixed and moving images. More...
 
ValueType ShiftLeft ()
 Same moving image, (x-1,y) on both fixed and moving images. More...
 
ValueType ShiftUp ()
 Same moving image, (x,y-1) on both fixed and moving images. More...
 
ValueType ShiftDown ()
 Same moving image, (x,y+1) on both fixed and moving images. More...
 
ValueType ShiftImage (const ImgType *img)
 Same (x,y) coordinates on image img. More...
 

Detailed Description

template<class TDb>
class SSD< TDb >

Class responsible for SSD calculation between patches of images.

Needs a reference to ImageDatabase to construct, as it must support calculating SSD between adjacent pathces in both X and Y dimensions, as well as between patches of adjacent images in database.

SSD is constructed from coordinates of centers of patches, but uses coordinates of top-left corner of patches for calculation.

Needs only index of a single image in database (>= 1) because the other image is always Database[0] (image to be segmented).

Template Parameters
TDbType of image database. Must be ImageDatabase.

Constructor & Destructor Documentation

§ SSD()

template<class TDb >
SSD< TDb >::SSD ( const TDb &  db,
size_t  idx,
size_t  ctrFixedX,
size_t  ctrFixedY,
size_t  ctrMovingX,
size_t  ctrMovingY,
size_t  radius 
)

Constructor from coordinates of centers of patches.

Calculates coordinates of top-left corners of patches on images. Patches must lay inside the images, i. e. ctrFixedX >= radius, ctrFixedX < imageWidth - radius, similarly for Y coordinates.

Parameters
[in]dbDatabase of images
[in]idxIndex of moving image in database, must be >= 1
[in]ctrFixedXX-coordinate of center of patch on fixed image
[in]ctrFixedYY-coordinate of center of patch on fixed image
[in]ctrMovingXX-coordinate of center of patch on moving image
[in]ctrMovingYY-coordinate of center of patch on moving image
[in]radiusRadius of patches

Member Function Documentation

§ GetValue()

template<class TDb >
SSD< TDb >::ValueType SSD< TDb >::GetValue ( ) const
inline
Returns
Value of calculated SSD.

§ operator ValueType()

template<class TDb >
SSD< TDb >::operator ValueType ( ) const
inline
Returns
Retult of GetValue().

§ operator<()

template<class TDb >
bool SSD< TDb >::operator< ( const SSD< TDb > &  other) const
inline
Todo:
Documentation.

§ ShiftDown()

template<class TDb >
SSD< TDb >::ValueType SSD< TDb >::ShiftDown ( )

Same moving image, (x,y+1) on both fixed and moving images.

Returns
Calculated flag.

§ ShiftImage()

template<class TDb>
SSD< TDb >::ValueType SSD< TDb >::ShiftImage ( const ImgType *  img)

Same (x,y) coordinates on image img.

Returns
Calculated flag.

§ ShiftLeft()

template<class TDb >
SSD< TDb >::ValueType SSD< TDb >::ShiftLeft ( )

Same moving image, (x-1,y) on both fixed and moving images.

Returns
Calculated flag.

§ ShiftRight()

template<class TDb >
SSD< TDb >::ValueType SSD< TDb >::ShiftRight ( )

Same moving image, (x+1,y) on both fixed and moving images.

Returns
Calculated flag.

§ ShiftUp()

template<class TDb >
SSD< TDb >::ValueType SSD< TDb >::ShiftUp ( )

Same moving image, (x,y-1) on both fixed and moving images.

Returns
Calculated flag.

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