Update link INRIA, improve style RecursiveGaussianImageFilter and RecursiveSeparableImageFilter#5687
Conversation
Following MISRA-C++ Rule "If a member function can be made static then it shall be made static" and Clang-Tidy `readability-convert-member-functions-to-static`, https://clang.llvm.org/extra/clang-tidy/checks/readability/convert-member-functions-to-static.html
Following C++ Core Guidelines, Jul 8, 2025, "Don’t define a default constructor that only initializes data members; use default member initializers instead", https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#c45-dont-define-a-default-constructor-that-only-initializes-data-members-use-default-member-initializers-instead
Removed the member initializer list from the default-constructor, used default member initializers in the class definition instead.
| A1[0] = static_cast<ScalarRealType>(1.3530); | ||
| B1[0] = static_cast<ScalarRealType>(1.8151); | ||
| W1 = static_cast<ScalarRealType>(0.6681); | ||
| L1 = static_cast<ScalarRealType>(-1.3932); | ||
| A2[0] = static_cast<ScalarRealType>(-0.3531); | ||
| B2[0] = static_cast<ScalarRealType>(0.0902); | ||
| W2 = static_cast<ScalarRealType>(2.0787); | ||
| L2 = static_cast<ScalarRealType>(-1.3732); | ||
|
|
||
| A1[1] = static_cast<ScalarRealType>(-0.6724); | ||
| B1[1] = static_cast<ScalarRealType>(-3.4327); | ||
| A2[1] = static_cast<ScalarRealType>(0.6724); | ||
| B2[1] = static_cast<ScalarRealType>(0.6100); | ||
|
|
||
| A1[2] = static_cast<ScalarRealType>(-1.3563); | ||
| B1[2] = static_cast<ScalarRealType>(5.2318); | ||
| A2[2] = static_cast<ScalarRealType>(0.3446); | ||
| B2[2] = static_cast<ScalarRealType>(-2.2355); |
There was a problem hiding this comment.
For the record, it appears that these "magic numbers" were originally introduced with commit ef006d2, Luis Ibanez, Jan 17, 2005. They are also presented in Table 3. "Proposed new parameters in the approximation of the Gaussian and its derivatives...", in "Improving Deriche-style Recursive Gaussian Filters", by Gunnar Farnebäck & Carl-Fredrik Westin, Nov 30 2006.
There was a problem hiding this comment.
Is it worth documenting in the code the source of these numbers?
There was a problem hiding this comment.
@blowekamp Good suggestion, thanks! As follows?
// Parameters of exponential series.
// These numbers correspond with Table 3. "Proposed new parameters in the approximation of the Gaussian and its
// derivatives..." of "Improving Deriche-style Recursive Gaussian Filters" [farneback2006].I hope it's clear enough that [farneback2006] refers to our bib entry at
ITK/Documentation/Doxygen/doxygen.bib
Lines 374 to 384 in 53158e3
There was a problem hiding this comment.
Yes, it is to me as it's in the class documentation.
There was a problem hiding this comment.
To be added to a follow-up 😃
Aims to clarify the code of `RecursiveSeparableImageFilter::FilterDataArray`.
The FTP site ftp.inria.fr appears to be replaced with https://inria.hal.science
Removed unnecessary `static_cast<ScalarRealType>`s.
a055224 to
5878389
Compare
blowekamp
left a comment
There was a problem hiding this comment.
The style improvements look good to me.
| A1[0] = static_cast<ScalarRealType>(1.3530); | ||
| B1[0] = static_cast<ScalarRealType>(1.8151); | ||
| W1 = static_cast<ScalarRealType>(0.6681); | ||
| L1 = static_cast<ScalarRealType>(-1.3932); | ||
| A2[0] = static_cast<ScalarRealType>(-0.3531); | ||
| B2[0] = static_cast<ScalarRealType>(0.0902); | ||
| W2 = static_cast<ScalarRealType>(2.0787); | ||
| L2 = static_cast<ScalarRealType>(-1.3732); | ||
|
|
||
| A1[1] = static_cast<ScalarRealType>(-0.6724); | ||
| B1[1] = static_cast<ScalarRealType>(-3.4327); | ||
| A2[1] = static_cast<ScalarRealType>(0.6724); | ||
| B2[1] = static_cast<ScalarRealType>(0.6100); | ||
|
|
||
| A1[2] = static_cast<ScalarRealType>(-1.3563); | ||
| B1[2] = static_cast<ScalarRealType>(5.2318); | ||
| A2[2] = static_cast<ScalarRealType>(0.3446); | ||
| B2[2] = static_cast<ScalarRealType>(-2.2355); |
There was a problem hiding this comment.
Is it worth documenting in the code the source of these numbers?
The INRIA report by Rachid Deriche, "Recursively Implementing The Gaussian and Its Derivatives", 1993, appears to be moved to https://inria.hal.science/inria-00074778
This pull request also proposes various style improvements to
RecursiveGaussianImageFilterand its base classRecursiveSeparableImageFilter.