MDSTk Libraries  1.1.0
Medical Data Segmentation Toolkit
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes
mds::img::CVolumeCanny< V > Class Template Reference

Canny edge detector in 3D space. More...

#include <mdsCanny.h>

Inheritance diagram for mds::img::CVolumeCanny< V >:
Inheritance graph
[legend]

List of all members.

Public Types

enum  { TEMPLATE_PARAMETER_IS_NOT_VOLUME = V::CLASS_VOLUME }
 Check that V is a volume. More...
enum  { BLOCK_SIZE = 128 }
 Size of the processing block (volume window). More...
typedef CVolumeEdgeDetector< V > base
 Volume filter base.
typedef base::tVolume tVolume
 Volume type.
typedef base::tVoxel tVoxel
 Voxel type.

Public Member Functions

 CVolumeCanny (double dT1, double dT2)
 Default constructor.
void getThresholds (double &dT1, double &dT2)
 Returns thresholds of the non-maximal suppression algorithm.
bool operator() (const tVolume &SrcVolume, tVolume &DstVolume)
 Edge detection.
void setThresholds (double dT1, double dT2)
 Sets thresholds of the non-maximal suppression algorithm.
 ~CVolumeCanny ()
 Destructor.

Protected Member Functions

bool checkNeighbours (tVolume &Volume, tSize x, tSize y, tSize z, tVoxel T)
 Returns true if any neighbouring voxel has greater value than a given threshold.
void hysteresis (tVolume &MagnitudeVolume, tVolume &Volume, tSize x, tSize y, tSize z, tSize XSize, tSize YSize, tSize ZSize, tVoxel T1, tVoxel T2)
 Hystersis controlled by two given thresholds.
void nonMaxSuppression (const tVolume &GradVolumeX, const tVolume &GradVolumeY, const tVolume &GradVolumeZ, tVolume &MagnitudeVolume, tVolume &Volume, tSize x, tSize y, tSize z, tSize XSize, tSize YSize, tSize ZSize)
 Non-maximal suppression.

Protected Attributes

double m_dT1
 Thresholds used by hysteresis algorithm.
double m_dT2
CVolumeGauss3Filter< tVolumem_GaussFilter
 Gaussian smoothing filter.
CVolumeSobelX< tVolume,
CShiftZero2Gray
m_SobelX
 Sobel operators.
CVolumeSobelY< tVolume,
CShiftZero2Gray
m_SobelY
CVolumeSobelZ< tVolume,
CShiftZero2Gray
m_SobelZ

Detailed Description

template<class V>
class mds::img::CVolumeCanny< V >

Canny edge detector in 3D space.


Member Typedef Documentation

template<class V >
typedef CVolumeEdgeDetector<V> mds::img::CVolumeCanny< V >::base

Volume filter base.

template<class V >
typedef base::tVolume mds::img::CVolumeCanny< V >::tVolume

Volume type.

Reimplemented from mds::img::CVolumeEdgeDetector< V >.

template<class V >
typedef base::tVoxel mds::img::CVolumeCanny< V >::tVoxel

Voxel type.

Reimplemented from mds::img::CVolumeEdgeDetector< V >.


Member Enumeration Documentation

template<typename V >
anonymous enum [inherited]

Check that V is a volume.

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

Enumerator:
TEMPLATE_PARAMETER_IS_NOT_VOLUME 
template<class V >
anonymous enum

Size of the processing block (volume window).

The input volume is divided into smaller blocks - cubes for the processing.

  • This is used to reduce amount of the memory required by the filtering.
Enumerator:
BLOCK_SIZE 

Constructor & Destructor Documentation

template<class V >
mds::img::CVolumeCanny< V >::CVolumeCanny ( double  dT1,
double  dT2 
)

Default constructor.

  • Thresholds for the hysteresis (0..1).
template<class V >
mds::img::CVolumeCanny< V >::~CVolumeCanny ( )

Destructor.


Member Function Documentation

template<class V >
bool CVolumeCanny::checkNeighbours ( tVolume Volume,
tSize  x,
tSize  y,
tSize  z,
tVoxel  T 
) [protected]

Returns true if any neighbouring voxel has greater value than a given threshold.

template<class V >
void CVolumeCanny::getThresholds ( double &  dT1,
double &  dT2 
)

Returns thresholds of the non-maximal suppression algorithm.

template<class V >
void CVolumeCanny::hysteresis ( tVolume MagnitudeVolume,
tVolume Volume,
tSize  x,
tSize  y,
tSize  z,
tSize  XSize,
tSize  YSize,
tSize  ZSize,
tVoxel  T1,
tVoxel  T2 
) [protected]

Hystersis controlled by two given thresholds.

  • Applies the hysteresis to the provided volume. It checks each voxel against an upper threshhold 'T1'. If the voxel value is equal or higher, the current voxel is an edge voxel. Then all direct neighbours of the voxel are compared to a lower threshhold 'T2' and if their values are equal or higher than this threshhold, they become edge voxels as well.
  • In practice the threshold T1 = (2-3) * T2.
template<class V >
void CVolumeCanny::nonMaxSuppression ( const tVolume GradVolumeX,
const tVolume GradVolumeY,
const tVolume GradVolumeZ,
tVolume MagnitudeVolume,
tVolume Volume,
tSize  x,
tSize  y,
tSize  z,
tSize  XSize,
tSize  YSize,
tSize  ZSize 
) [protected]

Non-maximal suppression.

template<class V >
bool CVolumeCanny::operator() ( const tVolume SrcVolume,
tVolume DstVolume 
) [virtual]

Edge detection.

  • Magnitude volume is produced.
  • Returns false on failure.

Implements mds::img::CVolumeEdgeDetector< V >.

template<class V >
void CVolumeCanny::setThresholds ( double  dT1,
double  dT2 
)

Sets thresholds of the non-maximal suppression algorithm.


Member Data Documentation

template<class V >
double mds::img::CVolumeCanny< V >::m_dT1 [protected]

Thresholds used by hysteresis algorithm.

template<class V >
double mds::img::CVolumeCanny< V >::m_dT2 [protected]
template<class V >
CVolumeGauss3Filter<tVolume> mds::img::CVolumeCanny< V >::m_GaussFilter [protected]

Gaussian smoothing filter.

template<class V >
CVolumeSobelX<tVolume, CShiftZero2Gray> mds::img::CVolumeCanny< V >::m_SobelX [protected]

Sobel operators.

template<class V >
CVolumeSobelY<tVolume, CShiftZero2Gray> mds::img::CVolumeCanny< V >::m_SobelY [protected]
template<class V >
CVolumeSobelZ<tVolume, CShiftZero2Gray> mds::img::CVolumeCanny< V >::m_SobelZ [protected]

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