SimpleITK
|
Base class for computing IIR convolution with an approximation of a Gaussian kernel. More...
#include <sitkRecursiveGaussianImageFilter.h>
Base class for computing IIR convolution with an approximation of a Gaussian kernel.
\[ \frac{ 1 }{ \sigma \sqrt{ 2 \pi } } \exp{ \left( - \frac{x^2}{ 2 \sigma^2 } \right) } \]
RecursiveGaussianImageFilter is the base class for recursive filters that approximate convolution with the Gaussian kernel. This class implements the recursive filtering method proposed by R.Deriche in IEEE-PAMI Vol.12, No.1, January 1990, pp 78-87, "Fast Algorithms for Low-Level Vision"
Details of the implementation are described in the technical report: R. Deriche, "Recursively Implementing The Gaussian and Its Derivatives", INRIA, 1993, ftp://ftp.inria.fr/INRIA/tech-reports/RR/RR-1893.ps.gz
Further improvements of the algorithm are described in: G. Farnebäck & C.-F. Westin, "Improving Deriche-style Recursive Gaussian Filters". J Math Imaging Vis 26, 293–299 (2006). https://doi.org/10.1007/s10851-006-8464-z
As compared to itk::DiscreteGaussianImageFilter , this filter tends to be faster for large kernels, and it can take the derivative of the blurred image in one step. Also, note that we have itk::RecursiveGaussianImageFilter::SetSigma() , but itk::DiscreteGaussianImageFilter::SetVariance() .
Definition at line 52 of file sitkRecursiveGaussianImageFilter.h.
Public Types | |
enum | OrderType { ZeroOrder, FirstOrder, SecondOrder } |
using | PixelIDTypeList = typelist2::append< BasicPixelIDTypeList, VectorPixelIDTypeList >::type |
using | Self = RecursiveGaussianImageFilter |
Public Types inherited from itk::simple::ImageFilter | |
using | Self = ImageFilter |
Public Types inherited from itk::simple::ProcessObject | |
using | Self = ProcessObject |
Public Member Functions | |
Image | Execute (const Image &image1) |
Image | Execute (Image &&image1) |
unsigned int | GetDirection () const |
std::string | GetName () const |
bool | GetNormalizeAcrossScale () const |
OrderType | GetOrder () const |
double | GetSigma () const |
Self & | NormalizeAcrossScaleOff () |
Self & | NormalizeAcrossScaleOn () |
RecursiveGaussianImageFilter () | |
Self & | SetDirection (unsigned int Direction) |
Self & | SetNormalizeAcrossScale (bool NormalizeAcrossScale) |
Self & | SetOrder (OrderType Order) |
Self & | SetSigma (double Sigma) |
std::string | ToString () const |
virtual | ~RecursiveGaussianImageFilter () |
Public Member Functions inherited from itk::simple::ImageFilter | |
ImageFilter () | |
virtual | ~ImageFilter ()=0 |
Public Member Functions inherited from itk::simple::ProcessObject | |
virtual void | Abort () |
virtual int | AddCommand (itk::simple::EventEnum event, const std::function< void()> &func) |
Directly add a callback to observe an event. More... | |
virtual int | AddCommand (itk::simple::EventEnum event, itk::simple::Command &cmd) |
Add a Command Object to observer the event. More... | |
virtual float | GetProgress () const |
An Active Measurement of the progress of execution. More... | |
virtual bool | HasCommand (itk::simple::EventEnum event) const |
Query of this object has any registered commands for event. More... | |
ProcessObject () | |
virtual void | RemoveAllCommands () |
Remove all registered commands. More... | |
virtual | ~ProcessObject () |
virtual void | DebugOn () |
virtual void | DebugOff () |
virtual bool | GetDebug () const |
virtual void | SetDebug (bool debugFlag) |
virtual void | SetNumberOfThreads (unsigned int n) |
virtual unsigned int | GetNumberOfThreads () const |
virtual void | SetNumberOfWorkUnits (unsigned int n) |
virtual unsigned int | GetNumberOfWorkUnits () const |
Private Types | |
using | MemberFunctionType = Image(Self::*)(const Image &image1) |
Private Member Functions | |
template<class TImageType > | |
Image | ExecuteInternal (const Image &image1) |
Private Attributes | |
unsigned int | m_Direction {0u} |
bool | m_InPlace {false} |
std::unique_ptr< detail::MemberFunctionFactory< MemberFunctionType > > | m_MemberFactory |
bool | m_NormalizeAcrossScale {false} |
OrderType | m_Order {itk::simple::RecursiveGaussianImageFilter::ZeroOrder} |
double | m_Sigma {1.0} |
Friends | |
struct | detail::MemberFunctionAddressor< MemberFunctionType > |
Additional Inherited Members | |
Static Public Member Functions inherited from itk::simple::ProcessObject | |
static bool | GetGlobalDefaultDebug () |
static void | GlobalDefaultDebugOff () |
static void | GlobalDefaultDebugOn () |
static void | SetGlobalDefaultDebug (bool debugFlag) |
static void | GlobalWarningDisplayOn () |
static void | GlobalWarningDisplayOff () |
static void | SetGlobalWarningDisplay (bool flag) |
static bool | GetGlobalWarningDisplay () |
static double | GetGlobalDefaultCoordinateTolerance () |
Access the global tolerance to determine congruent spaces. More... | |
static void | SetGlobalDefaultCoordinateTolerance (double) |
Access the global tolerance to determine congruent spaces. More... | |
static double | GetGlobalDefaultDirectionTolerance () |
Access the global tolerance to determine congruent spaces. More... | |
static void | SetGlobalDefaultDirectionTolerance (double) |
Access the global tolerance to determine congruent spaces. More... | |
static bool | SetGlobalDefaultThreader (const std::string &threader) |
Set/Get the default threader used for process objects. More... | |
static std::string | GetGlobalDefaultThreader () |
Set/Get the default threader used for process objects. More... | |
static void | SetGlobalDefaultNumberOfThreads (unsigned int n) |
static unsigned int | GetGlobalDefaultNumberOfThreads () |
Set/Get the default threader used for process objects. More... | |
Protected Member Functions inherited from itk::simple::ImageFilter | |
void | CheckImageMatchingDimension (const Image &image1, const Image &image2, const std::string &image2Name) |
void | CheckImageMatchingPixelType (const Image &image1, const Image &image2, const std::string &image2Name) |
void | CheckImageMatchingSize (const Image &image1, const Image &image2, const std::string &image2Name) |
Protected Member Functions inherited from itk::simple::ProcessObject | |
virtual unsigned long | AddITKObserver (const itk::EventObject &, itk::Command *) |
virtual itk::ProcessObject * | GetActiveProcess () |
virtual void | OnActiveProcessDelete () |
virtual void | onCommandDelete (const itk::simple::Command *cmd) noexcept |
virtual void | PreUpdate (itk::ProcessObject *p) |
virtual void | RemoveITKObserver (EventCommand &e) |
Protected Member Functions inherited from itk::simple::NonCopyable | |
NonCopyable ()=default | |
NonCopyable (const NonCopyable &)=delete | |
NonCopyable & | operator= (const NonCopyable &)=delete |
Static Protected Member Functions inherited from itk::simple::ImageFilter | |
template<class TImageType > | |
static void | FixNonZeroIndex (TImageType *img) |
Static Protected Member Functions inherited from itk::simple::ProcessObject | |
template<class TImageType > | |
static TImageType::ConstPointer | CastImageToITK (const Image &img) |
template<class TPixelType , unsigned int VImageDimension, unsigned int VLength, template< typename, unsigned int > class TVector> | |
static Image | CastITKToImage (itk::Image< TVector< TPixelType, VLength >, VImageDimension > *img) |
template<unsigned int VImageDimension, unsigned int VLength, template< unsigned int > class TVector> | |
static Image | CastITKToImage (itk::Image< TVector< VLength >, VImageDimension > *img) |
template<class TImageType > | |
static Image | CastITKToImage (TImageType *img) |
static const itk::EventObject & | GetITKEventObject (EventEnum e) |
template<typename T > | |
static std::ostream & | ToStringHelper (std::ostream &os, const T &v) |
static std::ostream & | ToStringHelper (std::ostream &os, const char &v) |
static std::ostream & | ToStringHelper (std::ostream &os, const signed char &v) |
static std::ostream & | ToStringHelper (std::ostream &os, const unsigned char &v) |
|
private |
Setup for member function dispatching
Definition at line 159 of file sitkRecursiveGaussianImageFilter.h.
using itk::simple::RecursiveGaussianImageFilter::PixelIDTypeList = typelist2::append<BasicPixelIDTypeList, VectorPixelIDTypeList>::type |
Define the pixels types supported by this filter
Definition at line 64 of file sitkRecursiveGaussianImageFilter.h.
Definition at line 54 of file sitkRecursiveGaussianImageFilter.h.
Enumerator | |
---|---|
ZeroOrder | |
FirstOrder | |
SecondOrder |
Definition at line 106 of file sitkRecursiveGaussianImageFilter.h.
|
virtual |
Destructor
itk::simple::RecursiveGaussianImageFilter::RecursiveGaussianImageFilter | ( | ) |
Default Constructor that takes no arguments and initializes default parameters
Execute the filter on the input image
|
private |
|
inline |
Definition at line 140 of file sitkRecursiveGaussianImageFilter.h.
|
inlinevirtual |
Name of this class
Implements itk::simple::ProcessObject.
Definition at line 143 of file sitkRecursiveGaussianImageFilter.h.
|
inline |
Definition at line 104 of file sitkRecursiveGaussianImageFilter.h.
|
inline |
Set/Get the Order of the Gaussian to convolve with.
Definition at line 132 of file sitkRecursiveGaussianImageFilter.h.
|
inline |
Set/Get the Sigma, measured in world coordinates, of the Gaussian kernel. The default is 1.0. An exception will be generated if the Sigma value is less than or equal to zero.
Definition at line 75 of file sitkRecursiveGaussianImageFilter.h.
|
inline |
Definition at line 100 of file sitkRecursiveGaussianImageFilter.h.
|
inline |
Set the value of NormalizeAcrossScale to true or false respectfully.
Definition at line 99 of file sitkRecursiveGaussianImageFilter.h.
|
inline |
Definition at line 136 of file sitkRecursiveGaussianImageFilter.h.
|
inline |
Set/Get the flag for normalizing the gaussian over scale-space.
This flag enables the analysis of the differential shape of features independent of their size ( both pixels and physical size ). Following the notation of Tony Lindeberg:
Let
\[ L(x; t) = g(x; t) \ast f(x) \]
be the scale-space representation of image
\[ f(x) \]
where
\[ g(x; t) = \frac{1}{ \sqrt{ 2 \pi t} } \exp{ \left( -\frac{x^2}{ 2 t } \right) } \]
is the Gaussian function and
\[\ast\]
denotes convolution. This is a change from above with
\[ t = \sigma^2 \]
.
Then the normalized derivative operator for normalized coordinates across scale is:
\[ \partial_\xi = \sqrt{t} \partial_x \]
The resulting scaling factor is
\[ \sigma^N \]
where N is the order of the derivative.
When this flag is ON the filter will be normalized in such a way that the values of derivatives are not biased by the size of the object. That is to say the maximum value a feature reaches across scale is independent of the scale of the object.
For analyzing an image across scale-space you want to enable this flag. It is disabled by default.
Definition at line 96 of file sitkRecursiveGaussianImageFilter.h.
Set/Get the Order of the Gaussian to convolve with.
Definition at line 119 of file sitkRecursiveGaussianImageFilter.h.
|
inline |
Set/Get the Sigma, measured in world coordinates, of the Gaussian kernel. The default is 1.0. An exception will be generated if the Sigma value is less than or equal to zero.
Definition at line 70 of file sitkRecursiveGaussianImageFilter.h.
|
virtual |
Print ourselves out
Reimplemented from itk::simple::ProcessObject.
|
friend |
Definition at line 163 of file sitkRecursiveGaussianImageFilter.h.
|
private |
Definition at line 178 of file sitkRecursiveGaussianImageFilter.h.
|
private |
Definition at line 181 of file sitkRecursiveGaussianImageFilter.h.
|
private |
Definition at line 165 of file sitkRecursiveGaussianImageFilter.h.
|
private |
Definition at line 172 of file sitkRecursiveGaussianImageFilter.h.
|
private |
Definition at line 175 of file sitkRecursiveGaussianImageFilter.h.
|
private |
Definition at line 169 of file sitkRecursiveGaussianImageFilter.h.