From 907bbc786ce3a083dead436c430b5999dfaa80fe Mon Sep 17 00:00:00 2001
From: Irina Vidal <irina.vidal-migallon@inria.fr>
Date: Tue, 9 Jul 2013 15:48:23 +0200
Subject: [PATCH 01/65] ENH: Going public.

Signed-off-by: Irina Vidal <irina.vidal-migallon@inria.fr>
---
 ...SmoothingRecursiveYvvGaussianImageFilter.h | 176 ++++++
 ...oothingRecursiveYvvGaussianImageFilter.hxx | 424 +++++++++++++++
 .../itkRecursiveLineYvvGaussianImageFilter.h  | 165 ++++++
 ...itkRecursiveLineYvvGaussianImageFilter.hxx | 506 ++++++++++++++++++
 ...SmoothingRecursiveYvvGaussianImageFilter.h | 153 ++++++
 ...oothingRecursiveYvvGaussianImageFilter.hxx | 282 ++++++++++
 .../itk-module.cmake                          |  33 ++
 .../src/CMakeLists.txt                        |  28 +
 ...moothingRecursiveYvvGaussianImageFilter.cl | 235 ++++++++
 .../src/OpenCLInfo.cpp                        |  94 ++++
 .../test/CMakeLists.txt                       | 108 ++++
 ...CPURecursiveYvvGaussianImageFilterTest.cxx |  51 ++
 ...GPURecursiveYvvGaussianImageFilterTest.cxx |  64 +++
 .../test/itkYvvBenchmark.cxx                  |  63 +++
 .../test/itkYvvGpuCpuSimilarityTest.cxx       | 209 ++++++++
 .../test/itkYvvWhiteImageTest.cxx             | 104 ++++
 .../test/yvvFilter.hxx                        | 357 ++++++++++++
 17 files changed, 3052 insertions(+)
 create mode 100644 Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkGPUSmoothingRecursiveYvvGaussianImageFilter.h
 create mode 100644 Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkGPUSmoothingRecursiveYvvGaussianImageFilter.hxx
 create mode 100644 Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkRecursiveLineYvvGaussianImageFilter.h
 create mode 100644 Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkRecursiveLineYvvGaussianImageFilter.hxx
 create mode 100644 Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkSmoothingRecursiveYvvGaussianImageFilter.h
 create mode 100644 Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkSmoothingRecursiveYvvGaussianImageFilter.hxx
 create mode 100644 Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/itk-module.cmake
 create mode 100644 Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/src/CMakeLists.txt
 create mode 100644 Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/src/GPUSmoothingRecursiveYvvGaussianImageFilter.cl
 create mode 100644 Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/src/OpenCLInfo.cpp
 create mode 100644 Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/CMakeLists.txt
 create mode 100644 Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/itkCPURecursiveYvvGaussianImageFilterTest.cxx
 create mode 100644 Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/itkGPURecursiveYvvGaussianImageFilterTest.cxx
 create mode 100644 Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/itkYvvBenchmark.cxx
 create mode 100644 Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/itkYvvGpuCpuSimilarityTest.cxx
 create mode 100644 Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/itkYvvWhiteImageTest.cxx
 create mode 100644 Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/yvvFilter.hxx

diff --git a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkGPUSmoothingRecursiveYvvGaussianImageFilter.h b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkGPUSmoothingRecursiveYvvGaussianImageFilter.h
new file mode 100644
index 00000000000..c0edebb793d
--- /dev/null
+++ b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkGPUSmoothingRecursiveYvvGaussianImageFilter.h
@@ -0,0 +1,176 @@
+
+#ifndef _ITK_GPU_SMOOTHING_RECURSIVE_YVV_GAUSSIAN_IMAGE_FILTER_H_
+#define _ITK_GPU_SMOOTHING_RECURSIVE_YVV_GAUSSIAN_IMAGE_FILTER_H_
+
+#include "itkImage.h"
+#include "itkPixelTraits.h"
+#include "itkCommand.h"
+#include "itkFixedArray.h"
+#include "itkGPUImageToImageFilter.h"
+#include "itkOpenCLUtil.h"
+#include "itkSmoothingRecursiveYvvGaussianImageFilter.h"
+
+
+namespace itk
+{
+itkGPUKernelClassMacro(GPUSmoothingRecursiveYvvGaussianImageFilterKernel);
+
+template <typename TInputImage, typename TOutputImage = TInputImage>
+class ITK_EXPORT GPUSmoothingRecursiveYvvGaussianImageFilter
+  : public GPUImageToImageFilter<TInputImage,
+                                 TOutputImage,
+                                 SmoothingRecursiveYvvGaussianImageFilter<TInputImage, TOutputImage>>
+{
+public:
+  /** Standard class typedefs. */
+  typedef GPUSmoothingRecursiveYvvGaussianImageFilter Self;
+  // typedef SmoothingRecursiveYvvGaussianImageFilter<TInputImage,TOutputImage>   CPUSuperclass;
+  typedef GPUImageToImageFilter<TInputImage,
+                                TOutputImage,
+                                SmoothingRecursiveYvvGaussianImageFilter<TInputImage, TOutputImage>>
+    Superclass;
+  typedef GPUImageToImageFilter<TInputImage,
+                                TOutputImage,
+                                SmoothingRecursiveYvvGaussianImageFilter<TInputImage, TOutputImage>>
+                                   GPUSuperclass;
+  typedef SmartPointer<Self>       Pointer;
+  typedef SmartPointer<const Self> ConstPointer;
+
+
+  /** Pixel Type of the input image */
+  typedef TInputImage                     InputImageType;
+  typedef TOutputImage                    OutputImageType;
+  typedef typename TInputImage::PixelType PixelType;
+#ifdef WITH_DOUBLE
+  typedef typename NumericTraits<PixelType>::RealType       RealType;
+  typedef typename NumericTraits<PixelType>::ScalarRealType ScalarRealType;
+#else
+  typedef typename NumericTraits<PixelType>::FloatType RealType;
+  typedef typename NumericTraits<PixelType>::FloatType ScalarRealType;
+#endif
+
+  typedef typename itk::GPUTraits<TInputImage>::Type  GPUInputImage;
+  typedef typename itk::GPUTraits<TOutputImage>::Type GPUOutputImage;
+
+  /** Runtime information support. */
+  itkTypeMacro(GPUSmoothingRecursiveYvvGaussianImageFilter, GPUImageToImageFilter);
+
+  /** Image dimension. */
+  itkStaticConstMacro(ImageDimension, unsigned int, TInputImage::ImageDimension);
+
+  /** Define the type for the sigma array */
+  typedef FixedArray<ScalarRealType, itkGetStaticConstMacro(ImageDimension)> SigmaArrayType;
+
+  /** Define the image type for internal computations
+   RealType is usually 'double' in NumericTraits.
+   Here we prefer float in order to save memory.  */
+
+  typedef typename NumericTraits<PixelType>::FloatType                       InternalRealType;
+  typedef GPUImage<InternalRealType, itkGetStaticConstMacro(ImageDimension)> RealImageType;
+
+  /**  Pointer to the Output Image */
+  typedef typename OutputImageType::Pointer OutputImagePointer;
+
+  /** Method for creation through the object factory. */
+  itkNewMacro(Self);
+
+  /** Set Sigma value. Sigma is measured in the units of image spacing. You
+   may use the method SetSigma to set the same value across each axis or
+   use the method SetSigmaArray if you need different values along each
+   axis. */
+  void
+  SetSigmaArray(const SigmaArrayType & sigmas);
+  void
+  SetSigma(ScalarRealType sigma);
+  SigmaArrayType
+  GetSigmaArray() const;
+  ScalarRealType
+  GetSigma() const;
+
+  /** Define which normalization factor will be used for the Gaussian */
+  void
+  SetNormalizeAcrossScale(bool normalizeInScaleSpace);
+  itkGetConstMacro(NormalizeAcrossScale, bool);
+
+  virtual void
+  SetUp(ScalarRealType spacing);
+
+#ifdef ITK_USE_CONCEPT_CHECKING
+  /** Begin concept checking */
+  itkConceptMacro(InputHasNumericTraitsCheck, (Concept::HasNumericTraits<PixelType>));
+  /** End concept checking */
+#endif
+  /** Get OpenCL Kernel source as a string, creates a GetOpenCLSource method */
+  itkGetOpenCLSourceFromKernelMacro(GPUSmoothingRecursiveYvvGaussianImageFilterKernel);
+  void
+  SetInput(const TInputImage * input);
+  using Superclass::SetInput;
+
+protected:
+  GPUSmoothingRecursiveYvvGaussianImageFilter();
+  virtual ~GPUSmoothingRecursiveYvvGaussianImageFilter() {};
+  void
+  PrintSelf(std::ostream & os, Indent indent) const;
+
+  /** Generate Data */
+  void
+  GPUGenerateData(void);
+
+  /** GPUSmoothingRecursiveYvvGaussianImageFilter needs all of the input to produce an
+   * output. Therefore, GPUSmoothingRecursiveYvvGaussianImageFilter needs to provide
+   * an implementation for GenerateInputRequestedRegion in order to inform
+   * the pipeline execution model.
+   * \sa ImageToImageFilter::GenerateInputRequestedRegion() */
+  virtual void
+  GenerateInputRequestedRegion() throw(InvalidRequestedRegionError);
+
+  // Override since the filter produces the entire dataset
+  void
+  EnlargeOutputRequestedRegion(DataObject * output);
+  void
+  AllocateGPUCoefficients();
+
+  std::ostringstream defines;
+
+  ScalarRealType   m_B1;
+  ScalarRealType   m_B2;
+  ScalarRealType   m_B3;
+  ScalarRealType   m_B;
+  ScalarRealType * m_Bvalues;
+
+
+  // Initialization matrix for anti-causal pass
+  ScalarRealType * m_CPUMatrix;
+
+  typedef GPUDataManager::Pointer GPUDataPointer;
+
+  GPUDataPointer m_GPUMMatrixDataManager;
+  GPUDataPointer m_GPUBCoefficientsDataManager;
+  GPUDataPointer m_GPULocalDataManager;
+
+private:
+  GPUSmoothingRecursiveYvvGaussianImageFilter(const Self &); // purposely not implemented
+  void
+  BuildKernel();
+  void
+  operator=(const Self &); // purposely not implemented
+
+  /** Normalize the image across scale space */
+  bool m_NormalizeAcrossScale;
+
+  int                               m_FilterGPUKernelHandle;
+  typename GPUInputImage::Pointer   inPtr;
+  typename GPUOutputImage::Pointer  otPtr;
+  typename GPUOutputImage::SizeType m_requestedSize;
+  /** Standard deviation of the gaussian used for smoothing */
+  SigmaArrayType m_Sigma;
+  int            telltale; // TODO: REMOVE
+};
+
+} // end namespace itk
+
+#ifndef ITK_MANUAL_INSTANTIATION
+#  include "itkGPUSmoothingRecursiveYvvGaussianImageFilter.hxx"
+#endif
+
+#endif
diff --git a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkGPUSmoothingRecursiveYvvGaussianImageFilter.hxx b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkGPUSmoothingRecursiveYvvGaussianImageFilter.hxx
new file mode 100644
index 00000000000..eda6575efa2
--- /dev/null
+++ b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkGPUSmoothingRecursiveYvvGaussianImageFilter.hxx
@@ -0,0 +1,424 @@
+#ifndef _ITK_GPU_SMOOTHING_RECURSIVE_YVV_GAUSSIAN_IMAGE_FILTER_HXX_
+#define _ITK_GPU_SMOOTHING_RECURSIVE_YVV_GAUSSIAN_IMAGE_FILTER_HXX_
+
+#include "itkGPUSmoothingRecursiveYvvGaussianImageFilter.h"
+
+// #define VERBOSE
+namespace itk
+{
+
+/**
+ * Constructor
+ */
+template <typename TInputImage, typename TOutputImage>
+GPUSmoothingRecursiveYvvGaussianImageFilter<TInputImage, TOutputImage>::GPUSmoothingRecursiveYvvGaussianImageFilter()
+{
+#ifdef VERBOSE
+  telltale = rand();
+  std::cout << telltale << ". GPUSmoothing::constructor \n";
+#endif
+  m_NormalizeAcrossScale = false;
+  otPtr = dynamic_cast<GPUOutputImage *>(this->ProcessObject::GetOutput(0));
+
+
+  // NB: We must call SetSigma in order to initialize the smoothing
+  // filters with the default scale.  However, m_Sigma must first be
+  // initialized (it is used inside SetSigma) and it must be >= 0.5
+  // or the call will be ignored.
+
+  this->m_Sigma.Fill(0.0);
+  this->SetSigma(0.1);
+  m_FilterGPUKernelHandle = -1;
+}
+
+template <typename TInputImage, typename TOutputImage>
+void
+GPUSmoothingRecursiveYvvGaussianImageFilter<TInputImage, TOutputImage>::BuildKernel()
+{
+  const char *                      GPUSource = GPUSmoothingRecursiveYvvGaussianImageFilterKernel::GetOpenCLSource();
+  typename GPUOutputImage::SizeType lineSizes = inPtr->GetRequestedRegion().GetSize();
+  unsigned int                      maxLineSize = lineSizes[0];
+  for (unsigned int d = 1; d < ImageDimension; ++d)
+  {
+    maxLineSize = maxLineSize < lineSizes[d] ? lineSizes[d] : maxLineSize;
+  }
+
+#ifdef WITH_DOUBLE
+  defines << "#pragma OPENCL EXTENSION cl_khr_fp64 : enable \n";
+#endif
+
+#ifdef NVIDIA
+  defines << "#pragma OPENCL EXTENSION cl_nv_pragma_unroll : enable \n";
+#endif
+
+  defines << "#define DIM_" << TInputImage::ImageDimension << "\n";
+  defines << "#define INPIXELTYPE ";
+  GetTypenameInString(typeid(typename TInputImage::PixelType), defines);
+  defines << "#define OUTPIXELTYPE ";
+  GetTypenameInString(typeid(typename TOutputImage::PixelType), defines);
+  defines << "#define REALTYPE ";
+  GetTypenameInString(typeid(ScalarRealType), defines);
+  defines << "#define MAX_LINE_LENGTH " << maxLineSize << "\n";
+
+#ifdef VERBOSE
+  std::cout << telltale << ".   Defines: \n" << defines.str() << "\n";
+#endif
+
+  // load, build, create kernel
+  this->m_GPUKernelManager->LoadProgramFromString(GPUSource, defines.str().c_str());
+  m_FilterGPUKernelHandle = this->m_GPUKernelManager->CreateKernel("YvvFilter");
+}
+
+/**
+ *   Compute filter for Gaussian kernel.
+ */
+template <typename TInputImage, typename TOutputImage>
+void
+GPUSmoothingRecursiveYvvGaussianImageFilter<TInputImage, TOutputImage>::SetUp(ScalarRealType spacing)
+{
+#ifdef VERBOSE
+  std::cout << telltale << ". GPUSmoothing::SetUp with spacing " << spacing << "\n";
+#endif
+  const ScalarRealType sigmad = this->GetSigma() / spacing;
+
+  if (this->GetSigma() >= 0.5)
+  {
+#ifdef VERBOSE
+    std::cout << telltale << ". GPUSmoothing::SetUp with sigma " << m_Sigma << "\n";
+#endif
+    // Compute q according to 16 in Young et al on Gabor filering
+    ScalarRealType q = 0;
+    if (sigmad >= 3.556)
+      q = 0.9804 * (sigmad - 3.556) + 2.5091;
+    else
+    {
+      if (sigmad < 0.5)
+        std::cerr << "Too low sigma value (< 0.5), computation will not be precise." << std::endl;
+
+      q = 0.0561 * sigmad * sigmad + 0.5784 * sigmad - 0.2568;
+    }
+
+    // Compute B and B0 to B3 according to Young et al 1995
+
+    ScalarRealType m0 = 1.16680;
+    ScalarRealType m1 = 1.10783;
+    ScalarRealType m2 = 1.40586;
+    ScalarRealType scale = (m0 + q) * (m1 * m1 + m2 * m2 + 2 * m1 * q + q * q);
+    m_Bvalues = new ScalarRealType[4];
+
+    m_B1 = m_Bvalues[1] = q * (2 * m0 * m1 + m1 * m1 + m2 * m2 + (2 * m0 + 4 * m1) * q + 3 * q * q) / scale;
+    m_B2 = m_Bvalues[2] = -q * q * (m0 + 2 * m1 + 3 * q) / scale;
+    m_B3 = m_Bvalues[3] = q * q * q / scale;
+
+    ScalarRealType baseB = (m0 * (m1 * m1 + m2 * m2)) / scale;
+    m_B = m_Bvalues[0] = baseB * baseB;
+
+    // M Matrix for initialization on backward pass, from Triggs and Sdika, IEEE TSP
+    m_CPUMatrix = new ScalarRealType[9];
+    const ScalarRealType factor =
+      (1 + m_B1 - m_B2 + m_B3) * (1 - m_B1 - m_B2 - m_B3) * (1 + m_B2 + (m_B1 - m_B3) * m_B3);
+
+    m_CPUMatrix[0] = (-m_B3 * m_B1 + 1 - m_B3 * m_B3 - m_B2) / factor;
+    m_CPUMatrix[1] = ((m_B3 + m_B1) * (m_B2 + m_B3 * m_B1)) / factor;
+    m_CPUMatrix[2] = (m_B3 * (m_B1 + m_B3 * m_B2)) / factor;
+
+    m_CPUMatrix[3] = (m_B1 + m_B3 * m_B2) / factor;
+    m_CPUMatrix[4] = ((1 - m_B2) * (m_B2 + m_B3 * m_B1)) / factor;
+    m_CPUMatrix[5] = (-m_B3 * (m_B3 * m_B1 + m_B3 * m_B3 + m_B2 - 1)) / factor;
+
+    m_CPUMatrix[6] = (m_B3 * m_B1 + m_B2 + m_B1 * m_B1 - m_B2 * m_B2) / factor;
+    m_CPUMatrix[7] =
+      (m_B1 * m_B2 + m_B3 * m_B2 * m_B2 - m_B1 * m_B3 * m_B3 - m_B3 * m_B3 * m_B3 - m_B3 * m_B2 + m_B3) / factor;
+    m_CPUMatrix[8] = (m_B3 * (m_B1 + m_B3 * m_B2)) / factor;
+
+#ifdef VERBOSE
+    for (int i = 0; i < 4; ++i)
+    {
+      std::cout << "B" << i << "  " << m_Bvalues[i] << std::endl;
+    }
+
+    for (int i = 0; i < 9; ++i)
+    {
+      std::cout << "M" << i << "  " << m_CPUMatrix[i] << std::endl;
+    }
+#endif
+    this->AllocateGPUCoefficients();
+    this->Modified();
+  }
+}
+
+template <typename TInputImage, typename TOutputImage>
+void
+GPUSmoothingRecursiveYvvGaussianImageFilter<TInputImage, TOutputImage>::SetInput(const TInputImage * input)
+{
+#ifdef VERBOSE
+  std::cout << telltale << ".   GPUSmoothingRecursiveYvvGaussianImageFilter::SetInput \n";
+#endif
+  // ProcessObject is not const_correct so this const_cast is required
+  ProcessObject::SetNthInput(0, const_cast<TInputImage *>(input));
+
+  inPtr = dynamic_cast<GPUInputImage *>(this->ProcessObject::GetInput(0));
+  inPtr->GetGPUDataManager()->SetBufferFlag(CL_MEM_READ_ONLY);
+
+  m_requestedSize = inPtr->GetRequestedRegion().GetSize();
+
+  itkDebugMacro(<< "GPUSmoothingRecursiveYvvGaussianImageFilter generating data ");
+
+  for (unsigned int d = 0; d < ImageDimension; d++)
+  {
+    if (m_requestedSize[d] < 4)
+    {
+      itkExceptionMacro(
+        "The number of pixels along dimension "
+        << d << " is less than 4. This filter requires a minimum of four pixels along the dimension to be processed.");
+    }
+  }
+}
+
+// Set value of Sigma (isotropic)
+template <typename TInputImage, typename TOutputImage>
+void
+GPUSmoothingRecursiveYvvGaussianImageFilter<TInputImage, TOutputImage>::SetSigma(ScalarRealType sigma)
+{
+#ifdef VERBOSE
+  std::cout << telltale << ". GPUSmoothing::SetSigma: " << sigma << " \n";
+#endif
+  SigmaArrayType sigmas(sigma);
+  this->SetSigmaArray(sigmas);
+}
+
+
+// Set value of Sigma (an-isotropic)
+
+template <typename TInputImage, typename TOutputImage>
+void
+GPUSmoothingRecursiveYvvGaussianImageFilter<TInputImage, TOutputImage>::SetSigmaArray(const SigmaArrayType & sigma)
+{
+#ifdef VERBOSE
+  std::cout << telltale << ". GPUSmoothing::SetSigmaArray" << m_Sigma << " vs new: " << sigma[0] << " \n";
+#endif
+  if (this->m_Sigma != sigma)
+  {
+    this->m_Sigma = sigma;
+
+    const typename InputImageType::SpacingType & pixelSize = this->GetOutput()->GetSpacing();
+    if (pixelSize[0] != 0)
+    {
+#ifdef VERBOSE
+      std::cout << telltale << ". GPUSmoothing::SetSigmaArray. pixelSize: [" << pixelSize[0] << "," << pixelSize[1]
+                << "," << pixelSize[2] << "] \n";
+#endif
+      this->SetUp(pixelSize[0]);
+    }
+    this->Modified();
+  }
+}
+
+
+// Get the sigma array.
+template <typename TInputImage, typename TOutputImage>
+typename GPUSmoothingRecursiveYvvGaussianImageFilter<TInputImage, TOutputImage>::SigmaArrayType
+GPUSmoothingRecursiveYvvGaussianImageFilter<TInputImage, TOutputImage>::GetSigmaArray() const
+{
+  /*#ifdef VERBOSE
+          std::cout<< telltale << ". GPUSmoothing::GetSigmaArray \n";
+  #endif*/
+  return m_Sigma;
+}
+
+
+// Get the sigma scalar. If the sigma is anisotropic, we will just
+// return the sigma along the first dimension.
+template <typename TInputImage, typename TOutputImage>
+typename GPUSmoothingRecursiveYvvGaussianImageFilter<TInputImage, TOutputImage>::ScalarRealType
+GPUSmoothingRecursiveYvvGaussianImageFilter<TInputImage, TOutputImage>::GetSigma() const
+{
+  /*#ifdef VERBOSE
+          std::cout<< telltale << ". GPUSmoothing::GetSigma \n";
+  #endif*/
+  return m_Sigma[0];
+}
+
+
+/**
+ * Set Normalize Across Scale Space
+ */
+template <typename TInputImage, typename TOutputImage>
+void
+GPUSmoothingRecursiveYvvGaussianImageFilter<TInputImage, TOutputImage>::SetNormalizeAcrossScale(bool normalize)
+{
+  /*#ifdef VERBOSE
+          std::cout<< telltale << ". GPUSmoothing::SetNormalizeAcrossScale \n";
+  #endif*/
+  m_NormalizeAcrossScale = normalize;
+  this->Modified();
+}
+
+template <typename TInputImage, typename TOutputImage>
+void
+GPUSmoothingRecursiveYvvGaussianImageFilter<TInputImage, TOutputImage>::GenerateInputRequestedRegion() throw(
+  InvalidRequestedRegionError)
+{
+#ifdef VERBOSE
+  std::cout << telltale << ". GPUSmoothing::GenerateInputRequestedRegion \n";
+#endif
+  // call the superclass' implementation of this method. this should
+  // copy the output requested region to the input requested region
+  Superclass::GenerateInputRequestedRegion();
+
+  // This filter needs all of the input
+  typename GPUSmoothingRecursiveYvvGaussianImageFilter<TInputImage, TOutputImage>::InputImagePointer image =
+    const_cast<InputImageType *>(this->GetInput());
+  if (image)
+  {
+    image->SetRequestedRegion(this->GetInput()->GetLargestPossibleRegion());
+  }
+}
+
+
+template <typename TInputImage, typename TOutputImage>
+void
+GPUSmoothingRecursiveYvvGaussianImageFilter<TInputImage, TOutputImage>::EnlargeOutputRequestedRegion(
+  DataObject * output)
+{
+#ifdef VERBOSE
+  std::cout << telltale << ". GPUSmoothing::EnlargeOutputRequestedRegion \n";
+#endif
+  TOutputImage * out = dynamic_cast<TOutputImage *>(output);
+
+  if (out)
+  {
+    out->SetRequestedRegion(out->GetLargestPossibleRegion());
+  }
+}
+
+
+template <typename TInputImage, typename TOutputImage>
+void
+GPUSmoothingRecursiveYvvGaussianImageFilter<TInputImage, TOutputImage>::AllocateGPUCoefficients()
+{
+#ifdef VERBOSE
+  std::cout << telltale << ".   GPUSmoothingRecursiveYvvGaussianImageFilter::AllocateGPUInputBuffer \n";
+#endif
+
+  m_GPUBCoefficientsDataManager = GPUDataManager::New();
+  m_GPUBCoefficientsDataManager->SetBufferSize(4 * sizeof(ScalarRealType));
+  m_GPUBCoefficientsDataManager->SetCPUBufferPointer(m_Bvalues);
+  m_GPUBCoefficientsDataManager->SetBufferFlag(CL_MEM_READ_ONLY);
+  m_GPUBCoefficientsDataManager->Allocate();
+  if (m_Bvalues)
+  {
+    m_GPUBCoefficientsDataManager->SetGPUDirtyFlag(true);
+  }
+
+  m_GPUMMatrixDataManager = GPUDataManager::New();
+  m_GPUMMatrixDataManager->SetBufferSize(9 * sizeof(ScalarRealType));
+  m_GPUMMatrixDataManager->SetCPUBufferPointer(m_CPUMatrix);
+  m_GPUMMatrixDataManager->SetBufferFlag(CL_MEM_READ_ONLY);
+  m_GPUMMatrixDataManager->Allocate();
+  if (m_CPUMatrix)
+  {
+    m_GPUMMatrixDataManager->SetGPUDirtyFlag(true);
+  }
+}
+
+/**
+ * Compute filter for Gaussian kernel
+ */
+template <typename TInputImage, typename TOutputImage>
+void
+GPUSmoothingRecursiveYvvGaussianImageFilter<TInputImage, TOutputImage>::GPUGenerateData(void)
+{
+#ifdef VERBOSE
+  std::cout << telltale << ".    GPUSmoothing::GPUGenerateData \n";
+#endif
+  if (m_FilterGPUKernelHandle == -1)
+  {
+    this->BuildKernel();
+  }
+
+  const unsigned int X = 0;
+  const unsigned int Y = 1;
+  const unsigned int Z = 2;
+  // arguments set up
+  int       argidx = 0;
+  const int ndim = (int)TInputImage::ImageDimension;
+
+  this->m_GPUKernelManager->SetKernelArgWithImage(m_FilterGPUKernelHandle, argidx++, inPtr->GetGPUDataManager());
+  this->m_GPUKernelManager->SetKernelArgWithImage(m_FilterGPUKernelHandle, argidx++, otPtr->GetGPUDataManager());
+  this->m_GPUKernelManager->SetKernelArgWithImage(m_FilterGPUKernelHandle, argidx++, m_GPUBCoefficientsDataManager);
+  this->m_GPUKernelManager->SetKernelArgWithImage(m_FilterGPUKernelHandle, argidx++, m_GPUMMatrixDataManager);
+
+  for (int i = 0; i < ndim; ++i)
+  {
+    this->m_GPUKernelManager->SetKernelArg(m_FilterGPUKernelHandle, argidx++, sizeof(int), &(m_requestedSize[i]));
+#ifdef VERBOSE
+    std::cout << telltale << ".Arg     " << argidx << ": " << m_requestedSize[i] << "\n";
+#endif
+  }
+
+  const unsigned int dimArg = argidx;
+
+  if (ndim < 3)
+  {
+    int globalSize1D = (m_requestedSize[1] > m_requestedSize[0] ? m_requestedSize[1] : m_requestedSize[0]);
+
+    this->m_GPUKernelManager->SetKernelArg(m_FilterGPUKernelHandle, dimArg, sizeof(unsigned int), &(X));
+#ifdef VERBOSE
+    std::cout << telltale << ". Calling 1D kernel on X.\n";
+#endif
+    this->m_GPUKernelManager->LaunchKernel1D(m_FilterGPUKernelHandle, globalSize1D, 16);
+
+    // change ONLY input and direction of filter
+    this->m_GPUKernelManager->SetKernelArgWithImage(m_FilterGPUKernelHandle, 0, otPtr->GetGPUDataManager());
+    this->m_GPUKernelManager->SetKernelArg(m_FilterGPUKernelHandle, dimArg, sizeof(unsigned int), &(Y));
+#ifdef VERBOSE
+    std::cout << telltale << ". Calling 1D kernel on Y.\n";
+#endif
+    this->m_GPUKernelManager->LaunchKernel1D(m_FilterGPUKernelHandle, globalSize1D, 16);
+  }
+  else
+  {
+    // We must optimize our 2D workgroup sizes to go over our 3D volume in each dimension.
+
+    this->m_GPUKernelManager->SetKernelArg(m_FilterGPUKernelHandle, argidx++, sizeof(unsigned int), &(X));
+#ifdef VERBOSE
+    std::cout << telltale << ". Calling 2D kernel on X.\n";
+#endif
+    this->m_GPUKernelManager->LaunchKernel2D(m_FilterGPUKernelHandle, m_requestedSize[2], m_requestedSize[1], 16, 16);
+
+    // change ONLY input and direction of filter
+    this->m_GPUKernelManager->SetKernelArgWithImage(m_FilterGPUKernelHandle, 0, otPtr->GetGPUDataManager());
+    this->m_GPUKernelManager->SetKernelArg(m_FilterGPUKernelHandle, dimArg, sizeof(unsigned int), &(Y));
+#ifdef VERBOSE
+    std::cout << telltale << ". Calling 2D kernel on Y.\n";
+#endif
+    this->m_GPUKernelManager->LaunchKernel2D(m_FilterGPUKernelHandle, m_requestedSize[0], m_requestedSize[2], 16, 16);
+
+    // input is already pointing to previous output; change ONLY direction of filter
+    this->m_GPUKernelManager->SetKernelArg(m_FilterGPUKernelHandle, dimArg, sizeof(unsigned int), &(Z));
+#ifdef VERBOSE
+    std::cout << telltale << ". Calling 2D kernel on Z.\n";
+#endif
+    this->m_GPUKernelManager->LaunchKernel2D(m_FilterGPUKernelHandle, m_requestedSize[0], m_requestedSize[1], 16, 16);
+  }
+}
+
+
+template <typename TInputImage, typename TOutputImage>
+void
+GPUSmoothingRecursiveYvvGaussianImageFilter<TInputImage, TOutputImage>::PrintSelf(std::ostream & os,
+                                                                                  Indent         indent) const
+{
+  /*#ifdef VERBOSE
+          std::cout<< telltale << ". GPUSmoothing::PrintSelf \n";
+  #endif*/
+  Superclass::PrintSelf(os, indent);
+
+  os << "NormalizeAcrossScale: " << m_NormalizeAcrossScale << std::endl;
+  os << "Sigma: " << m_Sigma << std::endl;
+}
+
+} // end namespace itk
+
+#endif
diff --git a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkRecursiveLineYvvGaussianImageFilter.h b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkRecursiveLineYvvGaussianImageFilter.h
new file mode 100644
index 00000000000..13d35699c80
--- /dev/null
+++ b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkRecursiveLineYvvGaussianImageFilter.h
@@ -0,0 +1,165 @@
+#ifndef _ITK_RECURSIVE_LINE_YVV_GAUSSIAN_IMAGE_FILTER_H_
+#define _ITK_RECURSIVE_LINE_YVV_GAUSSIAN_IMAGE_FILTER_H_
+
+#include "itkImageToImageFilter.h"
+#include "itkNumericTraits.h"
+
+namespace itk
+{
+template <typename TInputImage, typename TOutputImage = TInputImage>
+class ITK_EXPORT RecursiveLineYvvGaussianImageFilter : public ImageToImageFilter<TInputImage, TOutputImage>
+{
+public:
+  /** Standard class typedefs. */
+  typedef RecursiveLineYvvGaussianImageFilter           Self;
+  typedef ImageToImageFilter<TInputImage, TOutputImage> Superclass;
+  typedef SmartPointer<Self>                            Pointer;
+  typedef SmartPointer<const Self>                      ConstPointer;
+
+  /** Method for creation through the object factory. */
+  itkNewMacro(Self);
+
+  /** Type macro that defines a name for this class. */
+  itkTypeMacro(RecursiveLineYvvGaussianImageFilter, ImageToImageFilter);
+
+  /** Smart pointer typedef support.  */
+  typedef typename TInputImage::Pointer      InputImagePointer;
+  typedef typename TInputImage::ConstPointer InputImageConstPointer;
+
+  /** Real type to be used in internal computations. RealType in general is
+   * templated over the pixel type. (For example for vector or tensor pixels,
+   * RealType is a vector or a tensor of doubles.) ScalarRealType is a type
+   * meant for scalars.
+   */
+  typedef typename TInputImage::PixelType InputPixelType;
+#ifdef WITH_DOUBLE
+  typedef typename NumericTraits<InputPixelType>::RealType       RealType;
+  typedef typename NumericTraits<InputPixelType>::ScalarRealType ScalarRealType;
+#else
+  typedef typename NumericTraits<InputPixelType>::FloatType RealType;
+  typedef typename NumericTraits<InputPixelType>::FloatType ScalarRealType;
+#endif
+
+  typedef typename TOutputImage::RegionType OutputImageRegionType;
+
+  /** Type of the input image */
+  typedef TInputImage InputImageType;
+
+  /** Type of the output image */
+  typedef TOutputImage OutputImageType;
+
+  /** Get the direction in which the filter is to be applied. */
+  itkGetConstMacro(Direction, unsigned int);
+
+  /** Set the direction in which the filter is to be applied. */
+  itkSetMacro(Direction, unsigned int);
+
+  /** Set Input Image. */
+  void
+  SetInputImage(const TInputImage *);
+
+  /** Get Input Image. */
+  const TInputImage *
+  GetInputImage(void);
+
+  /** Set/Get the flag for normalizing the gaussian over scale space.
+   When this flag is ON the filter will be normalized in such a way
+   that larger sigmas will not result in the image fading away.
+
+   \f[
+   \frac{ 1 }{ \sqrt{ 2 \pi } };
+   \f]
+
+   When the flag is OFF the normalization will conserve contant the
+   integral of the image intensity.
+   \f[
+   \frac{ 1 }{ \sigma  \sqrt{ 2 \pi } };
+   \f]
+   For analyzing an image across Scale Space you want to enable
+   this flag.  It is disabled by default.  */
+  itkSetMacro(NormalizeAcrossScale, bool);
+  itkGetConstMacro(NormalizeAcrossScale, bool);
+
+  /** Set/Get the Sigma, measured in world coordinates, of the Gaussian
+   * kernel.  The default is 1.0.  */
+  itkGetConstMacro(Sigma, ScalarRealType);
+  itkSetMacro(Sigma, ScalarRealType);
+
+protected:
+  RecursiveLineYvvGaussianImageFilter();
+  virtual ~RecursiveLineYvvGaussianImageFilter() {};
+  void
+  PrintSelf(std::ostream & os, Indent indent) const;
+
+  /** GenerateData (apply) the filter. */
+  void
+  BeforeThreadedGenerateData();
+  void
+  ThreadedGenerateData(const OutputImageRegionType & outputRegionForThread, ThreadIdType threadId);
+
+  unsigned int
+  SplitRequestedRegion(unsigned int i, unsigned int num, OutputImageRegionType & splitRegion);
+
+  /** RecursiveLineYvvGaussianImageFilter needs all of the input only in the
+   *  "Direction" dimension. Therefore we enlarge the output's
+   *  RequestedRegion to this. Then the superclass's
+   *  GenerateInputRequestedRegion method will copy the output region
+   *  to the input.
+   *
+   * \sa ImageToImageFilter::GenerateInputRequestedRegion()
+   */
+  void
+  EnlargeOutputRequestedRegion(DataObject * output);
+
+  /** Set up the coefficients of the filter to approximate a specific kernel.
+   * Typically it can be used to approximate a Gaussian or one of its
+   * derivatives. Parameter is the spacing along the dimension to
+   * filter. */
+  virtual void
+  SetUp(ScalarRealType spacing);
+
+  /** Apply the Recursive Filter to an array of data.  This method is called
+   * for each line of the volume. Parameter "scratch" is a scratch
+   * area used for internal computations that is the same size as the
+   * parameters "outs" and "data". The scratch area must be allocated
+   * outside of this routine (this avoids memory allocation and
+   * deallocation in the inner loop of the overall algorithm. */
+  void
+  FilterDataArray(RealType * outs, const RealType * data, RealType * scratch, unsigned int ln);
+
+protected:
+  /** Causal and anti-causal coefficients that multiply the input data. These are already divided by B0 */
+  ScalarRealType m_B1;
+  ScalarRealType m_B2;
+  ScalarRealType m_B3;
+  ScalarRealType m_B;
+
+  // Initialization matrix for anti-causal pass
+  vnl_matrix<ScalarRealType> m_MMatrix;
+
+private:
+  RecursiveLineYvvGaussianImageFilter(const Self &); // purposely not implemented
+  void
+  operator=(const Self &); // purposely not implemented
+
+  /** Direction in which the filter is to be applied
+   * this should be in the range [0,ImageDimension-1]. */
+  unsigned int m_Direction;
+
+  /** Sigma of the gaussian kernel. */
+  ScalarRealType m_Sigma;
+
+  /** Normalize the image across scale space */
+  bool m_NormalizeAcrossScale;
+  int  telltale; // TODO: REMOVE
+};
+
+
+} // end namespace itk
+
+#ifndef ITK_MANUAL_INSTANTIATION
+#  include "itkRecursiveLineYvvGaussianImageFilter.hxx"
+#endif
+
+
+#endif
diff --git a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkRecursiveLineYvvGaussianImageFilter.hxx b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkRecursiveLineYvvGaussianImageFilter.hxx
new file mode 100644
index 00000000000..228e2452252
--- /dev/null
+++ b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkRecursiveLineYvvGaussianImageFilter.hxx
@@ -0,0 +1,506 @@
+#ifndef _ITK_RECURSIVE_LINE_YVV_GAUSSIAN_IMAGE_FILTER_HXX_
+#define _ITK_RECURSIVE_LINE_YVV_GAUSSIAN_IMAGE_FILTER_HXX_
+
+#include "itkRecursiveLineYvvGaussianImageFilter.h"
+#include "itkObjectFactory.h"
+#include "itkImageLinearIteratorWithIndex.h"
+#include "itkImageLinearConstIteratorWithIndex.h"
+#include "itkProgressReporter.h"
+
+// #define VERBOSE
+
+
+namespace itk
+{
+
+template <typename TInputImage, typename TOutputImage>
+RecursiveLineYvvGaussianImageFilter<TInputImage, TOutputImage>::RecursiveLineYvvGaussianImageFilter()
+{
+  m_Direction = 0;
+  this->SetNumberOfRequiredOutputs(1);
+  this->SetNumberOfRequiredInputs(1);
+
+#ifdef VERBOSE
+  std::cout << "-----------Line filter TYPES\n";
+
+  if (typeid(typename TInputImage::PixelType) == typeid(double))
+    std::cout << "InputPixelType double\n";
+  if (typeid(typename TOutputImage::PixelType) == typeid(double))
+    std::cout << "OutputPixelType double\n";
+
+  if (typeid(ScalarRealType) == typeid(double))
+    std::cout << "ScalarRealType double\n";
+
+  if (typeid(RealType) == typeid(double))
+    std::cout << "RealType double\n";
+
+  /*if( typeid ( InternalRealType ) == typeid ( double ))
+          std::cout<<"InternalRealType double\n"; */
+#endif
+}
+
+
+/**
+ * Set Input Image
+ */
+template <typename TInputImage, typename TOutputImage>
+void
+RecursiveLineYvvGaussianImageFilter<TInputImage, TOutputImage>::SetInputImage(const TInputImage * input)
+{
+  /*#ifdef VERBOSE
+          std::cout<<telltale << ". itkRecursiveLineYvv::setInput \n";
+  #endif*/
+  // ProcessObject is not const_correct so this const_cast is required
+  ProcessObject::SetNthInput(0, const_cast<TInputImage *>(input));
+}
+
+
+/**
+ * Get Input Image
+ */
+template <typename TInputImage, typename TOutputImage>
+const TInputImage *
+RecursiveLineYvvGaussianImageFilter<TInputImage, TOutputImage>::GetInputImage(void)
+{
+  /*#ifdef VERBOSE
+          std::cout<<telltale << ". itkRecursiveLineYvv::getInput \n";
+  #endif*/
+  return dynamic_cast<const TInputImage *>((ProcessObject::GetInput(0)));
+}
+
+/**
+ *   Compute filter for Gaussian kernel.
+ */
+template <typename TInputImage, typename TOutputImage>
+void
+RecursiveLineYvvGaussianImageFilter<TInputImage, TOutputImage>::SetUp(ScalarRealType spacing)
+{
+  /*#ifdef VERBOSE
+          std::cout<<telltale << ". itkRecursiveLineYvv::setUp\n";
+  #endif*/
+  const ScalarRealType sigmad = m_Sigma / spacing;
+
+  // Compute q according to 16 in Young et al on Gabor filering
+  ScalarRealType q = 0;
+  if (sigmad >= 3.556)
+    q = 0.9804 * (sigmad - 3.556) + 2.5091;
+  else
+  {
+    if (sigmad < 0.5)
+      std::cerr << "Too low sigma value (< 0.5), computation will not be precise." << std::endl;
+
+    q = 0.0561 * sigmad * sigmad + 0.5784 * sigmad - 0.2568;
+  }
+
+  // Compute B and B0 to B3 according to Young et al 1995
+  ScalarRealType m0 = 1.16680;
+  ScalarRealType m1 = 1.10783;
+  ScalarRealType m2 = 1.40586;
+  ScalarRealType scale = (m0 + q) * (m1 * m1 + m2 * m2 + 2 * m1 * q + q * q);
+
+  m_B1 = q * (2 * m0 * m1 + m1 * m1 + m2 * m2 + (2 * m0 + 4 * m1) * q + 3 * q * q) / scale;
+  m_B2 = -q * q * (m0 + 2 * m1 + 3 * q) / scale;
+  m_B3 = q * q * q / scale;
+
+  ScalarRealType baseB = (m0 * (m1 * m1 + m2 * m2)) / scale;
+  m_B = baseB * baseB;
+
+  // M Matrix for initialization on backward pass, from Triggs and Sdika, IEEE TSP
+  m_MMatrix = vnl_matrix<ScalarRealType>(3, 3);
+  // const ScalarRealType factor = (1 + m_B1 - m_B2 + m_B3) * (1 - m_B1 - m_B2 - m_B3) * (1 + m_B2 + (m_B1 - m_B3) *
+  // m_B3);
+
+  m_MMatrix(0, 0) = -m_B3 * m_B1 + 1 - m_B3 * m_B3 - m_B2;
+  m_MMatrix(0, 1) = (m_B3 + m_B1) * (m_B2 + m_B3 * m_B1);
+  m_MMatrix(0, 2) = m_B3 * (m_B1 + m_B3 * m_B2);
+
+  m_MMatrix(1, 0) = m_B1 + m_B3 * m_B2;
+  m_MMatrix(1, 1) = (1 - m_B2) * (m_B2 + m_B3 * m_B1);
+  m_MMatrix(1, 2) = -m_B3 * (m_B3 * m_B1 + m_B3 * m_B3 + m_B2 - 1);
+
+  m_MMatrix(2, 0) = m_B3 * m_B1 + m_B2 + m_B1 * m_B1 - m_B2 * m_B2;
+  m_MMatrix(2, 1) = m_B1 * m_B2 + m_B3 * m_B2 * m_B2 - m_B1 * m_B3 * m_B3 - m_B3 * m_B3 * m_B3 - m_B3 * m_B2 + m_B3;
+  m_MMatrix(2, 2) = m_B3 * (m_B1 + m_B3 * m_B2);
+
+  m_MMatrix /= (1 + m_B1 - m_B2 + m_B3) * (1 - m_B1 - m_B2 - m_B3) * (1 + m_B2 + (m_B1 - m_B3) * m_B3);
+
+#ifdef VERBOSE
+  std::cout << "cB   " << m_B << std::endl;
+  std::cout << "cB1  " << m_B1 << std::endl;
+  std::cout << "cB2  " << m_B2 << std::endl;
+  std::cout << "cB3  " << m_B3 << std::endl;
+
+  for (int i = 0; i < 3; ++i)
+  {
+    for (int j = 0; j < 3; ++j)
+    {
+      std::cout << "cM(" << i << "," << j << ")  " << m_MMatrix(i, j) << std::endl;
+    }
+  }
+#endif
+}
+
+/**
+ * Apply Recursive Filter
+ */
+template <typename TInputImage, typename TOutputImage>
+void
+RecursiveLineYvvGaussianImageFilter<TInputImage, TOutputImage>::FilterDataArray(RealType *       outs,
+                                                                                const RealType * data,
+                                                                                RealType *       scratch,
+                                                                                unsigned int     ln)
+{
+  // #ifdef VERBOSE
+  // std::cout<<telltale << ". itkRecursiveLineYvv::filterDataArray \n";
+  // #endif*/
+  /**
+   * Causal direction pass
+   */
+
+  // this value is assumed to exist from the border to infinity.
+  const RealType outV1 = data[0] / (1.0 - m_B1 - m_B2 - m_B3);
+  RealType       sV0 = outV1, sV1 = outV1, sV2 = outV1;
+
+  /**
+   * Recursively filter the rest
+   */
+
+  for (unsigned int i = 0; i < ln; i++)
+  {
+    scratch[i] = RealType(data[i] + sV0 * m_B1 + sV1 * m_B2 + sV2 * m_B3);
+    sV2 = sV1;
+    sV1 = sV0;
+    sV0 = scratch[i];
+  }
+  /**
+   * Store the causal result
+   */
+
+  for (unsigned int i = 0; i < ln; ++i)
+    outs[i] = scratch[i];
+
+
+  // Handle outside values according to Triggs and Sdika
+  const ScalarRealType u_p = data[ln - 1] / (1.0 - m_B1 - m_B2 - m_B3);
+  const ScalarRealType v_p = u_p / (1.0 - m_B1 - m_B2 - m_B3);
+
+  RealType Vn0 = v_p;
+  RealType Vn1 = v_p;
+  RealType Vn2 = v_p;
+  for (unsigned int i = 0; i < 3; ++i)
+  {
+    Vn0 += (outs[ln - 1 - i] - u_p) * m_MMatrix(0, i);
+    Vn1 += (outs[ln - 1 - i] - u_p) * m_MMatrix(1, i);
+    Vn2 += (outs[ln - 1 - i] - u_p) * m_MMatrix(2, i);
+  }
+
+  // This was not in the 2006 Triggs paper but sounds quite logical since m_B is not one
+  Vn0 *= m_B;
+  Vn1 *= m_B;
+  Vn2 *= m_B;
+
+  scratch[ln - 1] = Vn0;
+
+
+  // Recursively filter the rest
+
+  for (int i = ln - 2; i >= 0; i--)
+  {
+    scratch[i] = RealType(outs[i] * m_B + Vn0 * m_B1 + Vn1 * m_B2 + Vn2 * m_B3);
+    Vn2 = Vn1;
+    Vn1 = Vn0;
+    Vn0 = scratch[i];
+  }
+
+  /**
+   * Roll the antiCausal part into the output
+   */
+  for (unsigned int i = 0; i < ln; ++i)
+  {
+    outs[i] = scratch[i];
+  }
+}
+
+
+// we need all of the image in just the "Direction" we are separated into
+template <typename TInputImage, typename TOutputImage>
+void
+RecursiveLineYvvGaussianImageFilter<TInputImage, TOutputImage>::EnlargeOutputRequestedRegion(DataObject * output)
+{
+  /*
+  #ifdef VERBOSE
+          std::cout<<telltale  << ". itkRecursiveLineYvv::EnlargeOutputRequestedRegion \n";
+  #endif
+  */
+  TOutputImage * out = dynamic_cast<TOutputImage *>(output);
+
+  if (out)
+  {
+    OutputImageRegionType         outputRegion = out->GetRequestedRegion();
+    const OutputImageRegionType & largestOutputRegion = out->GetLargestPossibleRegion();
+
+    // verify sane parameter
+    if (this->m_Direction >= outputRegion.GetImageDimension())
+    {
+      itkExceptionMacro("Direction selected for filtering is greater than ImageDimension")
+    }
+
+    // expand output region to match largest in the "Direction" dimension
+    outputRegion.SetIndex(m_Direction, largestOutputRegion.GetIndex(m_Direction));
+    outputRegion.SetSize(m_Direction, largestOutputRegion.GetSize(m_Direction));
+
+    out->SetRequestedRegion(outputRegion);
+  }
+}
+
+
+template <typename TInputImage, typename TOutputImage>
+unsigned int
+RecursiveLineYvvGaussianImageFilter<TInputImage, TOutputImage>::SplitRequestedRegion(
+  unsigned int            i,
+  unsigned int            num,
+  OutputImageRegionType & splitRegion)
+{
+  /*
+  #ifdef VERBOSE
+          std::cout<<telltale  << ". itkRecursiveLineYvv::SplitRequestedRegion \n";
+  #endif
+  */
+  // Get the output pointer
+  OutputImageType *                       outputPtr = this->GetOutput();
+  const typename TOutputImage::SizeType & requestedRegionSize = outputPtr->GetRequestedRegion().GetSize();
+
+  int                              splitAxis;
+  typename TOutputImage::IndexType splitIndex;
+  typename TOutputImage::SizeType  splitSize;
+
+  // Initialize the splitRegion to the output requested region
+  splitRegion = outputPtr->GetRequestedRegion();
+  splitIndex = splitRegion.GetIndex();
+  splitSize = splitRegion.GetSize();
+
+  // split on the outermost dimension available
+  // and avoid the current dimension
+  splitAxis = outputPtr->GetImageDimension() - 1;
+  while (requestedRegionSize[splitAxis] == 1 || splitAxis == (int)m_Direction)
+  {
+    --splitAxis;
+    if (splitAxis < 0)
+    { // cannot split
+      itkDebugMacro("  Cannot Split");
+      return 1;
+    }
+  }
+
+  // determine the actual number of pieces that will be generated
+  typename TOutputImage::SizeType::SizeValueType range = requestedRegionSize[splitAxis];
+  int                                            valuesPerThread = (int)vcl_ceil(range / (double)num);
+  unsigned int                                   maxThreadIdUsed = (int)vcl_ceil(range / (double)valuesPerThread) - 1;
+
+  // Split the region
+  if (i < maxThreadIdUsed)
+  {
+    splitIndex[splitAxis] += i * valuesPerThread;
+    splitSize[splitAxis] = valuesPerThread;
+  }
+  if (i == maxThreadIdUsed)
+  {
+    splitIndex[splitAxis] += i * valuesPerThread;
+    // last thread needs to process the "rest" dimension being split
+    splitSize[splitAxis] = splitSize[splitAxis] - i * valuesPerThread;
+  }
+
+  // set the split region ivars
+  splitRegion.SetIndex(splitIndex);
+  splitRegion.SetSize(splitSize);
+
+  itkDebugMacro("  Split Piece: " << splitRegion);
+
+  return maxThreadIdUsed + 1;
+}
+
+
+template <typename TInputImage, typename TOutputImage>
+void
+RecursiveLineYvvGaussianImageFilter<TInputImage, TOutputImage>::BeforeThreadedGenerateData()
+{
+  /*
+  #ifdef VERBOSE
+          std::cout<<telltale  << ". itkRecursiveLineYvv::BeforeThreadedGenerateData \n";
+  #endif
+  */
+  typedef ImageRegion<TInputImage::ImageDimension> RegionType;
+
+  typename TInputImage::ConstPointer inputImage(this->GetInputImage());
+  typename TOutputImage::Pointer     outputImage(this->GetOutput());
+
+  const unsigned int imageDimension = inputImage->GetImageDimension();
+
+  if (this->m_Direction >= imageDimension)
+  {
+    itkExceptionMacro("Direction selected for filtering is greater than ImageDimension");
+  }
+
+  const typename InputImageType::SpacingType & pixelSize = inputImage->GetSpacing();
+
+  this->SetUp(pixelSize[m_Direction]);
+
+  RegionType region = outputImage->GetRequestedRegion();
+
+  const unsigned int ln = region.GetSize()[this->m_Direction];
+
+  if (ln < 4)
+  {
+    itkExceptionMacro(
+      "The number of pixels along direction "
+      << this->m_Direction
+      << " is less than 4. This filter requires a minimum of four pixels along the dimension to be processed.");
+  }
+}
+
+
+/**
+ * Compute Recursive filter
+ * line by line in one of the dimensions
+ */
+template <typename TInputImage, typename TOutputImage>
+void
+RecursiveLineYvvGaussianImageFilter<TInputImage, TOutputImage>::ThreadedGenerateData(
+  const OutputImageRegionType & outputRegionForThread,
+  ThreadIdType                  threadId)
+{
+  /*
+  #ifdef VERBOSE
+          std::cout <<telltale  << ". itkRecursiveLineYvv::ThreadedGenerateData \n";
+  #endif
+  */
+  typedef typename TOutputImage::PixelType OutputPixelType;
+
+  typedef ImageLinearConstIteratorWithIndex<TInputImage> InputConstIteratorType;
+  typedef ImageLinearIteratorWithIndex<TOutputImage>     OutputIteratorType;
+
+  typedef ImageRegion<TInputImage::ImageDimension> RegionType;
+
+  typename TInputImage::ConstPointer inputImage(this->GetInputImage());
+  typename TOutputImage::Pointer     outputImage(this->GetOutput());
+
+  RegionType region = outputRegionForThread;
+
+  InputConstIteratorType inputIterator(inputImage, region);
+  OutputIteratorType     outputIterator(outputImage, region);
+
+  inputIterator.SetDirection(this->m_Direction);
+  outputIterator.SetDirection(this->m_Direction);
+
+
+  const unsigned int ln = region.GetSize()[this->m_Direction];
+
+  RealType * inps = 0;
+  RealType * outs = 0;
+  RealType * scratch = 0;
+
+  try
+  {
+    inps = new RealType[ln];
+  }
+  catch (std::bad_alloc &)
+  {
+    itkExceptionMacro("Problem allocating memory for internal computations");
+  }
+
+  try
+  {
+    outs = new RealType[ln];
+  }
+  catch (std::bad_alloc &)
+  {
+    delete[] inps;
+    itkExceptionMacro("Problem allocating memory for internal computations");
+  }
+
+  try
+  {
+    scratch = new RealType[ln];
+  }
+  catch (std::bad_alloc &)
+  {
+    delete[] inps;
+    delete[] outs;
+    itkExceptionMacro("Problem allocating memory for internal computations");
+  }
+
+  inputIterator.GoToBegin();
+  outputIterator.GoToBegin();
+
+  const typename TInputImage::OffsetValueType * offsetTable = inputImage->GetOffsetTable();
+
+  const unsigned int numberOfLinesToProcess = offsetTable[TInputImage::ImageDimension] / ln;
+  ProgressReporter   progress(this, threadId, numberOfLinesToProcess, 10);
+
+
+  try // this try is intended to catch an eventual AbortException.
+  {
+    while (!inputIterator.IsAtEnd() && !outputIterator.IsAtEnd())
+    {
+      unsigned int i = 0;
+      while (!inputIterator.IsAtEndOfLine())
+      {
+        inps[i++] = inputIterator.Get();
+        ++inputIterator;
+      }
+
+      this->FilterDataArray(outs, inps, scratch, ln);
+
+      unsigned int j = 0;
+      while (!outputIterator.IsAtEndOfLine())
+      {
+        outputIterator.Set(static_cast<OutputPixelType>(outs[j++]));
+        ++outputIterator;
+      }
+
+      inputIterator.NextLine();
+      outputIterator.NextLine();
+
+      // Although the method name is CompletedPixel(),
+      // this is being called after each line is processed
+      progress.CompletedPixel();
+    }
+  }
+  catch (ProcessAborted &)
+  {
+    // User aborted filter excecution Here we catch an exception thrown by the
+    // progress reporter and rethrow it with the correct line number and file
+    // name. We also invoke AbortEvent in case some observer was interested on
+    // it.
+    // release locally allocated memory
+    delete[] outs;
+    delete[] inps;
+    delete[] scratch;
+    // Throw the final exception.
+    ProcessAborted e(__FILE__, __LINE__);
+    e.SetDescription("Process aborted.");
+    e.SetLocation(ITK_LOCATION);
+    throw e;
+  }
+
+  delete[] outs;
+  delete[] inps;
+  delete[] scratch;
+}
+
+
+template <typename TInputImage, typename TOutputImage>
+void
+RecursiveLineYvvGaussianImageFilter<TInputImage, TOutputImage>::PrintSelf(std::ostream & os, Indent indent) const
+{
+  /*#ifdef VERBOSE
+          std::cout<<telltale  << ". itkRecursiveLineYvv::PrintSelf \n";
+  #endif*/
+  Superclass::PrintSelf(os, indent);
+
+  os << indent << "Direction: " << m_Direction << std::endl;
+}
+
+} // end namespace itk
+
+#endif
diff --git a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkSmoothingRecursiveYvvGaussianImageFilter.h b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkSmoothingRecursiveYvvGaussianImageFilter.h
new file mode 100644
index 00000000000..f89f0c0a6eb
--- /dev/null
+++ b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkSmoothingRecursiveYvvGaussianImageFilter.h
@@ -0,0 +1,153 @@
+
+#ifndef _ITK_SMOOTHING_RECURSIVE_YVV_GAUSSIAN_IMAGE_FILTER_H_
+#define _ITK_SMOOTHING_RECURSIVE_YVV_GAUSSIAN_IMAGE_FILTER_H_
+
+#include "itkRecursiveLineYvvGaussianImageFilter.h"
+#include "itkCastImageFilter.h"
+#include "itkImage.h"
+#include "itkPixelTraits.h"
+#include "itkCommand.h"
+#include "itkFixedArray.h"
+
+
+namespace itk
+{
+
+template <typename TInputImage, typename TOutputImage = TInputImage>
+class ITK_EXPORT SmoothingRecursiveYvvGaussianImageFilter : public ImageToImageFilter<TInputImage, TOutputImage>
+{
+public:
+  /** Standard class typedefs. */
+  typedef SmoothingRecursiveYvvGaussianImageFilter      Self;
+  typedef ImageToImageFilter<TInputImage, TOutputImage> Superclass;
+  typedef SmartPointer<Self>                            Pointer;
+  typedef SmartPointer<const Self>                      ConstPointer;
+
+
+  /** Pixel Type of the input image */
+  typedef TInputImage                     InputImageType;
+  typedef TOutputImage                    OutputImageType;
+  typedef typename TInputImage::PixelType PixelType;
+#ifdef WITH_DOUBLE
+  typedef typename NumericTraits<PixelType>::RealType       RealType;
+  typedef typename NumericTraits<PixelType>::ScalarRealType ScalarRealType;
+#else
+  typedef typename NumericTraits<PixelType>::FloatType RealType;
+  typedef typename NumericTraits<PixelType>::FloatType ScalarRealType;
+#endif
+
+  /** Runtime information support. */
+  itkTypeMacro(SmoothingRecursiveYvvGaussianImageFilter, ImageToImageFilter);
+
+  /** Image dimension. */
+  itkStaticConstMacro(ImageDimension, unsigned int, TInputImage::ImageDimension);
+
+  /** Define the type for the sigma array */
+  typedef FixedArray<ScalarRealType, itkGetStaticConstMacro(ImageDimension)> SigmaArrayType;
+
+  /** Define the image type for internal computations
+   RealType is usually 'double' in NumericTraits.
+   Here we prefer float in order to save memory.  */
+
+  typedef typename NumericTraits<PixelType>::FloatType                    InternalRealType;
+  typedef Image<InternalRealType, itkGetStaticConstMacro(ImageDimension)> RealImageType;
+
+  /**  The first in the pipeline  */
+  typedef RecursiveLineYvvGaussianImageFilter<InputImageType, RealImageType> FirstGaussianFilterType;
+
+  /**  Smoothing filter type */
+  typedef RecursiveLineYvvGaussianImageFilter<RealImageType, RealImageType> InternalGaussianFilterType;
+
+  /**  The last in the pipeline  */
+  typedef CastImageFilter<RealImageType, OutputImageType> CastingFilterType;
+
+
+  /**  Pointer to a gaussian filter.  */
+  typedef typename InternalGaussianFilterType::Pointer InternalGaussianFilterPointer;
+
+  /**  Pointer to the first gaussian filter.  */
+  typedef typename FirstGaussianFilterType::Pointer FirstGaussianFilterPointer;
+
+  /**  Pointer to the last filter, casting  */
+  typedef typename CastingFilterType::Pointer CastingFilterPointer;
+
+  /**  Pointer to the Output Image */
+  typedef typename OutputImageType::Pointer OutputImagePointer;
+
+  /** Method for creation through the object factory. */
+  itkNewMacro(Self);
+
+  /** Set Sigma value. Sigma is measured in the units of image spacing. You
+   may use the method SetSigma to set the same value across each axis or
+   use the method SetSigmaArray if you need different values along each
+   axis. */
+  void
+  SetSigmaArray(const SigmaArrayType & sigmas);
+  void
+  SetSigma(ScalarRealType sigma);
+  SigmaArrayType
+  GetSigmaArray() const;
+  ScalarRealType
+  GetSigma() const;
+
+  /** Define which normalization factor will be used for the Gaussian */
+  void
+  SetNormalizeAcrossScale(bool normalizeInScaleSpace);
+  itkGetConstMacro(NormalizeAcrossScale, bool);
+
+  void
+  SetNumberOfThreads(int nb);
+  using Superclass::SetNumberOfThreads;
+
+#ifdef ITK_USE_CONCEPT_CHECKING
+  /** Begin concept checking */
+  itkConceptMacro(InputHasNumericTraitsCheck, (Concept::HasNumericTraits<PixelType>));
+  /** End concept checking */
+#endif
+
+protected:
+  SmoothingRecursiveYvvGaussianImageFilter();
+  virtual ~SmoothingRecursiveYvvGaussianImageFilter() {};
+  void
+  PrintSelf(std::ostream & os, Indent indent) const;
+
+  /** Generate Data */
+  void
+  GenerateData(void);
+
+  /** SmoothingRecursiveYvvGaussianImageFilter needs all of the input to produce an
+   * output. Therefore, SmoothingRecursiveYvvGaussianImageFilter needs to provide
+   * an implementation for GenerateInputRequestedRegion in order to inform
+   * the pipeline execution model.
+   * \sa ImageToImageFilter::GenerateInputRequestedRegion() */
+  virtual void
+  GenerateInputRequestedRegion() throw(InvalidRequestedRegionError);
+
+  // Override since the filter produces the entire dataset
+  void
+  EnlargeOutputRequestedRegion(DataObject * output);
+
+private:
+  SmoothingRecursiveYvvGaussianImageFilter(const Self &); // purposely not implemented
+  void
+  operator=(const Self &); // purposely not implemented
+
+  InternalGaussianFilterPointer m_SmoothingFilters[ImageDimension - 1];
+  FirstGaussianFilterPointer    m_FirstSmoothingFilter;
+  CastingFilterPointer          m_CastingFilter;
+
+  /** Normalize the image across scale space */
+  bool m_NormalizeAcrossScale;
+
+  /** Standard deviation of the gaussian used for smoothing */
+  SigmaArrayType m_Sigma;
+  int            telltale; // TODO: REMOVE
+};
+
+} // end namespace itk
+
+#ifndef ITK_MANUAL_INSTANTIATION
+#  include "itkSmoothingRecursiveYvvGaussianImageFilter.hxx"
+#endif
+
+#endif
diff --git a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkSmoothingRecursiveYvvGaussianImageFilter.hxx b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkSmoothingRecursiveYvvGaussianImageFilter.hxx
new file mode 100644
index 00000000000..b142ffb6e8f
--- /dev/null
+++ b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkSmoothingRecursiveYvvGaussianImageFilter.hxx
@@ -0,0 +1,282 @@
+#ifndef _ITK_SMOOTHING_RECURSIVE_YVV_GAUSSIAN_IMAGE_FILTER_HXX_
+#define _ITK_SMOOTHING_RECURSIVE_YVV_GAUSSIAN_IMAGE_FILTER_HXX_
+
+#include "itkSmoothingRecursiveYvvGaussianImageFilter.h"
+#include "itkImageRegionIteratorWithIndex.h"
+#include "itkProgressAccumulator.h"
+
+// #define VERBOSE
+
+namespace itk
+{
+
+/**
+ * Constructor
+ */
+template <typename TInputImage, typename TOutputImage>
+SmoothingRecursiveYvvGaussianImageFilter<TInputImage, TOutputImage>::SmoothingRecursiveYvvGaussianImageFilter()
+{
+  /*#ifdef VERBOSE
+          telltale = rand();
+          std::cout<<telltale << ". itkSmoothingYvv::constructor \n";
+  #endif*/
+  m_NormalizeAcrossScale = false;
+
+  m_FirstSmoothingFilter = FirstGaussianFilterType::New();
+  m_FirstSmoothingFilter->SetDirection(0);
+  m_FirstSmoothingFilter->SetNormalizeAcrossScale(m_NormalizeAcrossScale);
+  m_FirstSmoothingFilter->ReleaseDataFlagOn();
+
+  for (unsigned int i = 0; i < ImageDimension - 1; i++)
+  {
+    m_SmoothingFilters[i] = InternalGaussianFilterType::New();
+    m_SmoothingFilters[i]->SetNormalizeAcrossScale(m_NormalizeAcrossScale);
+    m_SmoothingFilters[i]->SetDirection(i + 1);
+    m_SmoothingFilters[i]->ReleaseDataFlagOn();
+  }
+
+  m_SmoothingFilters[0]->SetInput(m_FirstSmoothingFilter->GetOutput());
+  for (unsigned int i = 1; i < ImageDimension - 1; i++)
+  {
+    m_SmoothingFilters[i]->SetInput(m_SmoothingFilters[i - 1]->GetOutput());
+  }
+
+  m_CastingFilter = CastingFilterType::New();
+  m_CastingFilter->SetInput(m_SmoothingFilters[ImageDimension - 2]->GetOutput());
+
+  //
+  // NB: We must call SetSigma in order to initialize the smoothing
+  // filters with the default scale.  However, m_Sigma must first be
+  // initialized (it is used inside SetSigma) and it must be different
+  // from 1.0 or the call will be ignored.
+  this->m_Sigma.Fill(0.0);
+  this->SetSigma(1.0);
+
+#ifdef VERBOSE
+  std::cout << "-----------Smoothing filter TYPES\n";
+
+  if (typeid(typename TInputImage::PixelType) == typeid(double))
+    std::cout << "PixelType double\n";
+  if (typeid(typename TOutputImage::PixelType) == typeid(double))
+    std::cout << "Output PixelType double\n";
+
+  if (typeid(ScalarRealType) == typeid(double))
+    std::cout << "ScalarRealType double\n";
+
+  if (typeid(RealType) == typeid(double))
+    std::cout << "RealType double\n";
+
+  if (typeid(InternalRealType) == typeid(double))
+    std::cout << "InternalRealType double\n";
+
+#endif
+}
+
+
+template <typename TInputImage, typename TOutputImage>
+void
+SmoothingRecursiveYvvGaussianImageFilter<TInputImage, TOutputImage>::SetNumberOfThreads(int nb)
+{
+  /*#ifdef VERBOSE
+          std::cout<<telltale  << ". itkSmoothingYvv::SetNumberOfThreads \n";
+  #endif*/
+  Superclass::SetNumberOfThreads(nb);
+  for (unsigned int i = 0; i < ImageDimension - 1; i++)
+  {
+    m_SmoothingFilters[i]->SetNumberOfThreads(nb);
+  }
+  m_FirstSmoothingFilter->SetNumberOfThreads(nb);
+}
+
+
+// Set value of Sigma (isotropic)
+
+template <typename TInputImage, typename TOutputImage>
+void
+SmoothingRecursiveYvvGaussianImageFilter<TInputImage, TOutputImage>::SetSigma(ScalarRealType sigma)
+{
+  /*#ifdef VERBOSE
+          std::cout<<telltale  << ". itkSmoothingYvv::SetSigma \n";
+  #endif*/
+  SigmaArrayType sigmas(sigma);
+  this->SetSigmaArray(sigmas);
+}
+
+
+// Set value of Sigma (an-isotropic)
+
+template <typename TInputImage, typename TOutputImage>
+void
+SmoothingRecursiveYvvGaussianImageFilter<TInputImage, TOutputImage>::SetSigmaArray(const SigmaArrayType & sigma)
+{
+  /*#ifdef VERBOSE
+          std::cout<<telltale  << ". itkSmoothingYvv::SetSigmaArray \n";
+  #endif*/
+  if (this->m_Sigma != sigma)
+  {
+    this->m_Sigma = sigma;
+    for (unsigned int i = 0; i < ImageDimension - 1; i++)
+    {
+      m_SmoothingFilters[i]->SetSigma(m_Sigma[i + 1]);
+      m_SmoothingFilters[i]->Modified();
+    }
+    m_FirstSmoothingFilter->SetSigma(m_Sigma[0]);
+    m_FirstSmoothingFilter->Modified();
+
+    this->Modified();
+  }
+}
+
+
+// Get the sigma array.
+template <typename TInputImage, typename TOutputImage>
+typename SmoothingRecursiveYvvGaussianImageFilter<TInputImage, TOutputImage>::SigmaArrayType
+SmoothingRecursiveYvvGaussianImageFilter<TInputImage, TOutputImage>::GetSigmaArray() const
+{
+  /*#ifdef VERBOSE
+          std::cout<<telltale  << ". itkSmoothingYvv::GetSigmaArray \n";
+  #endif*/
+  return m_Sigma;
+}
+
+
+// Get the sigma scalar. If the sigma is anisotropic, we will just
+// return the sigma along the first dimension.
+template <typename TInputImage, typename TOutputImage>
+typename SmoothingRecursiveYvvGaussianImageFilter<TInputImage, TOutputImage>::ScalarRealType
+SmoothingRecursiveYvvGaussianImageFilter<TInputImage, TOutputImage>::GetSigma() const
+{
+  /*#ifdef VERBOSE
+          std::cout<<telltale  << ". itkSmoothingYvv::GetSigma \n";
+  #endif*/
+  return m_Sigma[0];
+}
+
+
+/**
+ * Set Normalize Across Scale Space
+ */
+template <typename TInputImage, typename TOutputImage>
+void
+SmoothingRecursiveYvvGaussianImageFilter<TInputImage, TOutputImage>::SetNormalizeAcrossScale(bool normalize)
+{
+  /*#ifdef VERBOSE
+          std::cout<<telltale  << ". itkSmoothingYvv::SetNormalizeAcrossScale \n";
+  #endif*/
+  m_NormalizeAcrossScale = normalize;
+
+  for (unsigned int i = 0; i < ImageDimension - 1; i++)
+  {
+    m_SmoothingFilters[i]->SetNormalizeAcrossScale(normalize);
+  }
+  m_FirstSmoothingFilter->SetNormalizeAcrossScale(normalize);
+
+  this->Modified();
+}
+
+
+//
+//
+//
+template <typename TInputImage, typename TOutputImage>
+void
+SmoothingRecursiveYvvGaussianImageFilter<TInputImage, TOutputImage>::GenerateInputRequestedRegion() throw(
+  InvalidRequestedRegionError)
+{
+  /*#ifdef VERBOSE
+          std::cout<<telltale  << ". itkSmoothingYvv::GenerateInputRequestedRegion \n";
+  #endif*/
+  // call the superclass' implementation of this method. this should
+  // copy the output requested region to the input requested region
+  Superclass::GenerateInputRequestedRegion();
+
+  // This filter needs all of the input
+  typename SmoothingRecursiveYvvGaussianImageFilter<TInputImage, TOutputImage>::InputImagePointer image =
+    const_cast<InputImageType *>(this->GetInput());
+  if (image)
+  {
+    image->SetRequestedRegion(this->GetInput()->GetLargestPossibleRegion());
+  }
+}
+
+template <typename TInputImage, typename TOutputImage>
+void
+SmoothingRecursiveYvvGaussianImageFilter<TInputImage, TOutputImage>::EnlargeOutputRequestedRegion(DataObject * output)
+{
+  /*#ifdef VERBOSE
+          std::cout<<telltale  << ". itkSmoothingYvv::EnlargeOutputRequestedRegion \n";
+  #endif*/
+  TOutputImage * out = dynamic_cast<TOutputImage *>(output);
+
+  if (out)
+  {
+    out->SetRequestedRegion(out->GetLargestPossibleRegion());
+  }
+}
+
+/**
+ * Compute filter for Gaussian kernel
+ */
+template <typename TInputImage, typename TOutputImage>
+void
+SmoothingRecursiveYvvGaussianImageFilter<TInputImage, TOutputImage>::GenerateData(void)
+{
+  /*#ifdef VERBOSE
+          std::cout<<telltale  << ". itkSmoothingYvv::GenerateData \n";
+  #endif*/
+  itkDebugMacro(<< "SmoothingRecursiveYvvGaussianImageFilter generating data ");
+
+  const typename TInputImage::ConstPointer inputImage(this->GetInput());
+
+  const typename TInputImage::RegionType region = inputImage->GetRequestedRegion();
+  const typename TInputImage::SizeType   size = region.GetSize();
+
+  for (unsigned int d = 0; d < ImageDimension; d++)
+  {
+    if (size[d] < 4)
+    {
+      itkExceptionMacro(
+        "The number of pixels along dimension "
+        << d << " is less than 4. This filter requires a minimum of four pixels along the dimension to be processed.");
+    }
+  }
+
+
+  // Create a process accumulator for tracking the progress of this minipipeline
+  ProgressAccumulator::Pointer progress = ProgressAccumulator::New();
+  progress->SetMiniPipelineFilter(this);
+
+  // Register the filter with the with progress accumulator using
+  // equal weight proportion
+  for (unsigned int i = 0; i < ImageDimension - 1; i++)
+  {
+    progress->RegisterInternalFilter(m_SmoothingFilters[i], 1.0 / (ImageDimension));
+  }
+
+  progress->RegisterInternalFilter(m_FirstSmoothingFilter, 1.0 / (ImageDimension));
+  m_FirstSmoothingFilter->SetInput(inputImage);
+  // graft our output to the internal filter to force the proper regions
+  // to be generated
+  m_CastingFilter->GraftOutput(this->GetOutput());
+  m_CastingFilter->Update();
+  this->GraftOutput(m_CastingFilter->GetOutput());
+}
+
+
+template <typename TInputImage, typename TOutputImage>
+void
+SmoothingRecursiveYvvGaussianImageFilter<TInputImage, TOutputImage>::PrintSelf(std::ostream & os, Indent indent) const
+{
+  /*#ifdef VERBOSE
+          std::cout<<telltale  << ". itkSmoothingYvv::PrintSelf \n";
+  #endif*/
+  Superclass::PrintSelf(os, indent);
+
+  os << "NormalizeAcrossScale: " << m_NormalizeAcrossScale << std::endl;
+  os << "Sigma: " << m_Sigma << std::endl;
+}
+
+
+} // end namespace itk
+
+#endif
diff --git a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/itk-module.cmake b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/itk-module.cmake
new file mode 100644
index 00000000000..1efa50fdc5e
--- /dev/null
+++ b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/itk-module.cmake
@@ -0,0 +1,33 @@
+set(DOCUMENTATION "This module contains a collection of classes for performing
+recursive gaussian filtering (Young Van Vliet implementation).")
+
+#MESSAGE(STATUS "Using GPU: ${ITK_USE_GPU}")
+
+if(ITK_USE_GPU)
+    itk_module(ITKSmoothingRecursiveYvvGaussianFilter
+     DEPENDS
+        ITKCommon
+        ITKIOImageBase
+        ITKImageFilterBase
+        ITKSmoothing
+        ITKGPUSmoothing
+        ITKGPUCommon
+     TEST_DEPENDS
+        ITKTestKernel #to handle IO in src
+        ITKGPUCommon
+       DESCRIPTION
+         "${DOCUMENTATION}"
+    )
+else()
+    itk_module(ITKSmoothingRecursiveYvvGaussianFilter
+     DEPENDS
+        ITKCommon
+        ITKIOImageBase
+        ITKImageFilterBase
+        ITKSmoothing
+     TEST_DEPENDS
+        ITKTestKernel #to handle IO in src
+       DESCRIPTION
+         "${DOCUMENTATION}"
+    )
+endif()
diff --git a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/src/CMakeLists.txt b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/src/CMakeLists.txt
new file mode 100644
index 00000000000..4643d684d59
--- /dev/null
+++ b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/src/CMakeLists.txt
@@ -0,0 +1,28 @@
+if (ITK_USE_GPU)
+
+   if(GPU_HANDLES_DOUBLE)
+       add_definitions(-DWITH_DOUBLE)
+   endif()
+
+	set(GPU_SRC
+	)
+
+	set(GPU_Kernels
+	GPUSmoothingRecursiveYvvGaussianImageFilter.cl
+	)
+
+	#essentially a #define GPU.
+	add_definitions(-DGPU)
+
+    if(NVIDIA_GPU)
+        add_definitions(-DNVIDIA)
+    endif()
+
+	write_gpu_kernels("${GPU_Kernels}" GPU_SRC)
+
+	add_library(ITKSmoothingRecursiveYvvGaussianFilter ${GPU_SRC})
+	target_link_libraries(ITKSmoothingRecursiveYvvGaussianFilter ${INRIA_ITK_LIBRARIES} ${OPENCL_LIBRARIES} )
+
+    #itk_module_target(ITKSmoothingRecursiveYvvGaussianFilter)
+
+endif()
diff --git a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/src/GPUSmoothingRecursiveYvvGaussianImageFilter.cl b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/src/GPUSmoothingRecursiveYvvGaussianImageFilter.cl
new file mode 100644
index 00000000000..727d6ad7440
--- /dev/null
+++ b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/src/GPUSmoothingRecursiveYvvGaussianImageFilter.cl
@@ -0,0 +1,235 @@
+/*=========================================================================
+ *
+ *  Copyright Insight Software Consortium
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *         http://www.apache.org/licenses/LICENSE-2.0.txt
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ *
+ *=========================================================================*/
+
+#define BLOCK_DIM 16 // set by ITK for 2D
+
+// Basic filtering brick, used both for
+// 1D filtering of 2D images
+// and for 2D filtering of 3D volumes
+
+__kernel void
+partialFilter(const __global INPIXELTYPE * data,
+              __global OUTPIXELTYPE *      outs,
+              __constant REALTYPE *        Bvalues,
+              __constant REALTYPE *        MMatrix,
+              unsigned int                 start,
+              unsigned int                 step,
+              unsigned int                 length)
+{
+  REALTYPE       scratch[MAX_LINE_LENGTH];
+  const REALTYPE outV1 = data[start] / (1.0 - Bvalues[1] - Bvalues[2] - Bvalues[3]);
+  REALTYPE       sV0 = outV1, sV1 = outV1, sV2 = outV1;
+
+  // Unrolling does not work well here (truly recursive).
+  for (unsigned int i = 0; i < length; i++)
+  {
+    scratch[i] = (REALTYPE)(data[start + i * step] + sV0 * Bvalues[1] + sV1 * Bvalues[2] + sV2 * Bvalues[3]);
+
+    sV2 = sV1;
+    sV1 = sV0;
+    sV0 = scratch[i];
+  }
+
+  const REALTYPE remB = (1.0 - Bvalues[1] - Bvalues[2] - Bvalues[3]);
+  const REALTYPE u_p = data[start + (length - 1) * step] / remB;
+  const REALTYPE v_p = u_p / remB;
+
+  // Unrolling the loops explicitly helps on certain compilers (e.g. ATI/AMD architecture) and does not
+  // worsen performance on NVidia GPUs, for which the compiler has been reported to unroll the loops by default).
+  REALTYPE Vn0 = (REALTYPE)(v_p //;
+                            + (scratch[length - 1] - u_p) * MMatrix[0] + (scratch[length - 2] - u_p) * MMatrix[1] +
+                            (scratch[length - 3] - u_p) * MMatrix[2]);
+  REALTYPE Vn1 = (REALTYPE)(v_p //;
+                            + (scratch[length - 1] - u_p) * MMatrix[3] + (scratch[length - 2] - u_p) * MMatrix[4] +
+                            (scratch[length - 3] - u_p) * MMatrix[5]);
+
+  REALTYPE Vn2 = (REALTYPE)(v_p //;
+                            + (scratch[length - 1] - u_p) * MMatrix[6] + (scratch[length - 2] - u_p) * MMatrix[7] +
+                            (scratch[length - 3] - u_p) * MMatrix[8]);
+
+  /*REALTYPE Vn0 = v_p;
+  REALTYPE Vn1 = v_p;
+  REALTYPE Vn2 = v_p;
+
+  //#pragma unroll 3
+  for (unsigned int i = 0;i < 3;++i)
+  {
+      Vn0 += (scratch[length - 1 - i] - u_p) * MMatrix[i];
+      Vn1 += (scratch[length - 1 - i] - u_p) * MMatrix[3+i];
+      Vn2 += (scratch[length - 1 - i] - u_p) * MMatrix[6+i];
+  }*/
+
+  // This was not in the 2006 Triggs paper but sounds quite logical since m_B is not one
+  Vn0 *= Bvalues[0];
+  Vn1 *= Bvalues[0];
+  Vn2 *= Bvalues[0];
+
+  scratch[length - 1] = Vn0;
+
+  // Very bad idea to unroll here as well (see causal pass).
+  for (int i = length - 2; i >= 0; i--)
+  {
+    scratch[i] = (REALTYPE)(scratch[i] * Bvalues[0] + Vn0 * Bvalues[1] + Vn1 * Bvalues[2] + Vn2 * Bvalues[3]);
+    Vn2 = Vn1;
+    Vn1 = Vn0;
+    Vn0 = scratch[i];
+  }
+
+// Roll the anticausal part into the output
+#pragma unroll 16
+  for (unsigned int i = 0; i < length; ++i)
+  {
+    outs[start + i * step] = (OUTPIXELTYPE)(scratch[i]);
+  }
+}
+
+/*
+#ifdef DIM_1
+//This means (recursively) filtering values in one single vector.
+//Code present only for completeness (1D->3D).
+__kernel void YvvFilter(__global const INPIXELTYPE* data,
+                        __global OUTPIXELTYPE* outs,
+                        __constant REALTYPE* m_Bvalues,
+                        __constant REALTYPE* m_MMatrix,
+                        int sizeX )
+{
+    if (sizeX>MAX_LINE_LENGTH) {return;}
+
+    int gix = get_global_id(0);
+
+    if(gix == 0)
+    {
+        partialFilter(data, outs, m_Bvalues, m_MMatrix, 0, 1, sizeX);
+    }
+
+    return;
+}
+
+#endif
+*/
+
+#ifdef DIM_2
+
+__kernel void
+YvvFilter(const __global INPIXELTYPE * data,
+          __global OUTPIXELTYPE *      outs,
+          __constant REALTYPE *        m_Bvalues,
+          __constant REALTYPE *        m_MMatrix,
+          int                          sizeX,
+          int                          sizeY,
+          unsigned int                 dim)
+{
+  if (sizeX > MAX_LINE_LENGTH || sizeY > MAX_LINE_LENGTH)
+  {
+    return;
+  }
+
+  int WIDTH = sizeX;
+  int HEIGHT = sizeY;
+
+  int gix = get_global_id(0);
+
+  switch (dim)
+  {
+    case 0: // X
+      if (gix < HEIGHT)
+      {
+        // start= (id(0)*height + id(1))*width + 0;
+        partialFilter(data, outs, m_Bvalues, m_MMatrix, gix * WIDTH, 1, WIDTH);
+      }
+      break;
+    case 1: // Y
+      if (gix < WIDTH)
+      {
+        // start= (id(1)*height + 0)*width + id(0);
+        partialFilter(data, outs, m_Bvalues, m_MMatrix, gix, WIDTH, HEIGHT);
+      }
+      break;
+  }
+  return;
+}
+
+#endif
+
+
+#ifdef DIM_3
+
+__kernel void
+YvvFilter(const __global INPIXELTYPE * data,
+          __global OUTPIXELTYPE *      outs,
+          __constant REALTYPE *        m_Bvalues,
+          __constant REALTYPE *        m_MMatrix,
+          int                          sizeX,
+          int                          sizeY,
+          int                          sizeZ,
+          unsigned int                 dim // to know which dimension to do
+)
+{
+  if (sizeX > MAX_LINE_LENGTH || sizeY > MAX_LINE_LENGTH)
+  {
+    return;
+  }
+
+  int WIDTH = sizeX;
+  int HEIGHT = sizeY;
+  int DEPTH = sizeZ;
+
+  int gix = get_global_id(0);
+  int giy = get_global_id(1);
+  /*
+      __local REALTYPE Bvalues[4];
+      __local REALTYPE MMatrix[9];
+
+      if(gix<9)
+      {
+          if(gix<4)
+          {
+              Bvalues[gix] = m_Bvalues[gix];
+          }
+          MMatrix[gix] = m_MMatrix[gix];
+      }
+      barrier(CLK_LOCAL_MEM_FENCE);
+  */
+
+  switch (dim)
+  {         // generic start= (giz*height + giy)*width + gix;
+    case 0: // X
+      if (gix < DEPTH && giy < HEIGHT)
+      {
+        // start= (id(0)*height + id(1))*width + 0;
+        partialFilter(data, outs, m_Bvalues, m_MMatrix, (gix * HEIGHT + giy) * WIDTH, 1, WIDTH);
+      }
+      break;
+    case 1: // Y
+      if (giy < DEPTH && gix < WIDTH)
+      {
+        // start= (id(1)*height + 0)*width + id(0);
+        partialFilter(data, outs, m_Bvalues, m_MMatrix, giy * WIDTH * HEIGHT + gix, WIDTH, HEIGHT);
+      }
+      break;
+    case 2: // Z
+      if (gix < WIDTH && giy < HEIGHT)
+      {
+        // start= (0*height + id(1))*width + id(0);
+        partialFilter(data, outs, m_Bvalues, m_MMatrix, giy * WIDTH + gix, HEIGHT * WIDTH, DEPTH);
+      }
+      break;
+  }
+  return;
+}
+#endif
diff --git a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/src/OpenCLInfo.cpp b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/src/OpenCLInfo.cpp
new file mode 100644
index 00000000000..97a90dbd884
--- /dev/null
+++ b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/src/OpenCLInfo.cpp
@@ -0,0 +1,94 @@
+// OpenCLInfo.cpp
+//
+//  Simple code that probes the available platforms and devices
+//  using clGetInfo* functions.
+
+#include <iostream>
+#include <fstream>
+#include <sstream>
+
+#if defined(_WIN32)
+#  include <malloc.h> // needed for alloca
+#endif                // _WIN32
+
+#if defined(linux) || defined(__APPLE__) || defined(__MACOSX)
+#  include <alloca.h>
+#endif // linux
+
+#ifdef __APPLE__
+#  include <OpenCL/cl.h>
+#else
+#  include <CL/cl.h>
+#endif
+
+///
+//  Enumerate platforms and display information about them
+//  and their associated devices.
+int
+main(int argc, char ** argv)
+{
+  // cl_context context = 0;
+
+  cl_int           errNum;
+  cl_uint          numPlatforms;
+  cl_platform_id * platformIds;
+  cl_context       context = NULL;
+
+  // First, query the total number of platforms
+  errNum = clGetPlatformIDs(0, NULL, &numPlatforms);
+  if (errNum != CL_SUCCESS || numPlatforms <= 0)
+  {
+    std::cerr << "Failed to find any OpenCL platform." << std::endl;
+    return -1;
+  }
+
+  // Next, allocate memory for the installed plaforms, and qeury
+  // to get the list.
+  platformIds = (cl_platform_id *)alloca(sizeof(cl_platform_id) * numPlatforms);
+  // First, query the total number of platforms
+  errNum = clGetPlatformIDs(numPlatforms, platformIds, NULL);
+  if (errNum != CL_SUCCESS)
+  {
+    std::cerr << "Failed to find any OpenCL platforms." << std::endl;
+    return -1;
+  }
+
+  std::cout << "Number of platforms: \t" << numPlatforms << std::endl;
+  // Iterate through the list of platforms displaying associated information
+  for (cl_uint i = 0; i < numPlatforms; i++)
+  {
+
+    // Now query the set of devices associated with the platform
+    cl_uint numDevices;
+    errNum = clGetDeviceIDs(platformIds[i], CL_DEVICE_TYPE_ALL, 0, NULL, &numDevices);
+    if (errNum != CL_SUCCESS)
+    {
+      std::cerr << "Failed to find OpenCL devices." << std::endl;
+      return 100;
+    }
+
+    cl_device_id * devices = (cl_device_id *)alloca(sizeof(cl_device_id) * numDevices);
+    errNum = clGetDeviceIDs(platformIds[i], CL_DEVICE_TYPE_ALL, numDevices, devices, NULL);
+    if (errNum != CL_SUCCESS)
+    {
+      std::cerr << "Failed to find OpenCL devices." << std::endl;
+      return 100;
+    }
+
+    std::cout << "\tNumber of devices: \t" << numDevices << std::endl;
+    // Iterate through each device, displaying associated information
+    for (cl_uint j = 0; j < numDevices; j++)
+    {
+      cl_uint vectorWidthDouble;
+      errNum =
+        clGetDeviceInfo(devices[j], CL_DEVICE_PREFERRED_VECTOR_WIDTH_DOUBLE, sizeof(cl_uint), &vectorWidthDouble, NULL);
+      if (vectorWidthDouble == 0)
+      {
+        std::cout << "Found a device that does not support double precision.\n";
+        return 1;
+      }
+    }
+  }
+  std::cout << "All devices supported double precision.\n";
+  return 0;
+}
diff --git a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/CMakeLists.txt b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/CMakeLists.txt
new file mode 100644
index 00000000000..29fc2694d5c
--- /dev/null
+++ b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/CMakeLists.txt
@@ -0,0 +1,108 @@
+itk_module_test()
+
+if(ITK_USE_GPU AND WITH_OPENCL)
+  add_definitions(-DGPU)
+
+  if(GPU_HANDLES_DOUBLE)
+    add_definitions(-DWITH_DOUBLE)
+  endif()
+
+  if(NVIDIA_GPU)
+    add_definitions(-DNVIDIA)
+    message(STATUS "NVIDIA platform detected")
+  endif()
+
+  include_directories(
+    "${ITKSmoothingRecursiveYvvGaussianFilter_SOURCE_DIR}/include"
+  )
+  include_directories("${ITKSmoothingRecursiveYvvGaussianFilterKernelDir}")
+
+  set(
+    ITK${itk-module}Tests
+    itkCPURecursiveYvvGaussianImageFilterTest.cxx
+    itkGPURecursiveYvvGaussianImageFilterTest.cxx
+    itkYvvGpuCpuSimilarityTest.cxx
+    itkYvvBenchmark.cxx
+    itkYvvWhiteImageTest.cxx
+  )
+else()
+  set(
+    ITK${itk-module}Tests
+    itkCPURecursiveYvvGaussianImageFilterTest.cxx
+    itkYvvBenchmark.cxx
+  )
+endif()
+
+set(TEST_DATA_ROOT "${${itk-module}_SOURCE_DIR}/Data")
+
+createtestdriver(${itk-module} "${${itk-module}-Test_LIBRARIES}" "${ITK${itk-module}Tests}")
+
+itk_add_test(
+  NAME itkCPURecursiveYvvGaussianImageFilterTest
+  COMMAND
+    ${itk-module}TestDriver
+    itkCPURecursiveYvvGaussianImageFilterTest
+    ${TEST_DATA_ROOT}/512ex.jpg
+    2
+    12.0
+    1
+)
+
+itk_add_test(
+  NAME itkYvvBenchmark
+  COMMAND
+    ${itk-module}TestDriver
+    itkYvvBenchmark
+    ${TEST_DATA_ROOT}/512ex.jpg
+    2
+    12.0
+    30
+)
+
+itk_add_test(
+  NAME itkYvvWhiteImageTest2D
+  COMMAND
+    ${itk-module}TestDriver
+    itkYvvWhiteImageTest
+    2
+    12.0
+    80
+    512
+    512
+)
+
+itk_add_test(
+  NAME itkYvvWhiteImageTest3D
+  COMMAND
+    ${itk-module}TestDriver
+    itkYvvWhiteImageTest
+    3
+    12.0
+    5
+    256
+    256
+    16
+)
+
+if(ITK_USE_GPU AND WITH_OPENCL)
+  itk_add_test(
+    NAME itkGPURecursiveYvvGaussianImageFilterTest
+    COMMAND
+      ${itk-module}TestDriver
+      itkGPURecursiveYvvGaussianImageFilterTest
+      ${TEST_DATA_ROOT}/512ex.jpg
+      2
+      12.0
+      1
+  )
+
+  itk_add_test(
+    NAME itkYvvGpuCpuSimilarityTest
+    COMMAND
+      ${itk-module}TestDriver
+      itkYvvGpuCpuSimilarityTest
+      ${TEST_DATA_ROOT}/512ex.jpg
+      2
+      0.5
+  )
+endif()
diff --git a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/itkCPURecursiveYvvGaussianImageFilterTest.cxx b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/itkCPURecursiveYvvGaussianImageFilterTest.cxx
new file mode 100644
index 00000000000..855397ec806
--- /dev/null
+++ b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/itkCPURecursiveYvvGaussianImageFilterTest.cxx
@@ -0,0 +1,51 @@
+#include <iostream>
+#include <fstream>
+#include "yvvFilter.hxx"
+
+
+#ifdef WITH_DOUBLE
+typedef double PixelType;
+#else
+typedef float PixelType;
+#endif
+
+int
+itkCPURecursiveYvvGaussianImageFilterTest(int argc, char * argv[])
+{
+
+  if (argc < 5)
+  {
+    std::cerr << "Error: missing arguments" << std::endl;
+    std::cerr << "[Usage] " << argv[0] << " image_file ndimension sigma num_runs" << std::endl;
+    return EXIT_FAILURE;
+  }
+
+  std::string  inputFilename(argv[1]);
+  unsigned int dim = atoi(argv[2]);
+  float        sigma = atof(argv[3]);
+  unsigned int ntests = atoi(argv[4]);
+
+
+  int                          res = EXIT_SUCCESS;
+  itk::TimeProbesCollectorBase timeCollector;
+
+  if (dim == 2)
+  {
+    res = testImage<itk::Image<PixelType, 2>>(inputFilename, sigma, &timeCollector, ntests);
+  }
+  else if (dim == 3)
+  {
+    res = testImage<itk::Image<PixelType, 3>>(inputFilename, sigma, &timeCollector, ntests);
+  }
+  else
+  {
+    std::cerr << "Error: only 2 or 3 dimensions allowed, " << dim << " selected." << std::endl;
+    res = EXIT_FAILURE;
+  }
+
+  timeCollector.Report();
+  std::cout << "\n(!) GPU results will only be shown if GPU support has been detected and activated by the user.\n";
+
+
+  return res;
+}
diff --git a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/itkGPURecursiveYvvGaussianImageFilterTest.cxx b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/itkGPURecursiveYvvGaussianImageFilterTest.cxx
new file mode 100644
index 00000000000..0b391bc2b23
--- /dev/null
+++ b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/itkGPURecursiveYvvGaussianImageFilterTest.cxx
@@ -0,0 +1,64 @@
+#include <iostream>
+#include <fstream>
+#include "yvvFilter.hxx"
+
+#ifdef GPU
+#  include "itkGPUContextManager.h"
+#endif
+
+
+#ifdef WITH_DOUBLE
+typedef double PixelType;
+#else
+typedef float PixelType;
+#endif
+
+int
+itkGPURecursiveYvvGaussianImageFilterTest(int argc, char * argv[])
+{
+#ifdef GPU
+  if (!itk::IsGPUAvailable())
+  {
+    std::cerr << "OpenCL-enabled GPU is not present." << std::endl;
+    return EXIT_FAILURE;
+  }
+#endif
+
+  if (argc < 5)
+  {
+    std::cerr << "Error: missing arguments" << std::endl;
+    std::cerr << "[Usage] " << argv[0] << " image_file ndimension sigma num_runs" << std::endl;
+    return EXIT_FAILURE;
+  }
+
+  std::string  inputFilename(argv[1]);
+  unsigned int dim = atoi(argv[2]);
+  float        sigma = atof(argv[3]);
+  unsigned int ntests = atoi(argv[4]);
+
+
+  int                          res = EXIT_SUCCESS;
+  itk::TimeProbesCollectorBase timeCollector;
+
+  if (dim == 2)
+  {
+    res = testImage<itk::Image<PixelType, 2>>(inputFilename, sigma, &timeCollector, ntests);
+  }
+  else if (dim == 3)
+  {
+    res = testImage<itk::Image<PixelType, 3>>(inputFilename, sigma, &timeCollector, ntests);
+  }
+  else
+  {
+    std::cerr << "Error: only 2 or 3 dimensions allowed, " << dim << " selected." << std::endl;
+    res = EXIT_FAILURE;
+  }
+
+  timeCollector.Report();
+#ifndef GPU
+  std::cout
+    << "--      ITK GPU support was not detected and/or not configured, so no GPU filters were tested.     --\n";
+#endif
+
+  return res;
+}
diff --git a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/itkYvvBenchmark.cxx b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/itkYvvBenchmark.cxx
new file mode 100644
index 00000000000..98b01386fe5
--- /dev/null
+++ b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/itkYvvBenchmark.cxx
@@ -0,0 +1,63 @@
+#include <iostream>
+#include <fstream>
+#include "yvvFilter.hxx"
+
+#ifdef GPU
+#  include "itkGPUContextManager.h"
+#endif
+
+#ifdef WITH_DOUBLE
+typedef double PixelType;
+#else
+typedef float PixelType;
+#endif
+
+int
+itkYvvBenchmark(int argc, char * argv[])
+{
+#ifdef GPU
+  if (!itk::IsGPUAvailable())
+  {
+    std::cerr << "OpenCL-enabled GPU is not present." << std::endl;
+    return EXIT_FAILURE;
+  }
+#endif
+
+  if (argc < 5)
+  {
+    std::cerr << "Error: missing arguments" << std::endl;
+    std::cerr << "[Usage] " << argv[0] << " image_file ndimension sigma num_runs" << std::endl;
+    return EXIT_FAILURE;
+  }
+
+  std::string  inputFilename(argv[1]);
+  unsigned int dim = atoi(argv[2]);
+  float        sigma = atof(argv[3]);
+  unsigned int ntests = atoi(argv[4]);
+
+
+  int                          res = EXIT_SUCCESS;
+  itk::TimeProbesCollectorBase timeCollector;
+
+  if (dim == 2)
+  {
+    res = testImage<itk::Image<PixelType, 2>>(inputFilename, sigma, &timeCollector, ntests);
+  }
+  else if (dim == 3)
+  {
+    res = testImage<itk::Image<PixelType, 3>>(inputFilename, sigma, &timeCollector, ntests);
+  }
+  else
+  {
+    std::cerr << "Error: only 2 or 3 dimensions allowed, " << dim << " selected." << std::endl;
+    res = EXIT_FAILURE;
+  }
+
+  timeCollector.Report();
+#ifndef GPU
+  std::cout
+    << "--      ITK GPU support was not detected and/or not configured, so no GPU filters were tested.     --\n";
+#endif
+
+  return res;
+}
diff --git a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/itkYvvGpuCpuSimilarityTest.cxx b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/itkYvvGpuCpuSimilarityTest.cxx
new file mode 100644
index 00000000000..fda00718535
--- /dev/null
+++ b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/itkYvvGpuCpuSimilarityTest.cxx
@@ -0,0 +1,209 @@
+#include <iostream>
+#include <fstream>
+
+#include "itkCastImageFilter.h"
+#include "itkSmoothingRecursiveYvvGaussianImageFilter.h"
+#include "itkImageFileReader.h"
+#include "itkImageFileWriter.h"
+#include "itkTimeProbe.h"
+
+#include "itkGPUImage.h"
+#include "itkGPUKernelManager.h"
+#include "itkGPUContextManager.h"
+#include "itkGPUSmoothingRecursiveYvvGaussianImageFilter.h"
+
+
+#ifdef WITH_DOUBLE
+typedef double PixelType;
+#else
+typedef float PixelType;
+#endif
+
+template <typename ImageType>
+int
+runYvvGpuCpuSimilarityTest(const std::string & inFile, float mySigma)
+{
+  typedef PixelType InputPixelType;
+  typedef PixelType OutputPixelType;
+
+  typedef itk::GPUImage<InputPixelType, ImageType::ImageDimension>     InputImageType;
+  typedef itk::GPUImage<OutputPixelType, ImageType::ImageDimension>    OutputImageType;
+  typedef itk::Image<unsigned char, ImageType::ImageDimension>         UnsignedCharImageType;
+  typedef itk::CastImageFilter<OutputImageType, UnsignedCharImageType> CastFilterType;
+
+  typedef itk::SmoothingRecursiveYvvGaussianImageFilter<InputImageType, OutputImageType>    CPUYvvFilterType;
+  typedef itk::GPUSmoothingRecursiveYvvGaussianImageFilter<InputImageType, OutputImageType> GPUYvvFilterType;
+
+  typedef itk::ImageFileReader<InputImageType>        ReaderType;
+  typedef itk::ImageFileWriter<UnsignedCharImageType> WriterType;
+
+  typename ReaderType::Pointer     reader = ReaderType::New();
+  typename WriterType::Pointer     writer = WriterType::New();
+  typename CastFilterType::Pointer castFilter = CastFilterType::New();
+
+  typename WriterType::Pointer     writerCPU = WriterType::New();
+  typename CastFilterType::Pointer castFilterCPU = CastFilterType::New();
+
+  std::string outFile = "gpuYvvCompOutput";
+  std::string outFileCPU = "cpuYvvCompOutput";
+
+  if (ImageType::ImageDimension == 2)
+  {
+    outFile += ".jpg";
+    outFileCPU += ".jpg";
+  }
+  else
+  {
+    outFile += ".tif";
+    outFileCPU += ".tif";
+  }
+
+  reader->SetFileName(inFile);
+  writer->SetFileName(outFile);
+  writerCPU->SetFileName(outFileCPU);
+
+  typename InputImageType::Pointer src = InputImageType::New();
+  src = reader->GetOutput();
+  reader->Update();
+
+  bool someDiffFlag = false;
+
+  std::cout << "\nUsing  " << inFile << std::endl;
+
+  for (float sigma = mySigma; sigma <= 32; sigma *= 2)
+  {
+    typename CPUYvvFilterType::Pointer CPUFilter = CPUYvvFilterType::New();
+
+    itk::TimeProbe cputimer;
+
+    cputimer.Start();
+    CPUFilter->SetInput(src);
+    CPUFilter->SetSigma(sigma);
+    CPUFilter->Update();
+    cputimer.Stop();
+
+
+    std::cout << "\nSize: " << src->GetLargestPossibleRegion().GetSize() << std::endl;
+    std::cout << "CPU Recursive YVV Gaussian Filter took " << cputimer.GetMean() << " seconds with "
+              << CPUFilter->GetNumberOfThreads() << " threads." << std::endl;
+
+    castFilterCPU->SetInput(CPUFilter->GetOutput());
+    writerCPU->SetInput(castFilterCPU->GetOutput());
+    writerCPU->Update();
+
+    typename GPUYvvFilterType::Pointer GPUFilter = GPUYvvFilterType::New();
+
+    itk::TimeProbe gputimer;
+
+    gputimer.Start();
+    GPUFilter->SetInput(reader->GetOutput());
+    GPUFilter->SetSigma(sigma);
+    GPUFilter->Update();
+    GPUFilter->GetOutput()->UpdateBuffers(); // synchronization point (GPU->CPU memcpy)
+    gputimer.Stop();
+
+    std::cout << "GPU Recursive YVV Gaussian Filter took " << gputimer.GetMean() << " seconds.\n";
+
+    castFilter->SetInput(GPUFilter->GetOutput());
+    writer->SetInput(castFilter->GetOutput());
+    writer->Update();
+
+    // ---------------
+    // RMS Error check
+    // ---------------
+
+    double                                    diff = 0;
+    unsigned int                              nPix = 0;
+    itk::ImageRegionIterator<OutputImageType> cit(CPUFilter->GetOutput(),
+                                                  CPUFilter->GetOutput()->GetLargestPossibleRegion());
+    itk::ImageRegionIterator<OutputImageType> git(GPUFilter->GetOutput(),
+                                                  GPUFilter->GetOutput()->GetLargestPossibleRegion());
+
+    for (cit.GoToBegin(), git.GoToBegin(); !cit.IsAtEnd(); ++cit, ++git)
+    {
+      double err = (double)(cit.Get()) - (double)(git.Get());
+      //         if(err > 0.1 || (double)cit.Get() < 0.1) std::cout << "CPU : " << (double)(cit.Get()) << ", GPU : " <<
+      //         (double)(git.Get()) << std::endl;
+      diff += err * err;
+      nPix++;
+    }
+
+
+    if (nPix > 0)
+    {
+      double RMSError = sqrt(diff / (double)nPix);
+      std::cout << "RMS Error with sigma = " << sigma << " : " << RMSError << std::endl;
+      // the CPU filter operator has type double
+      // but the double precision is not well-supported on most GPUs
+      // and by most drivers at this time.  Therefore, the GPU filter
+      // operator has type float
+      // relax the RMS threshold here to allow for errors due to
+      // differences in precision
+      // NOTE:
+      //   a threshold of 1.2e-5 worked on linux and Mac, but not Windows
+      //   why?
+      double RMSThreshold = 1.7e-5;
+      if (vnl_math_isnan(RMSError))
+      {
+        std::cout << "RMS Error with sigma = " << sigma << " is NaN! nPix: " << nPix << std::endl;
+        return EXIT_FAILURE;
+      }
+      if (RMSError > RMSThreshold)
+      {
+        std::cout << "RMS Error with sigma = " << sigma << " exceeds threshold (" << RMSThreshold << ")" << std::endl;
+        someDiffFlag = true;
+      }
+    }
+    else
+    {
+      std::cout << "No pixels in output!" << std::endl;
+      return EXIT_FAILURE;
+    }
+  }
+
+  if (someDiffFlag)
+    return EXIT_FAILURE;
+
+  return EXIT_SUCCESS;
+}
+
+
+int
+itkYvvGpuCpuSimilarityTest(int argc, char * argv[])
+{
+  if (!itk::IsGPUAvailable())
+  {
+    std::cerr << "OpenCL-enabled GPU is not present." << std::endl;
+    return EXIT_FAILURE;
+  }
+
+  if (argc < 3)
+  {
+    std::cerr << argc << ": Error: missing arguments: " << argv[1] << std::endl;
+    std::cerr << "[Usage] " << argv[0] << " image_file ndimension [sigma]" << std::endl;
+    return EXIT_FAILURE;
+  }
+
+  std::string  inputFilename(argv[1]);
+  unsigned int dim = atoi(argv[2]);
+
+  float sigma = 0.5;
+  if (argc > 3 && atoi(argv[3]) >= 0.5)
+  {
+    sigma = atof(argv[3]);
+  }
+
+  if (dim == 2)
+  {
+    return runYvvGpuCpuSimilarityTest<itk::Image<PixelType, 2>>(inputFilename, sigma);
+  }
+  else if (dim == 3)
+  {
+    return runYvvGpuCpuSimilarityTest<itk::Image<PixelType, 3>>(inputFilename, sigma);
+  }
+  else
+  {
+    std::cerr << "Error: only 2 or 3 dimensions allowed, " << dim << " selected." << std::endl;
+  }
+  return EXIT_FAILURE;
+}
diff --git a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/itkYvvWhiteImageTest.cxx b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/itkYvvWhiteImageTest.cxx
new file mode 100644
index 00000000000..2110cea93d7
--- /dev/null
+++ b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/itkYvvWhiteImageTest.cxx
@@ -0,0 +1,104 @@
+#include <iostream>
+#include <fstream>
+#include "yvvFilter.hxx"
+
+#ifdef GPU
+#  include "itkGPUContextManager.h"
+#endif
+
+#ifdef WITH_DOUBLE
+typedef double PixelType;
+#else
+typedef float PixelType;
+#endif
+
+int
+itkYvvWhiteImageTest(int argc, char * argv[])
+{
+#ifdef GPU
+  if (!itk::IsGPUAvailable())
+  {
+    std::cerr << "OpenCL-enabled GPU is not present." << std::endl;
+    return EXIT_FAILURE;
+  }
+#endif
+
+  if (argc < 4)
+  {
+    std::cerr << "Error: missing arguments." << std::endl;
+    std::cerr << "Usage: " << argv[0] << " ndimension sigma num_runs width [height] [depth]" << std::endl;
+    return EXIT_FAILURE;
+  }
+
+  int dim = atoi(argv[1]);
+  if (argc < 4 + dim - 1)
+  {
+    std::cerr << "Error: missing arguments." << std::endl;
+    std::cerr << "Usage: " << argv[0] << " ndimension sigma num_runs width [height] [depth]" << std::endl;
+    return EXIT_FAILURE;
+  }
+
+
+  unsigned int ntests, size[dim];
+  float        sigma;
+
+  if (dim == 3 && argc != 7)
+  {
+    std::cerr << "Error: missing arguments for a 3D image." << std::endl;
+    std::cerr << "Usage: " << argv[0] << " ndimension sigma num_runs width [height] [depth]" << std::endl;
+    return EXIT_FAILURE;
+  }
+
+  try
+  {
+    sigma = atof(argv[2]);
+    ntests = atoi(argv[3]);
+    for (int i = 0; i < dim; ++i)
+    {
+      size[i] = atoi(argv[4 + i]);
+    }
+  }
+  catch (...)
+  {
+    std::cerr << "Error: invalid size arguments." << std::endl;
+    std::cerr << "Usage: " << argv[0] << " ndimension sigma num_runs width height [depth]" << std::endl;
+    return EXIT_FAILURE;
+  }
+
+  std::cout << ":::  Received: dim =" << dim << ", sigma= " << sigma << ", ntests= " << ntests << ", size= ";
+  for (int i = 0; i < dim; ++i)
+  {
+    std::cout << size[i] << " ";
+  }
+
+  std::cout << ":::\n\n";
+
+  int                          res = EXIT_SUCCESS;
+  itk::TimeProbesCollectorBase timeCollector;
+
+  if (dim == 2)
+  {
+    typedef itk::Image<PixelType, 2> ImageType;
+    ImageType::SizeType              size2D = { { size[0], size[1] } };
+    res = testWhite<ImageType>(size2D, sigma, &timeCollector, ntests);
+  }
+  else if (dim == 3)
+  {
+    typedef itk::Image<PixelType, 3> ImageType;
+    ImageType::SizeType              size3D = { { size[0], size[1], size[2] } };
+    res = testWhite<ImageType>(size3D, sigma, &timeCollector, ntests);
+  }
+  else
+  {
+    std::cerr << "Error: only 2 or 3 dimensions allowed, " << dim << " selected." << std::endl;
+    res = EXIT_FAILURE;
+  }
+
+  timeCollector.Report();
+#ifndef GPU
+  std::cout
+    << "--      ITK GPU support was not detected and/or not configured, so no GPU filters were tested.     --\n";
+#endif
+
+  return res;
+}
diff --git a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/yvvFilter.hxx b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/yvvFilter.hxx
new file mode 100644
index 00000000000..6bdb53e82a7
--- /dev/null
+++ b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/yvvFilter.hxx
@@ -0,0 +1,357 @@
+#include "itkCastImageFilter.h"
+#include "itkImageFileReader.h"
+#include "itkImageFileWriter.h"
+#include "itkSmoothingRecursiveYvvGaussianImageFilter.h"
+#include "itkSmoothingRecursiveGaussianImageFilter.h"
+#include "itkTimeProbesCollectorBase.h"
+
+#ifdef GPU
+#  include "itkGPUImage.h"
+#  include "itkGPUSmoothingRecursiveYvvGaussianImageFilter.h"
+#endif
+
+
+template <typename ImageType>
+void
+writeImage(std::string filterLabel, ImageType * result)
+{
+  typedef itk::Image<unsigned char, ImageType::ImageDimension>   UnsignedCharImageType;
+  typedef itk::CastImageFilter<ImageType, UnsignedCharImageType> CastFilterType;
+  typedef itk::ImageFileWriter<UnsignedCharImageType>            WriterType;
+#ifdef VERBOSE
+  std::cout << "..........." << filterLabel << ": Preparing to write out filtered image.\n";
+#endif
+
+  std::string outputFilename = filterLabel;
+
+  typename CastFilterType::Pointer castFilter = CastFilterType::New();
+  castFilter->SetInput(result);
+  castFilter->Update();
+
+  typename WriterType::Pointer writer = WriterType::New();
+
+  if (ImageType::ImageDimension == 2)
+  {
+    outputFilename += ".jpg";
+  }
+  else
+  {
+    outputFilename += ".tif";
+  }
+  writer->SetFileName(outputFilename);
+  writer->SetInput(castFilter->GetOutput());
+  try
+  {
+    writer->Update();
+  }
+  catch (itk::ExceptionObject & e)
+  {
+    std::cerr << e << std::endl;
+  }
+
+#ifdef VERBOSE
+  std::cout << "..........." << filterLabel << ": result written to " << outputFilename << "\n";
+#endif
+}
+
+
+template <typename ImageType>
+int
+getSourceImage(void * sourceImagePtr, std::string inputFilename)
+{
+  typedef itk::ImageFileReader<ImageType> ReaderType;
+  typename ReaderType::Pointer            readerGPU = ReaderType::New();
+  readerGPU->SetFileName(inputFilename);
+  try
+  {
+    readerGPU->Update();
+  }
+  catch (const itk::ImageFileReaderException & e)
+  {
+    std::cout << "Error : " << e.GetDescription() << std::endl;
+    return -1;
+  }
+
+  typename ImageType::Pointer * kimg = (typename ImageType::Pointer *)sourceImagePtr;
+  *kimg = readerGPU->GetOutput();
+
+  (*kimg)->DisconnectPipeline();
+  return EXIT_SUCCESS;
+}
+
+
+template <typename ImageType>
+int
+createWhiteImage(void * sourceImagePtr, typename ImageType::SizeType size)
+{
+  typename ImageType::Pointer *  kimg = (typename ImageType::Pointer *)sourceImagePtr;
+  typename ImageType::RegionType region;
+  region.SetSize(size);
+
+  // create
+  *kimg = ImageType::New();
+  (*kimg)->SetRegions(region);
+  (*kimg)->Allocate();
+  (*kimg)->FillBuffer(255.0);
+
+  return EXIT_SUCCESS;
+}
+
+
+template <typename FilterType>
+int
+testCpuFilter(std::string &                                 filterLabel,
+              std::string &                                 inputFilename,
+              typename FilterType::InputImageType::SizeType size,
+              float                                         sigma,
+              std::string                                   parameters,
+              itk::TimeProbesCollectorBase *                timeCollector)
+{
+#ifdef VERBOSE
+  std::cout << "-----------" << filterLabel << ": Starting tests.\n";
+#endif
+
+  typedef typename FilterType::InputImageType InputImage;
+  typename InputImage::Pointer                src;
+  void *                                      imgPtr = &src;
+
+  if (inputFilename.empty())
+  {
+    createWhiteImage<InputImage>(imgPtr, size);
+    // createStepImage<InputImage>(imgPtr, size);
+
+    std::ostringstream sizeStream;
+
+    sizeStream << size[0];
+    for (int i = 1; i < InputImage::ImageDimension; ++i)
+    {
+      sizeStream << "x" << size[i];
+    }
+    parameters += sizeStream.str();
+  }
+  else
+  {
+    getSourceImage<InputImage>(imgPtr, inputFilename);
+  }
+
+  typename FilterType::Pointer filter = FilterType::New();
+  filter->SetSigma(sigma);
+  filter->SetInput(src);
+  filter->Update();
+
+  {
+    src->Modified();
+    filter->Modified();
+#ifdef VERBOSE
+    std::cout << "-----------" << filterLabel << ": Start.\n";
+#endif
+
+    timeCollector->Start(filterLabel.c_str());
+    filter->Update();
+    filter->GetOutput();
+    timeCollector->Stop(filterLabel.c_str());
+
+    writeImage<typename FilterType::InputImageType>(filterLabel + parameters, filter->GetOutput());
+
+#ifdef VERBOSE
+    std::cout << "-----------" << filterLabel << ": Stop.\n";
+#endif
+  }
+
+  src->DisconnectPipeline();
+  src = 0;
+  filter = 0;
+  imgPtr = 0;
+  return EXIT_SUCCESS;
+}
+
+
+#ifdef GPU
+
+template <typename FilterType>
+int
+testGpuFilter(std::string &                                 filterLabel,
+              std::string &                                 inputFilename,
+              typename FilterType::InputImageType::SizeType size,
+              float                                         sigma,
+              std::string                                   parameters,
+              itk::TimeProbesCollectorBase *                timeCollector,
+              bool                                          measureWithSync)
+{
+#  ifdef VERBOSE
+  std::cout << "-----------" << filterLabel << ": Starting tests.\n";
+#  endif
+  typedef typename FilterType::InputImageType InputImage;
+
+  typename InputImage::Pointer src;
+  void *                       imgPtr = &src;
+
+  if (inputFilename.empty())
+  {
+    createWhiteImage<InputImage>(imgPtr, size);
+    // createStepImage<InputImage>(imgPtr, size);
+
+    std::ostringstream sizeStream;
+
+    sizeStream << size[0];
+    for (int i = 1; i < InputImage::ImageDimension; ++i)
+    {
+      sizeStream << "x" << size[i];
+    }
+    parameters += sizeStream.str();
+  }
+  else
+  {
+    getSourceImage<InputImage>(imgPtr, inputFilename);
+  }
+
+  typename FilterType::Pointer filter = FilterType::New();
+  filter->SetSigma(sigma);
+  filter->SetInput(src);
+  filter->Update();
+  filter->GetOutput()->UpdateBuffers(); // force first CPU-GPU synchronisation
+
+  {
+    // src->Modified(); //No need, filter->Update forces call to GPUGenerateData()
+    filter->Modified();
+#  ifdef VERBOSE
+    std::cout << "-----------" << filterLabel << ": Start run.\n";
+#  endif
+    if (measureWithSync)
+    {
+      timeCollector->Start(filterLabel.c_str());
+      filter->Update();
+      filter->GetOutput()->UpdateBuffers();
+      timeCollector->Stop(filterLabel.c_str());
+    }
+    else
+    {
+      timeCollector->Start(filterLabel.c_str());
+      filter->Update();
+      timeCollector->Stop(filterLabel.c_str());
+      filter->GetOutput()->UpdateBuffers();
+    }
+    writeImage<InputImage>(filterLabel + parameters, filter->GetOutput());
+
+#  ifdef VERBOSE
+    std::cout << "-----------" << filterLabel << ": Stop.\n";
+#  endif
+  }
+
+  src->DisconnectPipeline();
+  src = 0;
+  filter = 0;
+  imgPtr = 0;
+  return EXIT_SUCCESS;
+}
+
+#endif
+
+
+template <typename ImageType>
+int
+testImage(std::string inputFilename, float sigma, itk::TimeProbesCollectorBase * timeCollector, unsigned int ntests)
+{
+#ifdef GPU
+  typedef itk::GPUImage<typename ImageType::PixelType, ImageType::ImageDimension>      GPUImageType;
+  typedef itk::GPUSmoothingRecursiveYvvGaussianImageFilter<GPUImageType, GPUImageType> GPUrecursiveYVVFilterType;
+#endif
+  typedef ImageType                                                                 CPUImageType;
+  typedef itk::SmoothingRecursiveYvvGaussianImageFilter<CPUImageType, CPUImageType> RecursiveYVVFilterType;
+  typedef itk::SmoothingRecursiveGaussianImageFilter<CPUImageType, CPUImageType>    DericheFilterType;
+
+  std::cout << ":::: Testing on " << inputFilename << ", using sigma = " << sigma << "   ::::" << std::endl;
+  typename ImageType::SizeType size; // empty, since we'll be using an actual file
+  std::ostringstream           parameterStream;
+  parameterStream << "_s" << sigma << "_";
+
+  ////////////////////////////////
+  std::string dericheLabel = "cpu_Deriche";
+  for (unsigned int i = 0; i < ntests; ++i)
+  {
+    testCpuFilter<DericheFilterType>(dericheLabel, inputFilename, size, sigma, parameterStream.str(), timeCollector);
+  }
+  ////////////////////////////////
+  std::string cpuYvvLabel = "cpu_Yvv";
+  for (unsigned int i = 0; i < ntests; ++i)
+  {
+    testCpuFilter<RecursiveYVVFilterType>(
+      cpuYvvLabel, inputFilename, size, sigma, parameterStream.str(), timeCollector);
+  }
+
+//////////////////////////////
+#ifdef GPU
+  std::string gpuYvvLabel = "gpu_Yvv_wSync";
+  for (unsigned int i = 0; i < ntests; ++i)
+  {
+    testGpuFilter<GPUrecursiveYVVFilterType>(
+      gpuYvvLabel, inputFilename, size, sigma, parameterStream.str(), timeCollector, true);
+  }
+
+  std::string gpuYvvLabelNoSync = "gpu_Yvv_NoSyn";
+  for (unsigned int i = 0; i < ntests; ++i)
+  {
+    testGpuFilter<GPUrecursiveYVVFilterType>(
+      gpuYvvLabelNoSync, inputFilename, size, sigma, parameterStream.str(), timeCollector, false);
+  }
+
+#endif
+  return EXIT_SUCCESS;
+}
+
+
+template <typename ImageType>
+int
+testWhite(typename ImageType::SizeType   size,
+          float                          sigma,
+          itk::TimeProbesCollectorBase * timeCollector,
+          unsigned int                   ntests)
+{
+  std::cout << "Testing: " << size << " with sigma = " << sigma << ". Average over " << ntests << " runs." << std::endl;
+
+#ifdef GPU
+  typedef itk::GPUImage<typename ImageType::PixelType, ImageType::ImageDimension>      GPUImageType;
+  typedef itk::GPUSmoothingRecursiveYvvGaussianImageFilter<GPUImageType, GPUImageType> GPUrecursiveYVVFilterType;
+#endif
+  typedef ImageType                                                                 CPUImageType;
+  typedef itk::SmoothingRecursiveYvvGaussianImageFilter<CPUImageType, CPUImageType> RecursiveYVVFilterType;
+  typedef itk::SmoothingRecursiveGaussianImageFilter<CPUImageType, CPUImageType>    DericheFilterType;
+
+  std::string        emptyFilename;
+  std::ostringstream parameterStream;
+  parameterStream << "_s" << sigma << "_";
+
+  std::cout << ":::: Testing on white image: " << size << ", using sigma = " << sigma << "   ::::" << std::endl;
+
+  ////////////////////////////////
+  std::string dericheLabel = "cpu_Deriche";
+  for (unsigned int i = 0; i < ntests; ++i)
+  {
+    testCpuFilter<DericheFilterType>(dericheLabel, emptyFilename, size, sigma, parameterStream.str(), timeCollector);
+  }
+  ////////////////////////////////
+  std::string cpuYvvLabel = "cpu_Yvv";
+  for (unsigned int i = 0; i < ntests; ++i)
+  {
+    testCpuFilter<RecursiveYVVFilterType>(
+      cpuYvvLabel, emptyFilename, size, sigma, parameterStream.str(), timeCollector);
+  }
+
+//////////////////////////////
+#ifdef GPU
+  std::string gpuYvvLabelSync = "gpu_Yvv_wSync";
+  for (unsigned int i = 0; i < ntests; ++i)
+  {
+    testGpuFilter<GPUrecursiveYVVFilterType>(
+      gpuYvvLabelSync, emptyFilename, size, sigma, parameterStream.str(), timeCollector, true);
+  }
+
+  std::string gpuYvvLabelNoSync = "gpu_Yvv_NoSyn";
+  for (unsigned int i = 0; i < ntests; ++i)
+  {
+    testGpuFilter<GPUrecursiveYVVFilterType>(
+      gpuYvvLabelNoSync, emptyFilename, size, sigma, parameterStream.str(), timeCollector, false);
+  }
+#endif
+  return EXIT_SUCCESS;
+}

From c5f8117c8b5cf71971aa3936e42bad89c731093b Mon Sep 17 00:00:00 2001
From: Irina Vidal <irina.vidal-migallon@inria.fr>
Date: Tue, 9 Jul 2013 16:59:01 +0200
Subject: [PATCH 02/65] ENH: Change in tests and double-precision detection.

Signed-off-by: Irina Vidal <irina.vidal-migallon@inria.fr>
---
 .../src/OpenCLInfo.cpp                                 |  8 ++++----
 .../test/CMakeLists.txt                                | 10 +++++-----
 2 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/src/OpenCLInfo.cpp b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/src/OpenCLInfo.cpp
index 97a90dbd884..0d826b11266 100644
--- a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/src/OpenCLInfo.cpp
+++ b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/src/OpenCLInfo.cpp
@@ -64,7 +64,7 @@ main(int argc, char ** argv)
     if (errNum != CL_SUCCESS)
     {
       std::cerr << "Failed to find OpenCL devices." << std::endl;
-      return 100;
+      return -1;
     }
 
     cl_device_id * devices = (cl_device_id *)alloca(sizeof(cl_device_id) * numDevices);
@@ -72,7 +72,7 @@ main(int argc, char ** argv)
     if (errNum != CL_SUCCESS)
     {
       std::cerr << "Failed to find OpenCL devices." << std::endl;
-      return 100;
+      return -1;
     }
 
     std::cout << "\tNumber of devices: \t" << numDevices << std::endl;
@@ -85,10 +85,10 @@ main(int argc, char ** argv)
       if (vectorWidthDouble == 0)
       {
         std::cout << "Found a device that does not support double precision.\n";
-        return 1;
+        return 20;
       }
     }
   }
   std::cout << "All devices supported double precision.\n";
-  return 0;
+  return 1;
 }
diff --git a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/CMakeLists.txt b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/CMakeLists.txt
index 29fc2694d5c..e8d85ac4c9f 100644
--- a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/CMakeLists.txt
+++ b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/CMakeLists.txt
@@ -42,10 +42,10 @@ itk_add_test(
   COMMAND
     ${itk-module}TestDriver
     itkCPURecursiveYvvGaussianImageFilterTest
-    ${TEST_DATA_ROOT}/512ex.jpg
+    ${TEST_DATA_ROOT}/1024ex.jpg
     2
     12.0
-    1
+    20
 )
 
 itk_add_test(
@@ -53,7 +53,7 @@ itk_add_test(
   COMMAND
     ${itk-module}TestDriver
     itkYvvBenchmark
-    ${TEST_DATA_ROOT}/512ex.jpg
+    ${TEST_DATA_ROOT}/1024ex.jpg
     2
     12.0
     30
@@ -90,7 +90,7 @@ if(ITK_USE_GPU AND WITH_OPENCL)
     COMMAND
       ${itk-module}TestDriver
       itkGPURecursiveYvvGaussianImageFilterTest
-      ${TEST_DATA_ROOT}/512ex.jpg
+      ${TEST_DATA_ROOT}/1024ex.jpg
       2
       12.0
       1
@@ -101,7 +101,7 @@ if(ITK_USE_GPU AND WITH_OPENCL)
     COMMAND
       ${itk-module}TestDriver
       itkYvvGpuCpuSimilarityTest
-      ${TEST_DATA_ROOT}/512ex.jpg
+      ${TEST_DATA_ROOT}/1024ex.jpg
       2
       0.5
   )

From ac27e652f4c58a61e14eb59f42ea0c23b09b61d5 Mon Sep 17 00:00:00 2001
From: Irina Vidal <irina.vidal-migallon@inria.fr>
Date: Wed, 10 Jul 2013 15:59:01 +0200
Subject: [PATCH 03/65] ENH: Switch ITK_USE_GPU on/off depending on try_run.

Signed-off-by: Irina Vidal <irina.vidal-migallon@inria.fr>
---
 .../SmoothingRecursiveYvvGaussianFilter/test/CMakeLists.txt   | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/CMakeLists.txt b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/CMakeLists.txt
index e8d85ac4c9f..fc91d84d3b3 100644
--- a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/CMakeLists.txt
+++ b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/CMakeLists.txt
@@ -1,6 +1,6 @@
 itk_module_test()
 
-if(ITK_USE_GPU AND WITH_OPENCL)
+if(ITK_USE_GPU)
   add_definitions(-DGPU)
 
   if(GPU_HANDLES_DOUBLE)
@@ -84,7 +84,7 @@ itk_add_test(
     16
 )
 
-if(ITK_USE_GPU AND WITH_OPENCL)
+if(ITK_USE_GPU)
   itk_add_test(
     NAME itkGPURecursiveYvvGaussianImageFilterTest
     COMMAND

From c5d61f45ebc0d28ef4a8d365dfa828825254a773 Mon Sep 17 00:00:00 2001
From: Irina Vidal <irina.vidal-migallon@inria.fr>
Date: Fri, 12 Jul 2013 17:42:42 +0200
Subject: [PATCH 04/65] BUG: Fixed compilation when no OpenCL platform
 detected.

Signed-off-by: Irina Vidal <irina.vidal-migallon@inria.fr>
---
 ...SmoothingRecursiveYvvGaussianImageFilter.h | 38 ++++----
 ...oothingRecursiveYvvGaussianImageFilter.hxx | 95 ++++++++++---------
 .../test/CMakeLists.txt                       |  3 +-
 3 files changed, 71 insertions(+), 65 deletions(-)

diff --git a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkGPUSmoothingRecursiveYvvGaussianImageFilter.h b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkGPUSmoothingRecursiveYvvGaussianImageFilter.h
index c0edebb793d..12bce4824d9 100644
--- a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkGPUSmoothingRecursiveYvvGaussianImageFilter.h
+++ b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkGPUSmoothingRecursiveYvvGaussianImageFilter.h
@@ -1,14 +1,15 @@
+#ifdef GPU
 
-#ifndef _ITK_GPU_SMOOTHING_RECURSIVE_YVV_GAUSSIAN_IMAGE_FILTER_H_
-#define _ITK_GPU_SMOOTHING_RECURSIVE_YVV_GAUSSIAN_IMAGE_FILTER_H_
+#  ifndef _ITK_GPU_SMOOTHING_RECURSIVE_YVV_GAUSSIAN_IMAGE_FILTER_H_
+#    define _ITK_GPU_SMOOTHING_RECURSIVE_YVV_GAUSSIAN_IMAGE_FILTER_H_
 
-#include "itkImage.h"
-#include "itkPixelTraits.h"
-#include "itkCommand.h"
-#include "itkFixedArray.h"
-#include "itkGPUImageToImageFilter.h"
-#include "itkOpenCLUtil.h"
-#include "itkSmoothingRecursiveYvvGaussianImageFilter.h"
+#    include "itkImage.h"
+#    include "itkPixelTraits.h"
+#    include "itkCommand.h"
+#    include "itkFixedArray.h"
+#    include "itkSmoothingRecursiveYvvGaussianImageFilter.h"
+#    include "itkOpenCLUtil.h"
+#    include "itkGPUImageToImageFilter.h"
 
 
 namespace itk
@@ -41,13 +42,13 @@ class ITK_EXPORT GPUSmoothingRecursiveYvvGaussianImageFilter
   typedef TInputImage                     InputImageType;
   typedef TOutputImage                    OutputImageType;
   typedef typename TInputImage::PixelType PixelType;
-#ifdef WITH_DOUBLE
+#    ifdef WITH_DOUBLE
   typedef typename NumericTraits<PixelType>::RealType       RealType;
   typedef typename NumericTraits<PixelType>::ScalarRealType ScalarRealType;
-#else
+#    else
   typedef typename NumericTraits<PixelType>::FloatType RealType;
   typedef typename NumericTraits<PixelType>::FloatType ScalarRealType;
-#endif
+#    endif
 
   typedef typename itk::GPUTraits<TInputImage>::Type  GPUInputImage;
   typedef typename itk::GPUTraits<TOutputImage>::Type GPUOutputImage;
@@ -95,11 +96,11 @@ class ITK_EXPORT GPUSmoothingRecursiveYvvGaussianImageFilter
   virtual void
   SetUp(ScalarRealType spacing);
 
-#ifdef ITK_USE_CONCEPT_CHECKING
+#    ifdef ITK_USE_CONCEPT_CHECKING
   /** Begin concept checking */
   itkConceptMacro(InputHasNumericTraitsCheck, (Concept::HasNumericTraits<PixelType>));
   /** End concept checking */
-#endif
+#    endif
   /** Get OpenCL Kernel source as a string, creates a GetOpenCLSource method */
   itkGetOpenCLSourceFromKernelMacro(GPUSmoothingRecursiveYvvGaussianImageFilterKernel);
   void
@@ -169,8 +170,9 @@ class ITK_EXPORT GPUSmoothingRecursiveYvvGaussianImageFilter
 
 } // end namespace itk
 
-#ifndef ITK_MANUAL_INSTANTIATION
-#  include "itkGPUSmoothingRecursiveYvvGaussianImageFilter.hxx"
-#endif
+#    ifndef ITK_MANUAL_INSTANTIATION
+#      include "itkGPUSmoothingRecursiveYvvGaussianImageFilter.hxx"
+#    endif
 
-#endif
+#  endif //_ITK_GPU_SMOOTHING_RECURSIVE_YVV_GAUSSIAN_IMAGE_FILTER_H_
+#endif   // GPU
diff --git a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkGPUSmoothingRecursiveYvvGaussianImageFilter.hxx b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkGPUSmoothingRecursiveYvvGaussianImageFilter.hxx
index eda6575efa2..063310adeb5 100644
--- a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkGPUSmoothingRecursiveYvvGaussianImageFilter.hxx
+++ b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkGPUSmoothingRecursiveYvvGaussianImageFilter.hxx
@@ -1,7 +1,9 @@
-#ifndef _ITK_GPU_SMOOTHING_RECURSIVE_YVV_GAUSSIAN_IMAGE_FILTER_HXX_
-#define _ITK_GPU_SMOOTHING_RECURSIVE_YVV_GAUSSIAN_IMAGE_FILTER_HXX_
+#ifdef GPU
 
-#include "itkGPUSmoothingRecursiveYvvGaussianImageFilter.h"
+#  ifndef _ITK_GPU_SMOOTHING_RECURSIVE_YVV_GAUSSIAN_IMAGE_FILTER_HXX_
+#    define _ITK_GPU_SMOOTHING_RECURSIVE_YVV_GAUSSIAN_IMAGE_FILTER_HXX_
+
+#    include "itkGPUSmoothingRecursiveYvvGaussianImageFilter.h"
 
 // #define VERBOSE
 namespace itk
@@ -13,10 +15,10 @@ namespace itk
 template <typename TInputImage, typename TOutputImage>
 GPUSmoothingRecursiveYvvGaussianImageFilter<TInputImage, TOutputImage>::GPUSmoothingRecursiveYvvGaussianImageFilter()
 {
-#ifdef VERBOSE
+#    ifdef VERBOSE
   telltale = rand();
   std::cout << telltale << ". GPUSmoothing::constructor \n";
-#endif
+#    endif
   m_NormalizeAcrossScale = false;
   otPtr = dynamic_cast<GPUOutputImage *>(this->ProcessObject::GetOutput(0));
 
@@ -43,13 +45,13 @@ GPUSmoothingRecursiveYvvGaussianImageFilter<TInputImage, TOutputImage>::BuildKer
     maxLineSize = maxLineSize < lineSizes[d] ? lineSizes[d] : maxLineSize;
   }
 
-#ifdef WITH_DOUBLE
+#    ifdef WITH_DOUBLE
   defines << "#pragma OPENCL EXTENSION cl_khr_fp64 : enable \n";
-#endif
+#    endif
 
-#ifdef NVIDIA
+#    ifdef NVIDIA
   defines << "#pragma OPENCL EXTENSION cl_nv_pragma_unroll : enable \n";
-#endif
+#    endif
 
   defines << "#define DIM_" << TInputImage::ImageDimension << "\n";
   defines << "#define INPIXELTYPE ";
@@ -60,9 +62,9 @@ GPUSmoothingRecursiveYvvGaussianImageFilter<TInputImage, TOutputImage>::BuildKer
   GetTypenameInString(typeid(ScalarRealType), defines);
   defines << "#define MAX_LINE_LENGTH " << maxLineSize << "\n";
 
-#ifdef VERBOSE
+#    ifdef VERBOSE
   std::cout << telltale << ".   Defines: \n" << defines.str() << "\n";
-#endif
+#    endif
 
   // load, build, create kernel
   this->m_GPUKernelManager->LoadProgramFromString(GPUSource, defines.str().c_str());
@@ -76,16 +78,16 @@ template <typename TInputImage, typename TOutputImage>
 void
 GPUSmoothingRecursiveYvvGaussianImageFilter<TInputImage, TOutputImage>::SetUp(ScalarRealType spacing)
 {
-#ifdef VERBOSE
+#    ifdef VERBOSE
   std::cout << telltale << ". GPUSmoothing::SetUp with spacing " << spacing << "\n";
-#endif
+#    endif
   const ScalarRealType sigmad = this->GetSigma() / spacing;
 
   if (this->GetSigma() >= 0.5)
   {
-#ifdef VERBOSE
+#    ifdef VERBOSE
     std::cout << telltale << ". GPUSmoothing::SetUp with sigma " << m_Sigma << "\n";
-#endif
+#    endif
     // Compute q according to 16 in Young et al on Gabor filering
     ScalarRealType q = 0;
     if (sigmad >= 3.556)
@@ -131,7 +133,7 @@ GPUSmoothingRecursiveYvvGaussianImageFilter<TInputImage, TOutputImage>::SetUp(Sc
       (m_B1 * m_B2 + m_B3 * m_B2 * m_B2 - m_B1 * m_B3 * m_B3 - m_B3 * m_B3 * m_B3 - m_B3 * m_B2 + m_B3) / factor;
     m_CPUMatrix[8] = (m_B3 * (m_B1 + m_B3 * m_B2)) / factor;
 
-#ifdef VERBOSE
+#    ifdef VERBOSE
     for (int i = 0; i < 4; ++i)
     {
       std::cout << "B" << i << "  " << m_Bvalues[i] << std::endl;
@@ -141,7 +143,7 @@ GPUSmoothingRecursiveYvvGaussianImageFilter<TInputImage, TOutputImage>::SetUp(Sc
     {
       std::cout << "M" << i << "  " << m_CPUMatrix[i] << std::endl;
     }
-#endif
+#    endif
     this->AllocateGPUCoefficients();
     this->Modified();
   }
@@ -151,9 +153,9 @@ template <typename TInputImage, typename TOutputImage>
 void
 GPUSmoothingRecursiveYvvGaussianImageFilter<TInputImage, TOutputImage>::SetInput(const TInputImage * input)
 {
-#ifdef VERBOSE
+#    ifdef VERBOSE
   std::cout << telltale << ".   GPUSmoothingRecursiveYvvGaussianImageFilter::SetInput \n";
-#endif
+#    endif
   // ProcessObject is not const_correct so this const_cast is required
   ProcessObject::SetNthInput(0, const_cast<TInputImage *>(input));
 
@@ -180,9 +182,9 @@ template <typename TInputImage, typename TOutputImage>
 void
 GPUSmoothingRecursiveYvvGaussianImageFilter<TInputImage, TOutputImage>::SetSigma(ScalarRealType sigma)
 {
-#ifdef VERBOSE
+#    ifdef VERBOSE
   std::cout << telltale << ". GPUSmoothing::SetSigma: " << sigma << " \n";
-#endif
+#    endif
   SigmaArrayType sigmas(sigma);
   this->SetSigmaArray(sigmas);
 }
@@ -194,9 +196,9 @@ template <typename TInputImage, typename TOutputImage>
 void
 GPUSmoothingRecursiveYvvGaussianImageFilter<TInputImage, TOutputImage>::SetSigmaArray(const SigmaArrayType & sigma)
 {
-#ifdef VERBOSE
+#    ifdef VERBOSE
   std::cout << telltale << ". GPUSmoothing::SetSigmaArray" << m_Sigma << " vs new: " << sigma[0] << " \n";
-#endif
+#    endif
   if (this->m_Sigma != sigma)
   {
     this->m_Sigma = sigma;
@@ -204,10 +206,10 @@ GPUSmoothingRecursiveYvvGaussianImageFilter<TInputImage, TOutputImage>::SetSigma
     const typename InputImageType::SpacingType & pixelSize = this->GetOutput()->GetSpacing();
     if (pixelSize[0] != 0)
     {
-#ifdef VERBOSE
+#    ifdef VERBOSE
       std::cout << telltale << ". GPUSmoothing::SetSigmaArray. pixelSize: [" << pixelSize[0] << "," << pixelSize[1]
                 << "," << pixelSize[2] << "] \n";
-#endif
+#    endif
       this->SetUp(pixelSize[0]);
     }
     this->Modified();
@@ -259,9 +261,9 @@ void
 GPUSmoothingRecursiveYvvGaussianImageFilter<TInputImage, TOutputImage>::GenerateInputRequestedRegion() throw(
   InvalidRequestedRegionError)
 {
-#ifdef VERBOSE
+#    ifdef VERBOSE
   std::cout << telltale << ". GPUSmoothing::GenerateInputRequestedRegion \n";
-#endif
+#    endif
   // call the superclass' implementation of this method. this should
   // copy the output requested region to the input requested region
   Superclass::GenerateInputRequestedRegion();
@@ -281,9 +283,9 @@ void
 GPUSmoothingRecursiveYvvGaussianImageFilter<TInputImage, TOutputImage>::EnlargeOutputRequestedRegion(
   DataObject * output)
 {
-#ifdef VERBOSE
+#    ifdef VERBOSE
   std::cout << telltale << ". GPUSmoothing::EnlargeOutputRequestedRegion \n";
-#endif
+#    endif
   TOutputImage * out = dynamic_cast<TOutputImage *>(output);
 
   if (out)
@@ -297,9 +299,9 @@ template <typename TInputImage, typename TOutputImage>
 void
 GPUSmoothingRecursiveYvvGaussianImageFilter<TInputImage, TOutputImage>::AllocateGPUCoefficients()
 {
-#ifdef VERBOSE
+#    ifdef VERBOSE
   std::cout << telltale << ".   GPUSmoothingRecursiveYvvGaussianImageFilter::AllocateGPUInputBuffer \n";
-#endif
+#    endif
 
   m_GPUBCoefficientsDataManager = GPUDataManager::New();
   m_GPUBCoefficientsDataManager->SetBufferSize(4 * sizeof(ScalarRealType));
@@ -329,9 +331,9 @@ template <typename TInputImage, typename TOutputImage>
 void
 GPUSmoothingRecursiveYvvGaussianImageFilter<TInputImage, TOutputImage>::GPUGenerateData(void)
 {
-#ifdef VERBOSE
+#    ifdef VERBOSE
   std::cout << telltale << ".    GPUSmoothing::GPUGenerateData \n";
-#endif
+#    endif
   if (m_FilterGPUKernelHandle == -1)
   {
     this->BuildKernel();
@@ -352,9 +354,9 @@ GPUSmoothingRecursiveYvvGaussianImageFilter<TInputImage, TOutputImage>::GPUGener
   for (int i = 0; i < ndim; ++i)
   {
     this->m_GPUKernelManager->SetKernelArg(m_FilterGPUKernelHandle, argidx++, sizeof(int), &(m_requestedSize[i]));
-#ifdef VERBOSE
+#    ifdef VERBOSE
     std::cout << telltale << ".Arg     " << argidx << ": " << m_requestedSize[i] << "\n";
-#endif
+#    endif
   }
 
   const unsigned int dimArg = argidx;
@@ -364,17 +366,17 @@ GPUSmoothingRecursiveYvvGaussianImageFilter<TInputImage, TOutputImage>::GPUGener
     int globalSize1D = (m_requestedSize[1] > m_requestedSize[0] ? m_requestedSize[1] : m_requestedSize[0]);
 
     this->m_GPUKernelManager->SetKernelArg(m_FilterGPUKernelHandle, dimArg, sizeof(unsigned int), &(X));
-#ifdef VERBOSE
+#    ifdef VERBOSE
     std::cout << telltale << ". Calling 1D kernel on X.\n";
-#endif
+#    endif
     this->m_GPUKernelManager->LaunchKernel1D(m_FilterGPUKernelHandle, globalSize1D, 16);
 
     // change ONLY input and direction of filter
     this->m_GPUKernelManager->SetKernelArgWithImage(m_FilterGPUKernelHandle, 0, otPtr->GetGPUDataManager());
     this->m_GPUKernelManager->SetKernelArg(m_FilterGPUKernelHandle, dimArg, sizeof(unsigned int), &(Y));
-#ifdef VERBOSE
+#    ifdef VERBOSE
     std::cout << telltale << ". Calling 1D kernel on Y.\n";
-#endif
+#    endif
     this->m_GPUKernelManager->LaunchKernel1D(m_FilterGPUKernelHandle, globalSize1D, 16);
   }
   else
@@ -382,24 +384,24 @@ GPUSmoothingRecursiveYvvGaussianImageFilter<TInputImage, TOutputImage>::GPUGener
     // We must optimize our 2D workgroup sizes to go over our 3D volume in each dimension.
 
     this->m_GPUKernelManager->SetKernelArg(m_FilterGPUKernelHandle, argidx++, sizeof(unsigned int), &(X));
-#ifdef VERBOSE
+#    ifdef VERBOSE
     std::cout << telltale << ". Calling 2D kernel on X.\n";
-#endif
+#    endif
     this->m_GPUKernelManager->LaunchKernel2D(m_FilterGPUKernelHandle, m_requestedSize[2], m_requestedSize[1], 16, 16);
 
     // change ONLY input and direction of filter
     this->m_GPUKernelManager->SetKernelArgWithImage(m_FilterGPUKernelHandle, 0, otPtr->GetGPUDataManager());
     this->m_GPUKernelManager->SetKernelArg(m_FilterGPUKernelHandle, dimArg, sizeof(unsigned int), &(Y));
-#ifdef VERBOSE
+#    ifdef VERBOSE
     std::cout << telltale << ". Calling 2D kernel on Y.\n";
-#endif
+#    endif
     this->m_GPUKernelManager->LaunchKernel2D(m_FilterGPUKernelHandle, m_requestedSize[0], m_requestedSize[2], 16, 16);
 
     // input is already pointing to previous output; change ONLY direction of filter
     this->m_GPUKernelManager->SetKernelArg(m_FilterGPUKernelHandle, dimArg, sizeof(unsigned int), &(Z));
-#ifdef VERBOSE
+#    ifdef VERBOSE
     std::cout << telltale << ". Calling 2D kernel on Z.\n";
-#endif
+#    endif
     this->m_GPUKernelManager->LaunchKernel2D(m_FilterGPUKernelHandle, m_requestedSize[0], m_requestedSize[1], 16, 16);
   }
 }
@@ -421,4 +423,5 @@ GPUSmoothingRecursiveYvvGaussianImageFilter<TInputImage, TOutputImage>::PrintSel
 
 } // end namespace itk
 
-#endif
+#  endif //_ITK_GPU_SMOOTHING_RECURSIVE_YVV_GAUSSIAN_IMAGE_FILTER_HXX_
+#endif   // GPU
diff --git a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/CMakeLists.txt b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/CMakeLists.txt
index fc91d84d3b3..083b24638e3 100644
--- a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/CMakeLists.txt
+++ b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/CMakeLists.txt
@@ -13,7 +13,7 @@ if(ITK_USE_GPU)
   endif()
 
   include_directories(
-    "${ITKSmoothingRecursiveYvvGaussianFilter_SOURCE_DIR}/include"
+    "${ITKSmoothingRecursiveYvvGaussianFilter_SOURCE_DIR}/include/"
   )
   include_directories("${ITKSmoothingRecursiveYvvGaussianFilterKernelDir}")
 
@@ -30,6 +30,7 @@ else()
     ITK${itk-module}Tests
     itkCPURecursiveYvvGaussianImageFilterTest.cxx
     itkYvvBenchmark.cxx
+    itkYvvWhiteImageTest.cxx
   )
 endif()
 

From 0613261a740f5230bc619882661547cc94500cf4 Mon Sep 17 00:00:00 2001
From: Irina Vidal Migallon <irina_ext@maunakeatech.com>
Date: Wed, 17 Jul 2013 15:37:24 +0200
Subject: [PATCH 05/65] ENH: Remote module / ctest

Signed-off-by: Irina Vidal Migallon <irina_ext@maunakeatech.com>
---
 .../SmoothingRecursiveYvvGaussianFilter/itk-module.cmake    | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/itk-module.cmake b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/itk-module.cmake
index 1efa50fdc5e..1ee5caa254e 100644
--- a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/itk-module.cmake
+++ b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/itk-module.cmake
@@ -1,10 +1,8 @@
 set(DOCUMENTATION "This module contains a collection of classes for performing
 recursive gaussian filtering (Young Van Vliet implementation).")
 
-#MESSAGE(STATUS "Using GPU: ${ITK_USE_GPU}")
-
 if(ITK_USE_GPU)
-    itk_module(ITKSmoothingRecursiveYvvGaussianFilter
+    itk_module(SmoothingRecursiveYvvGaussianFilter
      DEPENDS
         ITKCommon
         ITKIOImageBase
@@ -19,7 +17,7 @@ if(ITK_USE_GPU)
          "${DOCUMENTATION}"
     )
 else()
-    itk_module(ITKSmoothingRecursiveYvvGaussianFilter
+    itk_module(SmoothingRecursiveYvvGaussianFilter
      DEPENDS
         ITKCommon
         ITKIOImageBase

From ececa8b4cf19e05c1f08cabe33f89a4cfe0b877f Mon Sep 17 00:00:00 2001
From: Irina Vidal Migallon <irina_ext@maunakeatech.com>
Date: Wed, 17 Jul 2013 18:15:45 +0200
Subject: [PATCH 06/65] BUG: Fix remote test conf.

Signed-off-by: Irina Vidal Migallon <irina_ext@maunakeatech.com>
---
 .../itk-module.cmake                          |  4 ++--
 .../src/CMakeLists.txt                        | 22 +++++++++----------
 .../test/CMakeLists.txt                       |  6 ++---
 3 files changed, 15 insertions(+), 17 deletions(-)

diff --git a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/itk-module.cmake b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/itk-module.cmake
index 1ee5caa254e..c49072a572c 100644
--- a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/itk-module.cmake
+++ b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/itk-module.cmake
@@ -2,7 +2,7 @@ set(DOCUMENTATION "This module contains a collection of classes for performing
 recursive gaussian filtering (Young Van Vliet implementation).")
 
 if(ITK_USE_GPU)
-    itk_module(SmoothingRecursiveYvvGaussianFilter
+    itk_module(ITKSmoothingRecursiveYvvGaussianFilter
      DEPENDS
         ITKCommon
         ITKIOImageBase
@@ -17,7 +17,7 @@ if(ITK_USE_GPU)
          "${DOCUMENTATION}"
     )
 else()
-    itk_module(SmoothingRecursiveYvvGaussianFilter
+    itk_module(ITKSmoothingRecursiveYvvGaussianFilter
      DEPENDS
         ITKCommon
         ITKIOImageBase
diff --git a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/src/CMakeLists.txt b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/src/CMakeLists.txt
index 4643d684d59..f1860f06c5a 100644
--- a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/src/CMakeLists.txt
+++ b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/src/CMakeLists.txt
@@ -4,25 +4,25 @@ if (ITK_USE_GPU)
        add_definitions(-DWITH_DOUBLE)
    endif()
 
-	set(GPU_SRC
-	)
+    set(GPU_SRC
+    )
 
-	set(GPU_Kernels
-	GPUSmoothingRecursiveYvvGaussianImageFilter.cl
-	)
+    set(GPU_Kernels
+    GPUSmoothingRecursiveYvvGaussianImageFilter.cl
+    )
 
-	#essentially a #define GPU.
-	add_definitions(-DGPU)
+    #essentially a #define GPU.
+    add_definitions(-DGPU)
 
     if(NVIDIA_GPU)
         add_definitions(-DNVIDIA)
     endif()
 
-	write_gpu_kernels("${GPU_Kernels}" GPU_SRC)
+    write_gpu_kernels("${GPU_Kernels}" GPU_SRC)
 
-	add_library(ITKSmoothingRecursiveYvvGaussianFilter ${GPU_SRC})
-	target_link_libraries(ITKSmoothingRecursiveYvvGaussianFilter ${INRIA_ITK_LIBRARIES} ${OPENCL_LIBRARIES} )
+    add_library(${itk-module} ${GPU_SRC})
+    target_link_libraries(${itk-module} ${INRIA_ITK_LIBRARIES} ${OPENCL_LIBRARIES} )
 
-    #itk_module_target(ITKSmoothingRecursiveYvvGaussianFilter)
+    #itk_module_target(${itk-module})
 
 endif()
diff --git a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/CMakeLists.txt b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/CMakeLists.txt
index 083b24638e3..69495b81693 100644
--- a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/CMakeLists.txt
+++ b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/CMakeLists.txt
@@ -12,10 +12,8 @@ if(ITK_USE_GPU)
     message(STATUS "NVIDIA platform detected")
   endif()
 
-  include_directories(
-    "${ITKSmoothingRecursiveYvvGaussianFilter_SOURCE_DIR}/include/"
-  )
-  include_directories("${ITKSmoothingRecursiveYvvGaussianFilterKernelDir}")
+  include_directories("${${itk-module}_SOURCE_DIR}/include")
+  include_directories("${${itk-module}KernelDir}")
 
   set(
     ITK${itk-module}Tests

From 6cca123b9263d4d4652f8f834375df7d535097ed Mon Sep 17 00:00:00 2001
From: Irina Vidal Migallon <irina_ext@maunakeatech.com>
Date: Mon, 22 Jul 2013 12:40:38 +0200
Subject: [PATCH 07/65] BUG: Fix ctests.

Signed-off-by: Irina Vidal Migallon <irina_ext@maunakeatech.com>
---
 .../test/CMakeLists.txt                       | 36 ++++++++++++-------
 1 file changed, 24 insertions(+), 12 deletions(-)

diff --git a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/CMakeLists.txt b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/CMakeLists.txt
index 69495b81693..8215b51fc28 100644
--- a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/CMakeLists.txt
+++ b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/CMakeLists.txt
@@ -16,7 +16,7 @@ if(ITK_USE_GPU)
   include_directories("${${itk-module}KernelDir}")
 
   set(
-    ITK${itk-module}Tests
+    ${itk-module}Tests
     itkCPURecursiveYvvGaussianImageFilterTest.cxx
     itkGPURecursiveYvvGaussianImageFilterTest.cxx
     itkYvvGpuCpuSimilarityTest.cxx
@@ -25,37 +25,49 @@ if(ITK_USE_GPU)
   )
 else()
   set(
-    ITK${itk-module}Tests
+    ${itk-module}Tests
     itkCPURecursiveYvvGaussianImageFilterTest.cxx
     itkYvvBenchmark.cxx
     itkYvvWhiteImageTest.cxx
   )
 endif()
 
-set(TEST_DATA_ROOT "${${itk-module}_SOURCE_DIR}/Data")
+#set(ITK_TEST_DRIVER itkTestDriver)
 
-createtestdriver(${itk-module} "${${itk-module}-Test_LIBRARIES}" "${ITK${itk-module}Tests}")
+createtestdriver(${itk-module} "${${itk-module}-Test_LIBRARIES}" "${${itk-module}Tests}")
+set(TEST_DATA_ROOT "${${itk-module}_SOURCE_DIR}/Data")
 
 itk_add_test(
-  NAME itkCPURecursiveYvvGaussianImageFilterTest
+  NAME itkCPURecursiveYvvGaussianImageFilterTest2D
   COMMAND
     ${itk-module}TestDriver
     itkCPURecursiveYvvGaussianImageFilterTest
     ${TEST_DATA_ROOT}/1024ex.jpg
     2
     12.0
-    20
+    4
 )
 
 itk_add_test(
-  NAME itkYvvBenchmark
+  NAME itkYvvBenchmark2D
   COMMAND
     ${itk-module}TestDriver
     itkYvvBenchmark
     ${TEST_DATA_ROOT}/1024ex.jpg
     2
     12.0
-    30
+    4
+)
+
+itk_add_test(
+  NAME itkYvvBenchmark3D
+  COMMAND
+    ${itk-module}TestDriver
+    itkYvvBenchmark
+    ${TEST_DATA_ROOT}/256x256x64.tif
+    3
+    12.0
+    2
 )
 
 itk_add_test(
@@ -65,7 +77,7 @@ itk_add_test(
     itkYvvWhiteImageTest
     2
     12.0
-    80
+    6
     512
     512
 )
@@ -77,7 +89,7 @@ itk_add_test(
     itkYvvWhiteImageTest
     3
     12.0
-    5
+    2
     256
     256
     16
@@ -85,7 +97,7 @@ itk_add_test(
 
 if(ITK_USE_GPU)
   itk_add_test(
-    NAME itkGPURecursiveYvvGaussianImageFilterTest
+    NAME itkGPURecursiveYvvGaussianImageFilterTest2D
     COMMAND
       ${itk-module}TestDriver
       itkGPURecursiveYvvGaussianImageFilterTest
@@ -96,7 +108,7 @@ if(ITK_USE_GPU)
   )
 
   itk_add_test(
-    NAME itkYvvGpuCpuSimilarityTest
+    NAME itkYvvGpuCpuSimilarityTest2D
     COMMAND
       ${itk-module}TestDriver
       itkYvvGpuCpuSimilarityTest

From d6d57360869395a7e3d7d2b56cda9dbec9f03b97 Mon Sep 17 00:00:00 2001
From: Irina Vidal-Migallon <irina.vidal-migallon@inria.fr>
Date: Wed, 24 Jul 2013 21:27:11 +0200
Subject: [PATCH 08/65] ENH: added EXCLUDE_FROM_ALL tag

---
 .../SmoothingRecursiveYvvGaussianFilter/itk-module.cmake    | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/itk-module.cmake b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/itk-module.cmake
index c49072a572c..4ba6d6911bd 100644
--- a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/itk-module.cmake
+++ b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/itk-module.cmake
@@ -13,7 +13,8 @@ if(ITK_USE_GPU)
      TEST_DEPENDS
         ITKTestKernel #to handle IO in src
         ITKGPUCommon
-       DESCRIPTION
+     EXCLUDE_FROM_ALL
+     DESCRIPTION
          "${DOCUMENTATION}"
     )
 else()
@@ -25,7 +26,8 @@ else()
         ITKSmoothing
      TEST_DEPENDS
         ITKTestKernel #to handle IO in src
-       DESCRIPTION
+     EXCLUDE_FROM_ALL
+     DESCRIPTION
          "${DOCUMENTATION}"
     )
 endif()

From e6514f16ee35c81459491bf0b7b835540d8eba91 Mon Sep 17 00:00:00 2001
From: Irina Vidal Migallon <irina_ext@maunakeatech.com>
Date: Thu, 25 Jul 2013 12:41:20 +0200
Subject: [PATCH 09/65] ENH: Sleep for stress tests.

Error lim for floats.

Signed-off-by: Irina Vidal Migallon <irina_ext@maunakeatech.com>
---
 .../test/CMakeLists.txt                       | 16 ++++++++++--
 .../test/itkYvvGpuCpuSimilarityTest.cxx       | 26 +++++++++----------
 .../test/yvvFilter.hxx                        |  8 ++++++
 3 files changed, 35 insertions(+), 15 deletions(-)

diff --git a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/CMakeLists.txt b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/CMakeLists.txt
index 8215b51fc28..76e13da0bcf 100644
--- a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/CMakeLists.txt
+++ b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/CMakeLists.txt
@@ -37,6 +37,7 @@ endif()
 createtestdriver(${itk-module} "${${itk-module}-Test_LIBRARIES}" "${${itk-module}Tests}")
 set(TEST_DATA_ROOT "${${itk-module}_SOURCE_DIR}/Data")
 
+#Common tests for CPU and/or GPU
 itk_add_test(
   NAME itkCPURecursiveYvvGaussianImageFilterTest2D
   COMMAND
@@ -96,6 +97,17 @@ itk_add_test(
 )
 
 if(ITK_USE_GPU)
+  itk_add_test(
+    NAME itkGPURecursiveYvvGaussianImageFilterTest2DLow
+    COMMAND
+      ${itk-module}TestDriver
+      itkGPURecursiveYvvGaussianImageFilterTest
+      ${TEST_DATA_ROOT}/1024ex.jpg
+      2
+      0.5 #Lower limit for sigma
+      1
+  )
+
   itk_add_test(
     NAME itkGPURecursiveYvvGaussianImageFilterTest2D
     COMMAND
@@ -103,7 +115,7 @@ if(ITK_USE_GPU)
       itkGPURecursiveYvvGaussianImageFilterTest
       ${TEST_DATA_ROOT}/1024ex.jpg
       2
-      12.0
+      20
       1
   )
 
@@ -114,6 +126,6 @@ if(ITK_USE_GPU)
       itkYvvGpuCpuSimilarityTest
       ${TEST_DATA_ROOT}/1024ex.jpg
       2
-      0.5
+      16
   )
 endif()
diff --git a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/itkYvvGpuCpuSimilarityTest.cxx b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/itkYvvGpuCpuSimilarityTest.cxx
index fda00718535..b8b89082188 100644
--- a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/itkYvvGpuCpuSimilarityTest.cxx
+++ b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/itkYvvGpuCpuSimilarityTest.cxx
@@ -13,10 +13,19 @@
 #include "itkGPUSmoothingRecursiveYvvGaussianImageFilter.h"
 
 
+// The double precision is not well-supported on most GPUs
+// and by many drivers at this time.
+// Relax the RMS threshold to allow for errors due to
+// differences in precision when the GPU does not support
+// double-precision.
+// TODO: Test on Mac/Windows.
+
 #ifdef WITH_DOUBLE
 typedef double PixelType;
+#  define RMSTH 5e-06
 #else
 typedef float PixelType;
+#  define RMSTH 5e-03
 #endif
 
 template <typename ImageType>
@@ -70,7 +79,7 @@ runYvvGpuCpuSimilarityTest(const std::string & inFile, float mySigma)
 
   std::cout << "\nUsing  " << inFile << std::endl;
 
-  for (float sigma = mySigma; sigma <= 32; sigma *= 2)
+  for (float sigma = 0.5; sigma <= mySigma; sigma *= 2)
   {
     typename CPUYvvFilterType::Pointer CPUFilter = CPUYvvFilterType::New();
 
@@ -133,24 +142,15 @@ runYvvGpuCpuSimilarityTest(const std::string & inFile, float mySigma)
     {
       double RMSError = sqrt(diff / (double)nPix);
       std::cout << "RMS Error with sigma = " << sigma << " : " << RMSError << std::endl;
-      // the CPU filter operator has type double
-      // but the double precision is not well-supported on most GPUs
-      // and by most drivers at this time.  Therefore, the GPU filter
-      // operator has type float
-      // relax the RMS threshold here to allow for errors due to
-      // differences in precision
-      // NOTE:
-      //   a threshold of 1.2e-5 worked on linux and Mac, but not Windows
-      //   why?
-      double RMSThreshold = 1.7e-5;
+
       if (vnl_math_isnan(RMSError))
       {
         std::cout << "RMS Error with sigma = " << sigma << " is NaN! nPix: " << nPix << std::endl;
         return EXIT_FAILURE;
       }
-      if (RMSError > RMSThreshold)
+      if (RMSError > RMSTH)
       {
-        std::cout << "RMS Error with sigma = " << sigma << " exceeds threshold (" << RMSThreshold << ")" << std::endl;
+        std::cout << "RMS Error with sigma = " << sigma << " exceeds threshold (" << RMSTH << ")" << std::endl;
         someDiffFlag = true;
       }
     }
diff --git a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/yvvFilter.hxx b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/yvvFilter.hxx
index 6bdb53e82a7..4bdbf3cf9a0 100644
--- a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/yvvFilter.hxx
+++ b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/yvvFilter.hxx
@@ -286,6 +286,9 @@ testImage(std::string inputFilename, float sigma, itk::TimeProbesCollectorBase *
   {
     testGpuFilter<GPUrecursiveYVVFilterType>(
       gpuYvvLabel, inputFilename, size, sigma, parameterStream.str(), timeCollector, true);
+    /* Stress tests (e.g. high ntests) may cause CL_MEM_OBJECT_ALLOCATION_FAILURE,
+     * even when re-instantiating input _and_ filter. Not all GPUs support resetting, so adding a sleep helps.*/
+    sleep(1);
   }
 
   std::string gpuYvvLabelNoSync = "gpu_Yvv_NoSyn";
@@ -293,6 +296,7 @@ testImage(std::string inputFilename, float sigma, itk::TimeProbesCollectorBase *
   {
     testGpuFilter<GPUrecursiveYVVFilterType>(
       gpuYvvLabelNoSync, inputFilename, size, sigma, parameterStream.str(), timeCollector, false);
+    sleep(1); // helps for stress tests
   }
 
 #endif
@@ -344,6 +348,9 @@ testWhite(typename ImageType::SizeType   size,
   {
     testGpuFilter<GPUrecursiveYVVFilterType>(
       gpuYvvLabelSync, emptyFilename, size, sigma, parameterStream.str(), timeCollector, true);
+    /* Stress tests (e.g. high ntests) may cause CL_MEM_OBJECT_ALLOCATION_FAILURE,
+     * even when re-instantiating input _and_ filter. Not all GPUs support resetting, so adding a sleep helps.*/
+    sleep(1);
   }
 
   std::string gpuYvvLabelNoSync = "gpu_Yvv_NoSyn";
@@ -351,6 +358,7 @@ testWhite(typename ImageType::SizeType   size,
   {
     testGpuFilter<GPUrecursiveYVVFilterType>(
       gpuYvvLabelNoSync, emptyFilename, size, sigma, parameterStream.str(), timeCollector, false);
+    sleep(1); // helps for stress tests
   }
 #endif
   return EXIT_SUCCESS;

From 6485c7f797de23a17dbc9567c65eab03d0e52aa6 Mon Sep 17 00:00:00 2001
From: Irina Vidal Migallon <irina_ext@maunakeatech.com>
Date: Fri, 26 Jul 2013 10:57:18 +0200
Subject: [PATCH 10/65] ENH: Use normalised RMS error for ctest.

Signed-off-by: Irina Vidal Migallon <irina_ext@maunakeatech.com>
---
 ...itkRecursiveLineYvvGaussianImageFilter.hxx |  2 ++
 .../test/itkYvvGpuCpuSimilarityTest.cxx       | 26 +++++++++++++------
 2 files changed, 20 insertions(+), 8 deletions(-)

diff --git a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkRecursiveLineYvvGaussianImageFilter.hxx b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkRecursiveLineYvvGaussianImageFilter.hxx
index 228e2452252..f945837a133 100644
--- a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkRecursiveLineYvvGaussianImageFilter.hxx
+++ b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkRecursiveLineYvvGaussianImageFilter.hxx
@@ -180,6 +180,8 @@ RecursiveLineYvvGaussianImageFilter<TInputImage, TOutputImage>::FilterDataArray(
     outs[i] = scratch[i];
 
 
+  // AntiCausal direction pass
+
   // Handle outside values according to Triggs and Sdika
   const ScalarRealType u_p = data[ln - 1] / (1.0 - m_B1 - m_B2 - m_B3);
   const ScalarRealType v_p = u_p / (1.0 - m_B1 - m_B2 - m_B3);
diff --git a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/itkYvvGpuCpuSimilarityTest.cxx b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/itkYvvGpuCpuSimilarityTest.cxx
index b8b89082188..c990361f106 100644
--- a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/itkYvvGpuCpuSimilarityTest.cxx
+++ b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/itkYvvGpuCpuSimilarityTest.cxx
@@ -6,6 +6,7 @@
 #include "itkImageFileReader.h"
 #include "itkImageFileWriter.h"
 #include "itkTimeProbe.h"
+#include "itkMinimumMaximumImageCalculator.h"
 
 #include "itkGPUImage.h"
 #include "itkGPUKernelManager.h"
@@ -22,10 +23,10 @@
 
 #ifdef WITH_DOUBLE
 typedef double PixelType;
-#  define RMSTH 5e-06
+#  define NRMSTH 5e-07
 #else
 typedef float PixelType;
-#  define RMSTH 5e-03
+#  define NRMSTH 5e-04
 #endif
 
 template <typename ImageType>
@@ -121,6 +122,14 @@ runYvvGpuCpuSimilarityTest(const std::string & inFile, float mySigma)
     // RMS Error check
     // ---------------
 
+    typedef itk::MinimumMaximumImageCalculator<ImageType> ImageCalculatorFilterType;
+
+    typename ImageCalculatorFilterType::Pointer imageCalculatorFilter = ImageCalculatorFilterType::New();
+    imageCalculatorFilter->SetImage(CPUFilter->GetOutput());
+    imageCalculatorFilter->Compute();
+
+    double                                    maxPx = imageCalculatorFilter->GetMaximum();
+    double                                    minPx = imageCalculatorFilter->GetMinimum();
     double                                    diff = 0;
     unsigned int                              nPix = 0;
     itk::ImageRegionIterator<OutputImageType> cit(CPUFilter->GetOutput(),
@@ -140,17 +149,18 @@ runYvvGpuCpuSimilarityTest(const std::string & inFile, float mySigma)
 
     if (nPix > 0)
     {
-      double RMSError = sqrt(diff / (double)nPix);
-      std::cout << "RMS Error with sigma = " << sigma << " : " << RMSError << std::endl;
+      double NormRMSError = sqrt(diff / (double)nPix) / (maxPx - minPx); //
+      std::cout << "Normalised RMS Error with sigma = " << sigma << " : " << NormRMSError << std::endl;
 
-      if (vnl_math_isnan(RMSError))
+      if (vnl_math_isnan(NormRMSError))
       {
-        std::cout << "RMS Error with sigma = " << sigma << " is NaN! nPix: " << nPix << std::endl;
+        std::cout << "Normalised RMS Error with sigma = " << sigma << " is NaN! nPix: " << nPix << std::endl;
         return EXIT_FAILURE;
       }
-      if (RMSError > RMSTH)
+      if (NormRMSError > NRMSTH)
       {
-        std::cout << "RMS Error with sigma = " << sigma << " exceeds threshold (" << RMSTH << ")" << std::endl;
+        std::cout << "Normalised RMS Error with sigma = " << sigma << " exceeds threshold (" << NRMSTH << ")"
+                  << std::endl;
         someDiffFlag = true;
       }
     }

From 02b897f7f53fdec0b382c25ccf86e983bb73695a Mon Sep 17 00:00:00 2001
From: Irina Vidal Migallon <irina_ext@maunakeatech.com>
Date: Fri, 26 Jul 2013 10:57:18 +0200
Subject: [PATCH 11/65] ENH: Use normalised RMS error for ctest.

Signed-off-by: Irina Vidal Migallon <irina_ext@maunakeatech.com>
---
 ...itkRecursiveLineYvvGaussianImageFilter.hxx |  2 ++
 .../test/CMakeLists.txt                       |  2 +-
 .../test/itkYvvGpuCpuSimilarityTest.cxx       | 26 +++++++++++++------
 3 files changed, 21 insertions(+), 9 deletions(-)

diff --git a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkRecursiveLineYvvGaussianImageFilter.hxx b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkRecursiveLineYvvGaussianImageFilter.hxx
index 228e2452252..f945837a133 100644
--- a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkRecursiveLineYvvGaussianImageFilter.hxx
+++ b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkRecursiveLineYvvGaussianImageFilter.hxx
@@ -180,6 +180,8 @@ RecursiveLineYvvGaussianImageFilter<TInputImage, TOutputImage>::FilterDataArray(
     outs[i] = scratch[i];
 
 
+  // AntiCausal direction pass
+
   // Handle outside values according to Triggs and Sdika
   const ScalarRealType u_p = data[ln - 1] / (1.0 - m_B1 - m_B2 - m_B3);
   const ScalarRealType v_p = u_p / (1.0 - m_B1 - m_B2 - m_B3);
diff --git a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/CMakeLists.txt b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/CMakeLists.txt
index 76e13da0bcf..d79a4622992 100644
--- a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/CMakeLists.txt
+++ b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/CMakeLists.txt
@@ -126,6 +126,6 @@ if(ITK_USE_GPU)
       itkYvvGpuCpuSimilarityTest
       ${TEST_DATA_ROOT}/1024ex.jpg
       2
-      16
+      14
   )
 endif()
diff --git a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/itkYvvGpuCpuSimilarityTest.cxx b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/itkYvvGpuCpuSimilarityTest.cxx
index b8b89082188..c990361f106 100644
--- a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/itkYvvGpuCpuSimilarityTest.cxx
+++ b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/itkYvvGpuCpuSimilarityTest.cxx
@@ -6,6 +6,7 @@
 #include "itkImageFileReader.h"
 #include "itkImageFileWriter.h"
 #include "itkTimeProbe.h"
+#include "itkMinimumMaximumImageCalculator.h"
 
 #include "itkGPUImage.h"
 #include "itkGPUKernelManager.h"
@@ -22,10 +23,10 @@
 
 #ifdef WITH_DOUBLE
 typedef double PixelType;
-#  define RMSTH 5e-06
+#  define NRMSTH 5e-07
 #else
 typedef float PixelType;
-#  define RMSTH 5e-03
+#  define NRMSTH 5e-04
 #endif
 
 template <typename ImageType>
@@ -121,6 +122,14 @@ runYvvGpuCpuSimilarityTest(const std::string & inFile, float mySigma)
     // RMS Error check
     // ---------------
 
+    typedef itk::MinimumMaximumImageCalculator<ImageType> ImageCalculatorFilterType;
+
+    typename ImageCalculatorFilterType::Pointer imageCalculatorFilter = ImageCalculatorFilterType::New();
+    imageCalculatorFilter->SetImage(CPUFilter->GetOutput());
+    imageCalculatorFilter->Compute();
+
+    double                                    maxPx = imageCalculatorFilter->GetMaximum();
+    double                                    minPx = imageCalculatorFilter->GetMinimum();
     double                                    diff = 0;
     unsigned int                              nPix = 0;
     itk::ImageRegionIterator<OutputImageType> cit(CPUFilter->GetOutput(),
@@ -140,17 +149,18 @@ runYvvGpuCpuSimilarityTest(const std::string & inFile, float mySigma)
 
     if (nPix > 0)
     {
-      double RMSError = sqrt(diff / (double)nPix);
-      std::cout << "RMS Error with sigma = " << sigma << " : " << RMSError << std::endl;
+      double NormRMSError = sqrt(diff / (double)nPix) / (maxPx - minPx); //
+      std::cout << "Normalised RMS Error with sigma = " << sigma << " : " << NormRMSError << std::endl;
 
-      if (vnl_math_isnan(RMSError))
+      if (vnl_math_isnan(NormRMSError))
       {
-        std::cout << "RMS Error with sigma = " << sigma << " is NaN! nPix: " << nPix << std::endl;
+        std::cout << "Normalised RMS Error with sigma = " << sigma << " is NaN! nPix: " << nPix << std::endl;
         return EXIT_FAILURE;
       }
-      if (RMSError > RMSTH)
+      if (NormRMSError > NRMSTH)
       {
-        std::cout << "RMS Error with sigma = " << sigma << " exceeds threshold (" << RMSTH << ")" << std::endl;
+        std::cout << "Normalised RMS Error with sigma = " << sigma << " exceeds threshold (" << NRMSTH << ")"
+                  << std::endl;
         someDiffFlag = true;
       }
     }

From 5f26231768035f94c05b84511f3d702928e8294d Mon Sep 17 00:00:00 2001
From: Irina Vidal <irina.vidal-migallon@inria.fr>
Date: Mon, 29 Jul 2013 16:49:32 +0200
Subject: [PATCH 12/65] DOC: Copyright + doxygen doc.

Smaller test images.

Signed-off-by: Irina Vidal <irina.vidal-migallon@inria.fr>
---
 ...SmoothingRecursiveYvvGaussianImageFilter.h | 35 +++++++++++++++++
 .../itkRecursiveLineYvvGaussianImageFilter.h  | 38 ++++++++++++++++++-
 ...SmoothingRecursiveYvvGaussianImageFilter.h | 33 +++++++++++++++-
 .../src/OpenCLInfo.cpp                        | 20 ++++++++--
 .../test/CMakeLists.txt                       | 10 ++---
 5 files changed, 126 insertions(+), 10 deletions(-)

diff --git a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkGPUSmoothingRecursiveYvvGaussianImageFilter.h b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkGPUSmoothingRecursiveYvvGaussianImageFilter.h
index 12bce4824d9..3c1719ae60c 100644
--- a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkGPUSmoothingRecursiveYvvGaussianImageFilter.h
+++ b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkGPUSmoothingRecursiveYvvGaussianImageFilter.h
@@ -1,3 +1,21 @@
+/*=========================================================================
+ *
+ * Copyright Insight Software Consortium
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0.txt
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ *=========================================================================*/
+
 #ifdef GPU
 
 #  ifndef _ITK_GPU_SMOOTHING_RECURSIVE_YVV_GAUSSIAN_IMAGE_FILTER_H_
@@ -14,6 +32,23 @@
 
 namespace itk
 {
+
+/**
+ * \class GPUSmoothingRecursiveYvvGaussianImageFilter
+ * \brief Recursive Gaussian blur based on Young-Van Vliet's algorithm and
+ *  implemented for GPU.
+ *
+ *  The GPU implementation is more efficient than the CPU
+ *  the bigger the image is; use the benchmark tests to establish the size for which
+ *  the GPU performs better for your particular hardware configuration.
+ *
+ *  More information in the Insight Journal publication:
+ *  http://hdl.handle.net/10380/3425
+ *
+ * \ingroup ITKSmoothingRecursiveYvvGaussianFilter
+ */
+
+
 itkGPUKernelClassMacro(GPUSmoothingRecursiveYvvGaussianImageFilterKernel);
 
 template <typename TInputImage, typename TOutputImage = TInputImage>
diff --git a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkRecursiveLineYvvGaussianImageFilter.h b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkRecursiveLineYvvGaussianImageFilter.h
index 13d35699c80..962559e5b1f 100644
--- a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkRecursiveLineYvvGaussianImageFilter.h
+++ b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkRecursiveLineYvvGaussianImageFilter.h
@@ -1,3 +1,21 @@
+/*=========================================================================
+ *
+ * Copyright Insight Software Consortium
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0.txt
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ *=========================================================================*/
+
 #ifndef _ITK_RECURSIVE_LINE_YVV_GAUSSIAN_IMAGE_FILTER_H_
 #define _ITK_RECURSIVE_LINE_YVV_GAUSSIAN_IMAGE_FILTER_H_
 
@@ -6,6 +24,24 @@
 
 namespace itk
 {
+
+/**
+ * \class RecursiveLineYvvGaussianImageFilter
+ * \brief 1D recursive Gaussian blur based on Young-Van Vliet's algorithm,
+ *  implemented for CPU.
+ *
+ *  This CPU implementation is more efficient than the GPU implamentation for
+ *  smaller images (e.g. 512 and smaller for quadcores at over 3GHz); use
+ *  the benchmark tests to establish the size for which this implementation
+ *  performs better for your particular hardware configuration.
+ *
+ *  More information in the Insight Journal publication:
+ *  http://hdl.handle.net/10380/3425
+ *
+ * \ingroup ITKSmoothingRecursiveYvvGaussianFilter
+ */
+
+
 template <typename TInputImage, typename TOutputImage = TInputImage>
 class ITK_EXPORT RecursiveLineYvvGaussianImageFilter : public ImageToImageFilter<TInputImage, TOutputImage>
 {
@@ -151,7 +187,7 @@ class ITK_EXPORT RecursiveLineYvvGaussianImageFilter : public ImageToImageFilter
 
   /** Normalize the image across scale space */
   bool m_NormalizeAcrossScale;
-  int  telltale; // TODO: REMOVE
+  // int telltale; //TODO: REMOVE
 };
 
 
diff --git a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkSmoothingRecursiveYvvGaussianImageFilter.h b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkSmoothingRecursiveYvvGaussianImageFilter.h
index f89f0c0a6eb..72001590ef8 100644
--- a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkSmoothingRecursiveYvvGaussianImageFilter.h
+++ b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkSmoothingRecursiveYvvGaussianImageFilter.h
@@ -1,3 +1,20 @@
+/*=========================================================================
+ *
+ * Copyright Insight Software Consortium
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0.txt
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ *=========================================================================*/
 
 #ifndef _ITK_SMOOTHING_RECURSIVE_YVV_GAUSSIAN_IMAGE_FILTER_H_
 #define _ITK_SMOOTHING_RECURSIVE_YVV_GAUSSIAN_IMAGE_FILTER_H_
@@ -12,7 +29,21 @@
 
 namespace itk
 {
-
+/**
+ * \class SmoothingRecursiveYvvGaussianImageFilter
+ * \brief Recursive Gaussian blurring filter based on Young-Van Vliet's
+ *  algorithm, implemented for CPU.
+ *
+ *  This CPU implementation is more efficient than the GPU implamentation for
+ *  smaller images (e.g. 512x512 and smaller for quadcores at over 3GHz); use
+ *  the benchmark tests to establish the size for which this implementation
+ *  performs better for your particular hardware configuration.
+ *
+ *  More information in the Insight Journal publication:
+ *  http://hdl.handle.net/10380/3425
+ *
+ * \ingroup ITKSmoothingRecursiveYvvGaussianFilter
+ */
 template <typename TInputImage, typename TOutputImage = TInputImage>
 class ITK_EXPORT SmoothingRecursiveYvvGaussianImageFilter : public ImageToImageFilter<TInputImage, TOutputImage>
 {
diff --git a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/src/OpenCLInfo.cpp b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/src/OpenCLInfo.cpp
index 0d826b11266..fd1106339c6 100644
--- a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/src/OpenCLInfo.cpp
+++ b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/src/OpenCLInfo.cpp
@@ -54,6 +54,8 @@ main(int argc, char ** argv)
   }
 
   std::cout << "Number of platforms: \t" << numPlatforms << std::endl;
+  int result = 1;
+
   // Iterate through the list of platforms displaying associated information
   for (cl_uint i = 0; i < numPlatforms; i++)
   {
@@ -77,6 +79,7 @@ main(int argc, char ** argv)
 
     std::cout << "\tNumber of devices: \t" << numDevices << std::endl;
     // Iterate through each device, displaying associated information
+
     for (cl_uint j = 0; j < numDevices; j++)
     {
       cl_uint vectorWidthDouble;
@@ -85,10 +88,21 @@ main(int argc, char ** argv)
       if (vectorWidthDouble == 0)
       {
         std::cout << "Found a device that does not support double precision.\n";
-        return 20;
+        result = 20;
+      }
+      cl_ulong sharedMemSize, maxObjMem;
+      errNum = clGetDeviceInfo(devices[j], CL_DEVICE_LOCAL_MEM_SIZE, sizeof(cl_ulong), &sharedMemSize, NULL);
+      // std::cout<<"sharedMemSize: "<<sharedMemSize/1024<<"KB.\n";
+      errNum = clGetDeviceInfo(devices[j], CL_DEVICE_MAX_MEM_ALLOC_SIZE, sizeof(cl_ulong), &maxObjMem, NULL);
+      // std::cout<<"MaxObjMem: "<<maxObjMem/(1024.0*1024.0)<<"MB.\n";
+
+      if (maxObjMem / (1024.0 * 1024.0) <= 512 || sharedMemSize <= 49000)
+      {
+        std::cout << "GPU with little RAM. Setting single-precision.\n";
+        result = 10;
       }
     }
   }
-  std::cout << "All devices supported double precision.\n";
-  return 1;
+  std::cout << "All devices verified.\n";
+  return result;
 }
diff --git a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/CMakeLists.txt b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/CMakeLists.txt
index d79a4622992..b8e20aa131e 100644
--- a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/CMakeLists.txt
+++ b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/CMakeLists.txt
@@ -43,7 +43,7 @@ itk_add_test(
   COMMAND
     ${itk-module}TestDriver
     itkCPURecursiveYvvGaussianImageFilterTest
-    ${TEST_DATA_ROOT}/1024ex.jpg
+    ${TEST_DATA_ROOT}/512ex.jpg
     2
     12.0
     4
@@ -54,7 +54,7 @@ itk_add_test(
   COMMAND
     ${itk-module}TestDriver
     itkYvvBenchmark
-    ${TEST_DATA_ROOT}/1024ex.jpg
+    ${TEST_DATA_ROOT}/512ex.jpg
     2
     12.0
     4
@@ -102,7 +102,7 @@ if(ITK_USE_GPU)
     COMMAND
       ${itk-module}TestDriver
       itkGPURecursiveYvvGaussianImageFilterTest
-      ${TEST_DATA_ROOT}/1024ex.jpg
+      ${TEST_DATA_ROOT}/512ex.jpg
       2
       0.5 #Lower limit for sigma
       1
@@ -113,7 +113,7 @@ if(ITK_USE_GPU)
     COMMAND
       ${itk-module}TestDriver
       itkGPURecursiveYvvGaussianImageFilterTest
-      ${TEST_DATA_ROOT}/1024ex.jpg
+      ${TEST_DATA_ROOT}/512ex.jpg
       2
       20
       1
@@ -124,7 +124,7 @@ if(ITK_USE_GPU)
     COMMAND
       ${itk-module}TestDriver
       itkYvvGpuCpuSimilarityTest
-      ${TEST_DATA_ROOT}/1024ex.jpg
+      ${TEST_DATA_ROOT}/512ex.jpg
       2
       14
   )

From 406bc01c96fc93fa85930397f30f9f3de2e0b3ef Mon Sep 17 00:00:00 2001
From: Irina Vidal <irina.vidal-migallon@inria.fr>
Date: Tue, 30 Jul 2013 15:28:49 +0200
Subject: [PATCH 13/65] COMP: [CPU] Vectorial images. CMake sets double for CPU
 by default.

Signed-off-by: Irina Vidal <irina.vidal-migallon@inria.fr>
---
 .../include/itkRecursiveLineYvvGaussianImageFilter.hxx        | 4 ++--
 .../SmoothingRecursiveYvvGaussianFilter/test/CMakeLists.txt   | 2 ++
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkRecursiveLineYvvGaussianImageFilter.hxx b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkRecursiveLineYvvGaussianImageFilter.hxx
index f945837a133..32216f0368c 100644
--- a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkRecursiveLineYvvGaussianImageFilter.hxx
+++ b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkRecursiveLineYvvGaussianImageFilter.hxx
@@ -183,8 +183,8 @@ RecursiveLineYvvGaussianImageFilter<TInputImage, TOutputImage>::FilterDataArray(
   // AntiCausal direction pass
 
   // Handle outside values according to Triggs and Sdika
-  const ScalarRealType u_p = data[ln - 1] / (1.0 - m_B1 - m_B2 - m_B3);
-  const ScalarRealType v_p = u_p / (1.0 - m_B1 - m_B2 - m_B3);
+  const RealType u_p = data[ln - 1] / (1.0 - m_B1 - m_B2 - m_B3);
+  const RealType v_p = u_p / (1.0 - m_B1 - m_B2 - m_B3);
 
   RealType Vn0 = v_p;
   RealType Vn1 = v_p;
diff --git a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/CMakeLists.txt b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/CMakeLists.txt
index b8e20aa131e..6babf2b3425 100644
--- a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/CMakeLists.txt
+++ b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/CMakeLists.txt
@@ -24,6 +24,8 @@ if(ITK_USE_GPU)
     itkYvvWhiteImageTest.cxx
   )
 else()
+  #No GPU, but CPU user will probably want double-precision.
+  add_definitions(-DWITH_DOUBLE)
   set(
     ${itk-module}Tests
     itkCPURecursiveYvvGaussianImageFilterTest.cxx

From 6ad8051835921df8255a2c1d72b9fbc730061090 Mon Sep 17 00:00:00 2001
From: Xiaoxiao Liu <xiaoxiao.liu@kitware.com>
Date: Mon, 26 Aug 2013 14:21:43 -0400
Subject: [PATCH 14/65] STYLE: Remove "ITK" from the module name.

Following the new naming rules for ITK remote modules,
the remote module name should not contain the "ITK" prefix.
---
 .../itkGPUSmoothingRecursiveYvvGaussianImageFilter.h        | 2 +-
 .../include/itkRecursiveLineYvvGaussianImageFilter.h        | 2 +-
 .../include/itkSmoothingRecursiveYvvGaussianImageFilter.h   | 2 +-
 .../SmoothingRecursiveYvvGaussianFilter/itk-module.cmake    | 6 ++++--
 4 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkGPUSmoothingRecursiveYvvGaussianImageFilter.h b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkGPUSmoothingRecursiveYvvGaussianImageFilter.h
index 3c1719ae60c..5172360eb3d 100644
--- a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkGPUSmoothingRecursiveYvvGaussianImageFilter.h
+++ b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkGPUSmoothingRecursiveYvvGaussianImageFilter.h
@@ -45,7 +45,7 @@ namespace itk
  *  More information in the Insight Journal publication:
  *  http://hdl.handle.net/10380/3425
  *
- * \ingroup ITKSmoothingRecursiveYvvGaussianFilter
+ * \ingroup SmoothingRecursiveYvvGaussianFilter
  */
 
 
diff --git a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkRecursiveLineYvvGaussianImageFilter.h b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkRecursiveLineYvvGaussianImageFilter.h
index 962559e5b1f..1f5634dde46 100644
--- a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkRecursiveLineYvvGaussianImageFilter.h
+++ b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkRecursiveLineYvvGaussianImageFilter.h
@@ -38,7 +38,7 @@ namespace itk
  *  More information in the Insight Journal publication:
  *  http://hdl.handle.net/10380/3425
  *
- * \ingroup ITKSmoothingRecursiveYvvGaussianFilter
+ * \ingroup SmoothingRecursiveYvvGaussianFilter
  */
 
 
diff --git a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkSmoothingRecursiveYvvGaussianImageFilter.h b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkSmoothingRecursiveYvvGaussianImageFilter.h
index 72001590ef8..c574beb0abf 100644
--- a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkSmoothingRecursiveYvvGaussianImageFilter.h
+++ b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkSmoothingRecursiveYvvGaussianImageFilter.h
@@ -42,7 +42,7 @@ namespace itk
  *  More information in the Insight Journal publication:
  *  http://hdl.handle.net/10380/3425
  *
- * \ingroup ITKSmoothingRecursiveYvvGaussianFilter
+ * \ingroup SmoothingRecursiveYvvGaussianFilter
  */
 template <typename TInputImage, typename TOutputImage = TInputImage>
 class ITK_EXPORT SmoothingRecursiveYvvGaussianImageFilter : public ImageToImageFilter<TInputImage, TOutputImage>
diff --git a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/itk-module.cmake b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/itk-module.cmake
index 4ba6d6911bd..425df4e1887 100644
--- a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/itk-module.cmake
+++ b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/itk-module.cmake
@@ -1,8 +1,10 @@
 set(DOCUMENTATION "This module contains a collection of classes for performing
 recursive gaussian filtering (Young Van Vliet implementation).")
 
+
+set(ModuleName "SmoothingRecursiveYvvGaussianFilter")
 if(ITK_USE_GPU)
-    itk_module(ITKSmoothingRecursiveYvvGaussianFilter
+    itk_module(${ModuleName}
      DEPENDS
         ITKCommon
         ITKIOImageBase
@@ -18,7 +20,7 @@ if(ITK_USE_GPU)
          "${DOCUMENTATION}"
     )
 else()
-    itk_module(ITKSmoothingRecursiveYvvGaussianFilter
+    itk_module(${ModuleName}
      DEPENDS
         ITKCommon
         ITKIOImageBase

From c33c7c9ca5cdcef3cd50372af528851ec69df378 Mon Sep 17 00:00:00 2001
From: Xiaoxiao Liu <xiaoxiao.liu@kitware.com>
Date: Thu, 12 Sep 2013 10:35:51 -0400
Subject: [PATCH 15/65] BUG: FIX: ITK warnings of deprecated EXCLUDE_FROM_ALL.

EXCLUDE_FROM_ALL is replaced by EXCLUDE_FROM_DEFAULT
in ITK commit:e599fcaa09556992cb9a1c37ff5cf655b90ae4fc
---
 .../SmoothingRecursiveYvvGaussianFilter/itk-module.cmake        | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/itk-module.cmake b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/itk-module.cmake
index 425df4e1887..9cf215623ca 100644
--- a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/itk-module.cmake
+++ b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/itk-module.cmake
@@ -28,7 +28,7 @@ else()
         ITKSmoothing
      TEST_DEPENDS
         ITKTestKernel #to handle IO in src
-     EXCLUDE_FROM_ALL
+     EXCLUDE_FROM_DEFAULT
      DESCRIPTION
          "${DOCUMENTATION}"
     )

From efa1ce3b472dce27e5acb1657dc2297c661d9fdc Mon Sep 17 00:00:00 2001
From: Irina Vidal <irina.vidal-migallon@inria.fr>
Date: Tue, 14 Jan 2014 17:18:49 +0100
Subject: [PATCH 16/65] BUG: Fix: ITK EXCLUDE_FROM_ALL warning for GPU case.

Signed-off-by: Irina Vidal <irina.vidal-migallon@inria.fr>
---
 .../SmoothingRecursiveYvvGaussianFilter/itk-module.cmake        | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/itk-module.cmake b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/itk-module.cmake
index 9cf215623ca..ae10b7bc9d9 100644
--- a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/itk-module.cmake
+++ b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/itk-module.cmake
@@ -15,7 +15,7 @@ if(ITK_USE_GPU)
      TEST_DEPENDS
         ITKTestKernel #to handle IO in src
         ITKGPUCommon
-     EXCLUDE_FROM_ALL
+     EXCLUDE_FROM_DEFAULT
      DESCRIPTION
          "${DOCUMENTATION}"
     )

From 634fd1745e547f2f106902ee31900487788cfa42 Mon Sep 17 00:00:00 2001
From: Brian Helba <brian.helba@kitware.com>
Date: Wed, 5 Feb 2014 11:55:08 -0500
Subject: [PATCH 17/65] COMP: Fix compliler warnings

Also clean up itkYvvWhiteImageTest.cxx to have proper whitespace.
---
 .../test/itkYvvWhiteImageTest.cxx             | 51 +++++++++----------
 .../test/yvvFilter.hxx                        |  5 +-
 2 files changed, 27 insertions(+), 29 deletions(-)

diff --git a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/itkYvvWhiteImageTest.cxx b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/itkYvvWhiteImageTest.cxx
index 2110cea93d7..1817947c7b4 100644
--- a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/itkYvvWhiteImageTest.cxx
+++ b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/itkYvvWhiteImageTest.cxx
@@ -12,6 +12,11 @@ typedef double PixelType;
 typedef float PixelType;
 #endif
 
+#define die(error_msg)                                                                                   \
+  std::cerr << "Error: " << error_msg << std::endl;                                                      \
+  std::cerr << "Usage: " << argv[0] << " ndimension sigma num_runs width [height] [depth]" << std::endl; \
+  return EXIT_FAILURE;
+
 int
 itkYvvWhiteImageTest(int argc, char * argv[])
 {
@@ -25,30 +30,22 @@ itkYvvWhiteImageTest(int argc, char * argv[])
 
   if (argc < 4)
   {
-    std::cerr << "Error: missing arguments." << std::endl;
-    std::cerr << "Usage: " << argv[0] << " ndimension sigma num_runs width [height] [depth]" << std::endl;
-    return EXIT_FAILURE;
+    die("missing arguments.");
   }
 
   int dim = atoi(argv[1]);
   if (argc < 4 + dim - 1)
   {
-    std::cerr << "Error: missing arguments." << std::endl;
-    std::cerr << "Usage: " << argv[0] << " ndimension sigma num_runs width [height] [depth]" << std::endl;
-    return EXIT_FAILURE;
+    die("missing arguments.");
   }
-
-
-  unsigned int ntests, size[dim];
-  float        sigma;
-
   if (dim == 3 && argc != 7)
   {
-    std::cerr << "Error: missing arguments for a 3D image." << std::endl;
-    std::cerr << "Usage: " << argv[0] << " ndimension sigma num_runs width [height] [depth]" << std::endl;
-    return EXIT_FAILURE;
+    die("missing arguments for a 3D image.");
   }
 
+  unsigned int   ntests;
+  unsigned int * size = new unsigned int[dim];
+  float          sigma;
   try
   {
     sigma = atof(argv[2]);
@@ -60,9 +57,8 @@ itkYvvWhiteImageTest(int argc, char * argv[])
   }
   catch (...)
   {
-    std::cerr << "Error: invalid size arguments." << std::endl;
-    std::cerr << "Usage: " << argv[0] << " ndimension sigma num_runs width height [depth]" << std::endl;
-    return EXIT_FAILURE;
+    delete[] size;
+    die("invalid size arguments.");
   }
 
   std::cout << ":::  Received: dim =" << dim << ", sigma= " << sigma << ", ntests= " << ntests << ", size= ";
@@ -70,35 +66,36 @@ itkYvvWhiteImageTest(int argc, char * argv[])
   {
     std::cout << size[i] << " ";
   }
+  std::cout << ":::" << std::endl << std::endl;
 
-  std::cout << ":::\n\n";
+  int result;
 
-  int                          res = EXIT_SUCCESS;
   itk::TimeProbesCollectorBase timeCollector;
-
   if (dim == 2)
   {
     typedef itk::Image<PixelType, 2> ImageType;
     ImageType::SizeType              size2D = { { size[0], size[1] } };
-    res = testWhite<ImageType>(size2D, sigma, &timeCollector, ntests);
+    result = testWhite<ImageType>(size2D, sigma, &timeCollector, ntests);
   }
   else if (dim == 3)
   {
     typedef itk::Image<PixelType, 3> ImageType;
     ImageType::SizeType              size3D = { { size[0], size[1], size[2] } };
-    res = testWhite<ImageType>(size3D, sigma, &timeCollector, ntests);
+    result = testWhite<ImageType>(size3D, sigma, &timeCollector, ntests);
   }
   else
   {
     std::cerr << "Error: only 2 or 3 dimensions allowed, " << dim << " selected." << std::endl;
-    res = EXIT_FAILURE;
+    result = EXIT_FAILURE;
   }
-
   timeCollector.Report();
+
+  delete[] size;
+
 #ifndef GPU
-  std::cout
-    << "--      ITK GPU support was not detected and/or not configured, so no GPU filters were tested.     --\n";
+  std::cout << "--      ITK GPU support was not detected and/or not configured, so no GPU filters were tested.     --"
+            << std::endl;
 #endif
 
-  return res;
+  return result;
 }
diff --git a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/yvvFilter.hxx b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/yvvFilter.hxx
index 4bdbf3cf9a0..03ee7adcf0f 100644
--- a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/yvvFilter.hxx
+++ b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/yvvFilter.hxx
@@ -261,8 +261,9 @@ testImage(std::string inputFilename, float sigma, itk::TimeProbesCollectorBase *
   typedef itk::SmoothingRecursiveGaussianImageFilter<CPUImageType, CPUImageType>    DericheFilterType;
 
   std::cout << ":::: Testing on " << inputFilename << ", using sigma = " << sigma << "   ::::" << std::endl;
-  typename ImageType::SizeType size; // empty, since we'll be using an actual file
-  std::ostringstream           parameterStream;
+  typename ImageType::SizeType size;
+  size.Fill(0); // empty, since we'll be using an actual file
+  std::ostringstream parameterStream;
   parameterStream << "_s" << sigma << "_";
 
   ////////////////////////////////

From a91400c50a9c36702e5d215d2d9a711d0c6d5914 Mon Sep 17 00:00:00 2001
From: Irina Vidal Migallon <irina_ext@maunakeatech.com>
Date: Wed, 26 Feb 2014 16:12:15 +0100
Subject: [PATCH 18/65] ENH: CPU-YVV: InPlace filter

Signed-off-by: Irina Vidal Migallon <irina_ext@maunakeatech.com>
---
 .../itkRecursiveLineYvvGaussianImageFilter.h  | 34 +++----
 ...itkRecursiveLineYvvGaussianImageFilter.hxx | 95 +++++--------------
 ...SmoothingRecursiveYvvGaussianImageFilter.h | 49 +++++-----
 ...oothingRecursiveYvvGaussianImageFilter.hxx | 74 ++++++++++++---
 4 files changed, 126 insertions(+), 126 deletions(-)

diff --git a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkRecursiveLineYvvGaussianImageFilter.h b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkRecursiveLineYvvGaussianImageFilter.h
index 1f5634dde46..0e4a0cffd18 100644
--- a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkRecursiveLineYvvGaussianImageFilter.h
+++ b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkRecursiveLineYvvGaussianImageFilter.h
@@ -16,11 +16,13 @@
  *
  *=========================================================================*/
 
+#pragma once
 #ifndef _ITK_RECURSIVE_LINE_YVV_GAUSSIAN_IMAGE_FILTER_H_
-#define _ITK_RECURSIVE_LINE_YVV_GAUSSIAN_IMAGE_FILTER_H_
+#  define _ITK_RECURSIVE_LINE_YVV_GAUSSIAN_IMAGE_FILTER_H_
 
-#include "itkImageToImageFilter.h"
-#include "itkNumericTraits.h"
+#  include <itkInPlaceImageFilter.h>
+#  include <itkNumericTraits.h>
+#  include <itkImageRegionSplitterDirection.h>
 
 namespace itk
 {
@@ -43,12 +45,12 @@ namespace itk
 
 
 template <typename TInputImage, typename TOutputImage = TInputImage>
-class ITK_EXPORT RecursiveLineYvvGaussianImageFilter : public ImageToImageFilter<TInputImage, TOutputImage>
+class ITK_EXPORT RecursiveLineYvvGaussianImageFilter : public InPlaceImageFilter<TInputImage, TOutputImage>
 {
 public:
   /** Standard class typedefs. */
   typedef RecursiveLineYvvGaussianImageFilter           Self;
-  typedef ImageToImageFilter<TInputImage, TOutputImage> Superclass;
+  typedef InPlaceImageFilter<TInputImage, TOutputImage> Superclass;
   typedef SmartPointer<Self>                            Pointer;
   typedef SmartPointer<const Self>                      ConstPointer;
 
@@ -56,7 +58,7 @@ class ITK_EXPORT RecursiveLineYvvGaussianImageFilter : public ImageToImageFilter
   itkNewMacro(Self);
 
   /** Type macro that defines a name for this class. */
-  itkTypeMacro(RecursiveLineYvvGaussianImageFilter, ImageToImageFilter);
+  itkTypeMacro(RecursiveLineYvvGaussianImageFilter, InPlaceImageFilter);
 
   /** Smart pointer typedef support.  */
   typedef typename TInputImage::Pointer      InputImagePointer;
@@ -68,13 +70,13 @@ class ITK_EXPORT RecursiveLineYvvGaussianImageFilter : public ImageToImageFilter
    * meant for scalars.
    */
   typedef typename TInputImage::PixelType InputPixelType;
-#ifdef WITH_DOUBLE
+#  ifdef WITH_DOUBLE
   typedef typename NumericTraits<InputPixelType>::RealType       RealType;
   typedef typename NumericTraits<InputPixelType>::ScalarRealType ScalarRealType;
-#else
+#  else
   typedef typename NumericTraits<InputPixelType>::FloatType RealType;
   typedef typename NumericTraits<InputPixelType>::FloatType ScalarRealType;
-#endif
+#  endif
 
   typedef typename TOutputImage::RegionType OutputImageRegionType;
 
@@ -133,8 +135,8 @@ class ITK_EXPORT RecursiveLineYvvGaussianImageFilter : public ImageToImageFilter
   void
   ThreadedGenerateData(const OutputImageRegionType & outputRegionForThread, ThreadIdType threadId);
 
-  unsigned int
-  SplitRequestedRegion(unsigned int i, unsigned int num, OutputImageRegionType & splitRegion);
+  virtual const ImageRegionSplitterBase *
+  GetImageRegionSplitter(void) const;
 
   /** RecursiveLineYvvGaussianImageFilter needs all of the input only in the
    *  "Direction" dimension. Therefore we enlarge the output's
@@ -186,16 +188,16 @@ class ITK_EXPORT RecursiveLineYvvGaussianImageFilter : public ImageToImageFilter
   ScalarRealType m_Sigma;
 
   /** Normalize the image across scale space */
-  bool m_NormalizeAcrossScale;
-  // int telltale; //TODO: REMOVE
+  bool                                  m_NormalizeAcrossScale;
+  ImageRegionSplitterDirection::Pointer m_ImageRegionSplitter;
 };
 
 
 } // end namespace itk
 
-#ifndef ITK_MANUAL_INSTANTIATION
-#  include "itkRecursiveLineYvvGaussianImageFilter.hxx"
-#endif
+#  ifndef ITK_MANUAL_INSTANTIATION
+#    include "itkRecursiveLineYvvGaussianImageFilter.hxx"
+#  endif
 
 
 #endif
diff --git a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkRecursiveLineYvvGaussianImageFilter.hxx b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkRecursiveLineYvvGaussianImageFilter.hxx
index 32216f0368c..48d4625ef5f 100644
--- a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkRecursiveLineYvvGaussianImageFilter.hxx
+++ b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkRecursiveLineYvvGaussianImageFilter.hxx
@@ -1,11 +1,12 @@
+#pragma once
 #ifndef _ITK_RECURSIVE_LINE_YVV_GAUSSIAN_IMAGE_FILTER_HXX_
-#define _ITK_RECURSIVE_LINE_YVV_GAUSSIAN_IMAGE_FILTER_HXX_
+#  define _ITK_RECURSIVE_LINE_YVV_GAUSSIAN_IMAGE_FILTER_HXX_
 
-#include "itkRecursiveLineYvvGaussianImageFilter.h"
-#include "itkObjectFactory.h"
-#include "itkImageLinearIteratorWithIndex.h"
-#include "itkImageLinearConstIteratorWithIndex.h"
-#include "itkProgressReporter.h"
+#  include "itkRecursiveLineYvvGaussianImageFilter.h"
+#  include "itkObjectFactory.h"
+#  include "itkImageLinearIteratorWithIndex.h"
+#  include "itkImageLinearConstIteratorWithIndex.h"
+#  include "itkProgressReporter.h"
 
 // #define VERBOSE
 
@@ -20,7 +21,10 @@ RecursiveLineYvvGaussianImageFilter<TInputImage, TOutputImage>::RecursiveLineYvv
   this->SetNumberOfRequiredOutputs(1);
   this->SetNumberOfRequiredInputs(1);
 
-#ifdef VERBOSE
+  this->InPlaceOff();
+
+  m_ImageRegionSplitter = ImageRegionSplitterDirection::New();
+#  ifdef VERBOSE
   std::cout << "-----------Line filter TYPES\n";
 
   if (typeid(typename TInputImage::PixelType) == typeid(double))
@@ -36,7 +40,7 @@ RecursiveLineYvvGaussianImageFilter<TInputImage, TOutputImage>::RecursiveLineYvv
 
   /*if( typeid ( InternalRealType ) == typeid ( double ))
           std::cout<<"InternalRealType double\n"; */
-#endif
+#  endif
 }
 
 
@@ -92,7 +96,7 @@ RecursiveLineYvvGaussianImageFilter<TInputImage, TOutputImage>::SetUp(ScalarReal
     q = 0.0561 * sigmad * sigmad + 0.5784 * sigmad - 0.2568;
   }
 
-  // Compute B and B0 to B3 according to Young et al 1995
+  // Compute B and B1 to B3 according to Young et al 2003
   ScalarRealType m0 = 1.16680;
   ScalarRealType m1 = 1.10783;
   ScalarRealType m2 = 1.40586;
@@ -107,8 +111,6 @@ RecursiveLineYvvGaussianImageFilter<TInputImage, TOutputImage>::SetUp(ScalarReal
 
   // M Matrix for initialization on backward pass, from Triggs and Sdika, IEEE TSP
   m_MMatrix = vnl_matrix<ScalarRealType>(3, 3);
-  // const ScalarRealType factor = (1 + m_B1 - m_B2 + m_B3) * (1 - m_B1 - m_B2 - m_B3) * (1 + m_B2 + (m_B1 - m_B3) *
-  // m_B3);
 
   m_MMatrix(0, 0) = -m_B3 * m_B1 + 1 - m_B3 * m_B3 - m_B2;
   m_MMatrix(0, 1) = (m_B3 + m_B1) * (m_B2 + m_B3 * m_B1);
@@ -124,7 +126,7 @@ RecursiveLineYvvGaussianImageFilter<TInputImage, TOutputImage>::SetUp(ScalarReal
 
   m_MMatrix /= (1 + m_B1 - m_B2 + m_B3) * (1 - m_B1 - m_B2 - m_B3) * (1 + m_B2 + (m_B1 - m_B3) * m_B3);
 
-#ifdef VERBOSE
+#  ifdef VERBOSE
   std::cout << "cB   " << m_B << std::endl;
   std::cout << "cB1  " << m_B1 << std::endl;
   std::cout << "cB2  " << m_B2 << std::endl;
@@ -137,7 +139,7 @@ RecursiveLineYvvGaussianImageFilter<TInputImage, TOutputImage>::SetUp(ScalarReal
       std::cout << "cM(" << i << "," << j << ")  " << m_MMatrix(i, j) << std::endl;
     }
   }
-#endif
+#  endif
 }
 
 /**
@@ -257,68 +259,15 @@ RecursiveLineYvvGaussianImageFilter<TInputImage, TOutputImage>::EnlargeOutputReq
 
 
 template <typename TInputImage, typename TOutputImage>
-unsigned int
-RecursiveLineYvvGaussianImageFilter<TInputImage, TOutputImage>::SplitRequestedRegion(
-  unsigned int            i,
-  unsigned int            num,
-  OutputImageRegionType & splitRegion)
+const ImageRegionSplitterBase *
+RecursiveLineYvvGaussianImageFilter<TInputImage, TOutputImage>::GetImageRegionSplitter(void) const
 {
   /*
   #ifdef VERBOSE
           std::cout<<telltale  << ". itkRecursiveLineYvv::SplitRequestedRegion \n";
   #endif
   */
-  // Get the output pointer
-  OutputImageType *                       outputPtr = this->GetOutput();
-  const typename TOutputImage::SizeType & requestedRegionSize = outputPtr->GetRequestedRegion().GetSize();
-
-  int                              splitAxis;
-  typename TOutputImage::IndexType splitIndex;
-  typename TOutputImage::SizeType  splitSize;
-
-  // Initialize the splitRegion to the output requested region
-  splitRegion = outputPtr->GetRequestedRegion();
-  splitIndex = splitRegion.GetIndex();
-  splitSize = splitRegion.GetSize();
-
-  // split on the outermost dimension available
-  // and avoid the current dimension
-  splitAxis = outputPtr->GetImageDimension() - 1;
-  while (requestedRegionSize[splitAxis] == 1 || splitAxis == (int)m_Direction)
-  {
-    --splitAxis;
-    if (splitAxis < 0)
-    { // cannot split
-      itkDebugMacro("  Cannot Split");
-      return 1;
-    }
-  }
-
-  // determine the actual number of pieces that will be generated
-  typename TOutputImage::SizeType::SizeValueType range = requestedRegionSize[splitAxis];
-  int                                            valuesPerThread = (int)vcl_ceil(range / (double)num);
-  unsigned int                                   maxThreadIdUsed = (int)vcl_ceil(range / (double)valuesPerThread) - 1;
-
-  // Split the region
-  if (i < maxThreadIdUsed)
-  {
-    splitIndex[splitAxis] += i * valuesPerThread;
-    splitSize[splitAxis] = valuesPerThread;
-  }
-  if (i == maxThreadIdUsed)
-  {
-    splitIndex[splitAxis] += i * valuesPerThread;
-    // last thread needs to process the "rest" dimension being split
-    splitSize[splitAxis] = splitSize[splitAxis] - i * valuesPerThread;
-  }
-
-  // set the split region ivars
-  splitRegion.SetIndex(splitIndex);
-  splitRegion.SetSize(splitSize);
-
-  itkDebugMacro("  Split Piece: " << splitRegion);
-
-  return maxThreadIdUsed + 1;
+  return this->m_ImageRegionSplitter;
 }
 
 
@@ -345,6 +294,7 @@ RecursiveLineYvvGaussianImageFilter<TInputImage, TOutputImage>::BeforeThreadedGe
 
   const typename InputImageType::SpacingType & pixelSize = inputImage->GetSpacing();
 
+  this->m_ImageRegionSplitter->SetDirection(m_Direction);
   this->SetUp(pixelSize[m_Direction]);
 
   RegionType region = outputImage->GetRequestedRegion();
@@ -434,10 +384,9 @@ RecursiveLineYvvGaussianImageFilter<TInputImage, TOutputImage>::ThreadedGenerate
   inputIterator.GoToBegin();
   outputIterator.GoToBegin();
 
-  const typename TInputImage::OffsetValueType * offsetTable = inputImage->GetOffsetTable();
-
-  const unsigned int numberOfLinesToProcess = offsetTable[TInputImage::ImageDimension] / ln;
-  ProgressReporter   progress(this, threadId, numberOfLinesToProcess, 10);
+  const unsigned int numberOfLinesToProcess =
+    outputRegionForThread.GetNumberOfPixels() / outputRegionForThread.GetSize(this->m_Direction);
+  ProgressReporter progress(this, threadId, numberOfLinesToProcess, 10);
 
 
   try // this try is intended to catch an eventual AbortException.
diff --git a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkSmoothingRecursiveYvvGaussianImageFilter.h b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkSmoothingRecursiveYvvGaussianImageFilter.h
index c574beb0abf..935e3467580 100644
--- a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkSmoothingRecursiveYvvGaussianImageFilter.h
+++ b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkSmoothingRecursiveYvvGaussianImageFilter.h
@@ -15,16 +15,17 @@
  * limitations under the License.
  *
  *=========================================================================*/
+#pragma once
 
 #ifndef _ITK_SMOOTHING_RECURSIVE_YVV_GAUSSIAN_IMAGE_FILTER_H_
-#define _ITK_SMOOTHING_RECURSIVE_YVV_GAUSSIAN_IMAGE_FILTER_H_
+#  define _ITK_SMOOTHING_RECURSIVE_YVV_GAUSSIAN_IMAGE_FILTER_H_
 
-#include "itkRecursiveLineYvvGaussianImageFilter.h"
-#include "itkCastImageFilter.h"
-#include "itkImage.h"
-#include "itkPixelTraits.h"
-#include "itkCommand.h"
-#include "itkFixedArray.h"
+#  include "itkRecursiveLineYvvGaussianImageFilter.h"
+#  include "itkCastImageFilter.h"
+#  include "itkImage.h"
+#  include "itkPixelTraits.h"
+#  include "itkCommand.h"
+#  include "itkFixedArray.h"
 
 
 namespace itk
@@ -45,12 +46,12 @@ namespace itk
  * \ingroup SmoothingRecursiveYvvGaussianFilter
  */
 template <typename TInputImage, typename TOutputImage = TInputImage>
-class ITK_EXPORT SmoothingRecursiveYvvGaussianImageFilter : public ImageToImageFilter<TInputImage, TOutputImage>
+class ITK_EXPORT SmoothingRecursiveYvvGaussianImageFilter : public InPlaceImageFilter<TInputImage, TOutputImage>
 {
 public:
   /** Standard class typedefs. */
   typedef SmoothingRecursiveYvvGaussianImageFilter      Self;
-  typedef ImageToImageFilter<TInputImage, TOutputImage> Superclass;
+  typedef InPlaceImageFilter<TInputImage, TOutputImage> Superclass;
   typedef SmartPointer<Self>                            Pointer;
   typedef SmartPointer<const Self>                      ConstPointer;
 
@@ -59,16 +60,16 @@ class ITK_EXPORT SmoothingRecursiveYvvGaussianImageFilter : public ImageToImageF
   typedef TInputImage                     InputImageType;
   typedef TOutputImage                    OutputImageType;
   typedef typename TInputImage::PixelType PixelType;
-#ifdef WITH_DOUBLE
+#  ifdef WITH_DOUBLE
   typedef typename NumericTraits<PixelType>::RealType       RealType;
   typedef typename NumericTraits<PixelType>::ScalarRealType ScalarRealType;
-#else
+#  else
   typedef typename NumericTraits<PixelType>::FloatType RealType;
   typedef typename NumericTraits<PixelType>::FloatType ScalarRealType;
-#endif
+#  endif
 
   /** Runtime information support. */
-  itkTypeMacro(SmoothingRecursiveYvvGaussianImageFilter, ImageToImageFilter);
+  itkTypeMacro(SmoothingRecursiveYvvGaussianImageFilter, InPlaceImageFilter);
 
   /** Image dimension. */
   itkStaticConstMacro(ImageDimension, unsigned int, TInputImage::ImageDimension);
@@ -80,8 +81,8 @@ class ITK_EXPORT SmoothingRecursiveYvvGaussianImageFilter : public ImageToImageF
    RealType is usually 'double' in NumericTraits.
    Here we prefer float in order to save memory.  */
 
-  typedef typename NumericTraits<PixelType>::FloatType                    InternalRealType;
-  typedef Image<InternalRealType, itkGetStaticConstMacro(ImageDimension)> RealImageType;
+  typedef typename NumericTraits<PixelType>::FloatType                     InternalRealType;
+  typedef typename InputImageType::template Rebind<InternalRealType>::Type RealImageType;
 
   /**  The first in the pipeline  */
   typedef RecursiveLineYvvGaussianImageFilter<InputImageType, RealImageType> FirstGaussianFilterType;
@@ -127,14 +128,18 @@ class ITK_EXPORT SmoothingRecursiveYvvGaussianImageFilter : public ImageToImageF
   itkGetConstMacro(NormalizeAcrossScale, bool);
 
   void
-  SetNumberOfThreads(int nb);
-  using Superclass::SetNumberOfThreads;
+  SetNumberOfThreads(ThreadIdType nb);
+
+  // See super class for doxygen documentation
+  //
+  virtual bool
+  CanRunInPlace(void) const;
 
-#ifdef ITK_USE_CONCEPT_CHECKING
+#  ifdef ITK_USE_CONCEPT_CHECKING
   /** Begin concept checking */
   itkConceptMacro(InputHasNumericTraitsCheck, (Concept::HasNumericTraits<PixelType>));
   /** End concept checking */
-#endif
+#  endif
 
 protected:
   SmoothingRecursiveYvvGaussianImageFilter();
@@ -177,8 +182,8 @@ class ITK_EXPORT SmoothingRecursiveYvvGaussianImageFilter : public ImageToImageF
 
 } // end namespace itk
 
-#ifndef ITK_MANUAL_INSTANTIATION
-#  include "itkSmoothingRecursiveYvvGaussianImageFilter.hxx"
-#endif
+#  ifndef ITK_MANUAL_INSTANTIATION
+#    include "itkSmoothingRecursiveYvvGaussianImageFilter.hxx"
+#  endif
 
 #endif
diff --git a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkSmoothingRecursiveYvvGaussianImageFilter.hxx b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkSmoothingRecursiveYvvGaussianImageFilter.hxx
index b142ffb6e8f..2fe2b17700f 100644
--- a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkSmoothingRecursiveYvvGaussianImageFilter.hxx
+++ b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkSmoothingRecursiveYvvGaussianImageFilter.hxx
@@ -1,9 +1,10 @@
+#pragma once
 #ifndef _ITK_SMOOTHING_RECURSIVE_YVV_GAUSSIAN_IMAGE_FILTER_HXX_
-#define _ITK_SMOOTHING_RECURSIVE_YVV_GAUSSIAN_IMAGE_FILTER_HXX_
+#  define _ITK_SMOOTHING_RECURSIVE_YVV_GAUSSIAN_IMAGE_FILTER_HXX_
 
-#include "itkSmoothingRecursiveYvvGaussianImageFilter.h"
-#include "itkImageRegionIteratorWithIndex.h"
-#include "itkProgressAccumulator.h"
+#  include "itkSmoothingRecursiveYvvGaussianImageFilter.h"
+#  include "itkImageRegionIteratorWithIndex.h"
+#  include "itkProgressAccumulator.h"
 
 // #define VERBOSE
 
@@ -23,7 +24,7 @@ SmoothingRecursiveYvvGaussianImageFilter<TInputImage, TOutputImage>::SmoothingRe
   m_NormalizeAcrossScale = false;
 
   m_FirstSmoothingFilter = FirstGaussianFilterType::New();
-  m_FirstSmoothingFilter->SetDirection(0);
+  m_FirstSmoothingFilter->SetDirection(ImageDimension - 1);
   m_FirstSmoothingFilter->SetNormalizeAcrossScale(m_NormalizeAcrossScale);
   m_FirstSmoothingFilter->ReleaseDataFlagOn();
 
@@ -31,8 +32,9 @@ SmoothingRecursiveYvvGaussianImageFilter<TInputImage, TOutputImage>::SmoothingRe
   {
     m_SmoothingFilters[i] = InternalGaussianFilterType::New();
     m_SmoothingFilters[i]->SetNormalizeAcrossScale(m_NormalizeAcrossScale);
-    m_SmoothingFilters[i]->SetDirection(i + 1);
+    m_SmoothingFilters[i]->SetDirection(i);
     m_SmoothingFilters[i]->ReleaseDataFlagOn();
+    m_SmoothingFilters[i]->InPlaceOn();
   }
 
   m_SmoothingFilters[0]->SetInput(m_FirstSmoothingFilter->GetOutput());
@@ -43,6 +45,9 @@ SmoothingRecursiveYvvGaussianImageFilter<TInputImage, TOutputImage>::SmoothingRe
 
   m_CastingFilter = CastingFilterType::New();
   m_CastingFilter->SetInput(m_SmoothingFilters[ImageDimension - 2]->GetOutput());
+  m_CastingFilter->InPlaceOn();
+
+  this->InPlaceOff();
 
   //
   // NB: We must call SetSigma in order to initialize the smoothing
@@ -52,7 +57,7 @@ SmoothingRecursiveYvvGaussianImageFilter<TInputImage, TOutputImage>::SmoothingRe
   this->m_Sigma.Fill(0.0);
   this->SetSigma(1.0);
 
-#ifdef VERBOSE
+#  ifdef VERBOSE
   std::cout << "-----------Smoothing filter TYPES\n";
 
   if (typeid(typename TInputImage::PixelType) == typeid(double))
@@ -69,13 +74,13 @@ SmoothingRecursiveYvvGaussianImageFilter<TInputImage, TOutputImage>::SmoothingRe
   if (typeid(InternalRealType) == typeid(double))
     std::cout << "InternalRealType double\n";
 
-#endif
+#  endif
 }
 
 
 template <typename TInputImage, typename TOutputImage>
 void
-SmoothingRecursiveYvvGaussianImageFilter<TInputImage, TOutputImage>::SetNumberOfThreads(int nb)
+SmoothingRecursiveYvvGaussianImageFilter<TInputImage, TOutputImage>::SetNumberOfThreads(ThreadIdType nb)
 {
   /*#ifdef VERBOSE
           std::cout<<telltale  << ". itkSmoothingYvv::SetNumberOfThreads \n";
@@ -88,6 +93,26 @@ SmoothingRecursiveYvvGaussianImageFilter<TInputImage, TOutputImage>::SetNumberOf
   m_FirstSmoothingFilter->SetNumberOfThreads(nb);
 }
 
+template <typename TInputImage, typename TOutputImage>
+bool
+SmoothingRecursiveYvvGaussianImageFilter<TInputImage, TOutputImage>::CanRunInPlace(void) const
+{
+  // Note: There are two different ways this filter may try to run
+  // in-place:
+  // 1) Similar to the standard way, when the input and output image
+  // are of the same type, they can share the bulk data. The output
+  // will be grafted onto the last filter. In this fashion the input
+  // and output will be the same bulk data, but the intermediate
+  // mini-pipeline will use different data.
+  // 2) If the input image is the same type as the RealImage used for
+  // the mini-pipeline, then all the filters may re-use the same
+  // bulk data, stealing it from the input then moving it down the
+  // pipeline filter by filter. Additionally, if the output is also
+  // RealType then the last filter will run in-place making the entire
+  // pipeline in-place and only utilizing on copy of the bulk data.
+
+  return m_FirstSmoothingFilter->CanRunInPlace() || this->Superclass::CanRunInPlace();
+}
 
 // Set value of Sigma (isotropic)
 
@@ -117,10 +142,10 @@ SmoothingRecursiveYvvGaussianImageFilter<TInputImage, TOutputImage>::SetSigmaArr
     this->m_Sigma = sigma;
     for (unsigned int i = 0; i < ImageDimension - 1; i++)
     {
-      m_SmoothingFilters[i]->SetSigma(m_Sigma[i + 1]);
+      m_SmoothingFilters[i]->SetSigma(m_Sigma[i]);
       m_SmoothingFilters[i]->Modified();
     }
-    m_FirstSmoothingFilter->SetSigma(m_Sigma[0]);
+    m_FirstSmoothingFilter->SetSigma(m_Sigma[ImageDimension - 1]);
     m_FirstSmoothingFilter->Modified();
 
     this->Modified();
@@ -175,9 +200,6 @@ SmoothingRecursiveYvvGaussianImageFilter<TInputImage, TOutputImage>::SetNormaliz
 }
 
 
-//
-//
-//
 template <typename TInputImage, typename TOutputImage>
 void
 SmoothingRecursiveYvvGaussianImageFilter<TInputImage, TOutputImage>::GenerateInputRequestedRegion() throw(
@@ -241,6 +263,28 @@ SmoothingRecursiveYvvGaussianImageFilter<TInputImage, TOutputImage>::GenerateDat
     }
   }
 
+  // If this filter is running in-place, then set the first smoothing
+  // filter to steal the bulk data, by running in-place.
+  if (this->CanRunInPlace() && this->GetInPlace())
+  {
+    m_FirstSmoothingFilter->InPlaceOn();
+
+    // To make this filter's input and out share the same data, call
+    // the InPlace's/Superclass's allocate methods, which takes care
+    // of the needed bulk data sharing.
+    this->AllocateOutputs();
+  }
+  else
+  {
+    m_FirstSmoothingFilter->InPlaceOff();
+  }
+
+  // If the last filter is running in-place then this bulk data is not
+  // needed, release it to save memory.
+  if (m_CastingFilter->CanRunInPlace())
+  {
+    this->GetOutput()->ReleaseData();
+  }
 
   // Create a process accumulator for tracking the progress of this minipipeline
   ProgressAccumulator::Pointer progress = ProgressAccumulator::New();
@@ -248,7 +292,7 @@ SmoothingRecursiveYvvGaussianImageFilter<TInputImage, TOutputImage>::GenerateDat
 
   // Register the filter with the with progress accumulator using
   // equal weight proportion
-  for (unsigned int i = 0; i < ImageDimension - 1; i++)
+  for (unsigned int i = 0; i < ImageDimension - 1; ++i)
   {
     progress->RegisterInternalFilter(m_SmoothingFilters[i], 1.0 / (ImageDimension));
   }

From 08d32743a9ee4d16865df6c6cc6f461caf1d9318 Mon Sep 17 00:00:00 2001
From: Irina Vidal Migallon <irina_ext@maunakeatech.com>
Date: Wed, 26 Feb 2014 16:36:27 +0100
Subject: [PATCH 19/65] ENH: uncrustify

Signed-off-by: Irina Vidal Migallon <irina_ext@maunakeatech.com>
---
 ...SmoothingRecursiveYvvGaussianImageFilter.h | 21 ++++++-----
 ...oothingRecursiveYvvGaussianImageFilter.hxx | 26 +++++++-------
 .../itkRecursiveLineYvvGaussianImageFilter.h  | 11 +++---
 ...itkRecursiveLineYvvGaussianImageFilter.hxx | 35 ++++++++++---------
 ...SmoothingRecursiveYvvGaussianImageFilter.h | 17 ++++-----
 ...oothingRecursiveYvvGaussianImageFilter.hxx | 22 ++++++------
 6 files changed, 68 insertions(+), 64 deletions(-)

diff --git a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkGPUSmoothingRecursiveYvvGaussianImageFilter.h b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkGPUSmoothingRecursiveYvvGaussianImageFilter.h
index 5172360eb3d..99eed2118f2 100644
--- a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkGPUSmoothingRecursiveYvvGaussianImageFilter.h
+++ b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkGPUSmoothingRecursiveYvvGaussianImageFilter.h
@@ -29,10 +29,8 @@
 #    include "itkOpenCLUtil.h"
 #    include "itkGPUImageToImageFilter.h"
 
-
 namespace itk
 {
-
 /**
  * \class GPUSmoothingRecursiveYvvGaussianImageFilter
  * \brief Recursive Gaussian blur based on Young-Van Vliet's algorithm and
@@ -48,7 +46,6 @@ namespace itk
  * \ingroup SmoothingRecursiveYvvGaussianFilter
  */
 
-
 itkGPUKernelClassMacro(GPUSmoothingRecursiveYvvGaussianImageFilterKernel);
 
 template <typename TInputImage, typename TOutputImage = TInputImage>
@@ -60,7 +57,8 @@ class ITK_EXPORT GPUSmoothingRecursiveYvvGaussianImageFilter
 public:
   /** Standard class typedefs. */
   typedef GPUSmoothingRecursiveYvvGaussianImageFilter Self;
-  // typedef SmoothingRecursiveYvvGaussianImageFilter<TInputImage,TOutputImage>   CPUSuperclass;
+  // typedef SmoothingRecursiveYvvGaussianImageFilter<TInputImage,TOutputImage>
+  //    CPUSuperclass;
   typedef GPUImageToImageFilter<TInputImage,
                                 TOutputImage,
                                 SmoothingRecursiveYvvGaussianImageFilter<TInputImage, TOutputImage>>
@@ -72,7 +70,6 @@ class ITK_EXPORT GPUSmoothingRecursiveYvvGaussianImageFilter
   typedef SmartPointer<Self>       Pointer;
   typedef SmartPointer<const Self> ConstPointer;
 
-
   /** Pixel Type of the input image */
   typedef TInputImage                     InputImageType;
   typedef TOutputImage                    OutputImageType;
@@ -116,16 +113,20 @@ class ITK_EXPORT GPUSmoothingRecursiveYvvGaussianImageFilter
    axis. */
   void
   SetSigmaArray(const SigmaArrayType & sigmas);
+
   void
   SetSigma(ScalarRealType sigma);
+
   SigmaArrayType
   GetSigmaArray() const;
+
   ScalarRealType
   GetSigma() const;
 
   /** Define which normalization factor will be used for the Gaussian */
   void
   SetNormalizeAcrossScale(bool normalizeInScaleSpace);
+
   itkGetConstMacro(NormalizeAcrossScale, bool);
 
   virtual void
@@ -144,7 +145,7 @@ class ITK_EXPORT GPUSmoothingRecursiveYvvGaussianImageFilter
 
 protected:
   GPUSmoothingRecursiveYvvGaussianImageFilter();
-  virtual ~GPUSmoothingRecursiveYvvGaussianImageFilter() {};
+  virtual ~GPUSmoothingRecursiveYvvGaussianImageFilter() {}
   void
   PrintSelf(std::ostream & os, Indent indent) const;
 
@@ -163,6 +164,7 @@ class ITK_EXPORT GPUSmoothingRecursiveYvvGaussianImageFilter
   // Override since the filter produces the entire dataset
   void
   EnlargeOutputRequestedRegion(DataObject * output);
+
   void
   AllocateGPUCoefficients();
 
@@ -174,7 +176,6 @@ class ITK_EXPORT GPUSmoothingRecursiveYvvGaussianImageFilter
   ScalarRealType   m_B;
   ScalarRealType * m_Bvalues;
 
-
   // Initialization matrix for anti-causal pass
   ScalarRealType * m_CPUMatrix;
 
@@ -185,9 +186,12 @@ class ITK_EXPORT GPUSmoothingRecursiveYvvGaussianImageFilter
   GPUDataPointer m_GPULocalDataManager;
 
 private:
-  GPUSmoothingRecursiveYvvGaussianImageFilter(const Self &); // purposely not implemented
+  GPUSmoothingRecursiveYvvGaussianImageFilter(const Self &); // purposely
+                                                             //  not
+                                                             //  implemented
   void
   BuildKernel();
+
   void
   operator=(const Self &); // purposely not implemented
 
@@ -202,7 +206,6 @@ class ITK_EXPORT GPUSmoothingRecursiveYvvGaussianImageFilter
   SigmaArrayType m_Sigma;
   int            telltale; // TODO: REMOVE
 };
-
 } // end namespace itk
 
 #    ifndef ITK_MANUAL_INSTANTIATION
diff --git a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkGPUSmoothingRecursiveYvvGaussianImageFilter.hxx b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkGPUSmoothingRecursiveYvvGaussianImageFilter.hxx
index 063310adeb5..e770c4a2ed9 100644
--- a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkGPUSmoothingRecursiveYvvGaussianImageFilter.hxx
+++ b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkGPUSmoothingRecursiveYvvGaussianImageFilter.hxx
@@ -8,7 +8,6 @@
 // #define VERBOSE
 namespace itk
 {
-
 /**
  * Constructor
  */
@@ -22,7 +21,6 @@ GPUSmoothingRecursiveYvvGaussianImageFilter<TInputImage, TOutputImage>::GPUSmoot
   m_NormalizeAcrossScale = false;
   otPtr = dynamic_cast<GPUOutputImage *>(this->ProcessObject::GetOutput(0));
 
-
   // NB: We must call SetSigma in order to initialize the smoothing
   // filters with the default scale.  However, m_Sigma must first be
   // initialized (it is used inside SetSigma) and it must be >= 0.5
@@ -37,7 +35,8 @@ template <typename TInputImage, typename TOutputImage>
 void
 GPUSmoothingRecursiveYvvGaussianImageFilter<TInputImage, TOutputImage>::BuildKernel()
 {
-  const char *                      GPUSource = GPUSmoothingRecursiveYvvGaussianImageFilterKernel::GetOpenCLSource();
+  const char * GPUSource = GPUSmoothingRecursiveYvvGaussianImageFilterKernel::GetOpenCLSource();
+
   typename GPUOutputImage::SizeType lineSizes = inPtr->GetRequestedRegion().GetSize();
   unsigned int                      maxLineSize = lineSizes[0];
   for (unsigned int d = 1; d < ImageDimension; ++d)
@@ -91,11 +90,15 @@ GPUSmoothingRecursiveYvvGaussianImageFilter<TInputImage, TOutputImage>::SetUp(Sc
     // Compute q according to 16 in Young et al on Gabor filering
     ScalarRealType q = 0;
     if (sigmad >= 3.556)
+    {
       q = 0.9804 * (sigmad - 3.556) + 2.5091;
+    }
     else
     {
       if (sigmad < 0.5)
+      {
         std::cerr << "Too low sigma value (< 0.5), computation will not be precise." << std::endl;
+      }
 
       q = 0.0561 * sigmad * sigmad + 0.5784 * sigmad - 0.2568;
     }
@@ -115,7 +118,8 @@ GPUSmoothingRecursiveYvvGaussianImageFilter<TInputImage, TOutputImage>::SetUp(Sc
     ScalarRealType baseB = (m0 * (m1 * m1 + m2 * m2)) / scale;
     m_B = m_Bvalues[0] = baseB * baseB;
 
-    // M Matrix for initialization on backward pass, from Triggs and Sdika, IEEE TSP
+    // M Matrix for initialization on backward pass, from Triggs and Sdika, IEEE
+    // TSP
     m_CPUMatrix = new ScalarRealType[9];
     const ScalarRealType factor =
       (1 + m_B1 - m_B2 + m_B3) * (1 - m_B1 - m_B2 - m_B3) * (1 + m_B2 + (m_B1 - m_B3) * m_B3);
@@ -189,7 +193,6 @@ GPUSmoothingRecursiveYvvGaussianImageFilter<TInputImage, TOutputImage>::SetSigma
   this->SetSigmaArray(sigmas);
 }
 
-
 // Set value of Sigma (an-isotropic)
 
 template <typename TInputImage, typename TOutputImage>
@@ -216,7 +219,6 @@ GPUSmoothingRecursiveYvvGaussianImageFilter<TInputImage, TOutputImage>::SetSigma
   }
 }
 
-
 // Get the sigma array.
 template <typename TInputImage, typename TOutputImage>
 typename GPUSmoothingRecursiveYvvGaussianImageFilter<TInputImage, TOutputImage>::SigmaArrayType
@@ -228,7 +230,6 @@ GPUSmoothingRecursiveYvvGaussianImageFilter<TInputImage, TOutputImage>::GetSigma
   return m_Sigma;
 }
 
-
 // Get the sigma scalar. If the sigma is anisotropic, we will just
 // return the sigma along the first dimension.
 template <typename TInputImage, typename TOutputImage>
@@ -241,7 +242,6 @@ GPUSmoothingRecursiveYvvGaussianImageFilter<TInputImage, TOutputImage>::GetSigma
   return m_Sigma[0];
 }
 
-
 /**
  * Set Normalize Across Scale Space
  */
@@ -277,7 +277,6 @@ GPUSmoothingRecursiveYvvGaussianImageFilter<TInputImage, TOutputImage>::Generate
   }
 }
 
-
 template <typename TInputImage, typename TOutputImage>
 void
 GPUSmoothingRecursiveYvvGaussianImageFilter<TInputImage, TOutputImage>::EnlargeOutputRequestedRegion(
@@ -294,7 +293,6 @@ GPUSmoothingRecursiveYvvGaussianImageFilter<TInputImage, TOutputImage>::EnlargeO
   }
 }
 
-
 template <typename TInputImage, typename TOutputImage>
 void
 GPUSmoothingRecursiveYvvGaussianImageFilter<TInputImage, TOutputImage>::AllocateGPUCoefficients()
@@ -381,7 +379,8 @@ GPUSmoothingRecursiveYvvGaussianImageFilter<TInputImage, TOutputImage>::GPUGener
   }
   else
   {
-    // We must optimize our 2D workgroup sizes to go over our 3D volume in each dimension.
+    // We must optimize our 2D workgroup sizes to go over our 3D volume in each
+    //  dimension.
 
     this->m_GPUKernelManager->SetKernelArg(m_FilterGPUKernelHandle, argidx++, sizeof(unsigned int), &(X));
 #    ifdef VERBOSE
@@ -397,7 +396,8 @@ GPUSmoothingRecursiveYvvGaussianImageFilter<TInputImage, TOutputImage>::GPUGener
 #    endif
     this->m_GPUKernelManager->LaunchKernel2D(m_FilterGPUKernelHandle, m_requestedSize[0], m_requestedSize[2], 16, 16);
 
-    // input is already pointing to previous output; change ONLY direction of filter
+    // input is already pointing to previous output; change ONLY direction of
+    //  filter
     this->m_GPUKernelManager->SetKernelArg(m_FilterGPUKernelHandle, dimArg, sizeof(unsigned int), &(Z));
 #    ifdef VERBOSE
     std::cout << telltale << ". Calling 2D kernel on Z.\n";
@@ -406,7 +406,6 @@ GPUSmoothingRecursiveYvvGaussianImageFilter<TInputImage, TOutputImage>::GPUGener
   }
 }
 
-
 template <typename TInputImage, typename TOutputImage>
 void
 GPUSmoothingRecursiveYvvGaussianImageFilter<TInputImage, TOutputImage>::PrintSelf(std::ostream & os,
@@ -420,7 +419,6 @@ GPUSmoothingRecursiveYvvGaussianImageFilter<TInputImage, TOutputImage>::PrintSel
   os << "NormalizeAcrossScale: " << m_NormalizeAcrossScale << std::endl;
   os << "Sigma: " << m_Sigma << std::endl;
 }
-
 } // end namespace itk
 
 #  endif //_ITK_GPU_SMOOTHING_RECURSIVE_YVV_GAUSSIAN_IMAGE_FILTER_HXX_
diff --git a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkRecursiveLineYvvGaussianImageFilter.h b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkRecursiveLineYvvGaussianImageFilter.h
index 0e4a0cffd18..4058c6d9b56 100644
--- a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkRecursiveLineYvvGaussianImageFilter.h
+++ b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkRecursiveLineYvvGaussianImageFilter.h
@@ -26,7 +26,6 @@
 
 namespace itk
 {
-
 /**
  * \class RecursiveLineYvvGaussianImageFilter
  * \brief 1D recursive Gaussian blur based on Young-Van Vliet's algorithm,
@@ -43,7 +42,6 @@ namespace itk
  * \ingroup SmoothingRecursiveYvvGaussianFilter
  */
 
-
 template <typename TInputImage, typename TOutputImage = TInputImage>
 class ITK_EXPORT RecursiveLineYvvGaussianImageFilter : public InPlaceImageFilter<TInputImage, TOutputImage>
 {
@@ -125,13 +123,14 @@ class ITK_EXPORT RecursiveLineYvvGaussianImageFilter : public InPlaceImageFilter
 
 protected:
   RecursiveLineYvvGaussianImageFilter();
-  virtual ~RecursiveLineYvvGaussianImageFilter() {};
+  virtual ~RecursiveLineYvvGaussianImageFilter() {}
   void
   PrintSelf(std::ostream & os, Indent indent) const;
 
   /** GenerateData (apply) the filter. */
   void
   BeforeThreadedGenerateData();
+
   void
   ThreadedGenerateData(const OutputImageRegionType & outputRegionForThread, ThreadIdType threadId);
 
@@ -166,7 +165,8 @@ class ITK_EXPORT RecursiveLineYvvGaussianImageFilter : public InPlaceImageFilter
   FilterDataArray(RealType * outs, const RealType * data, RealType * scratch, unsigned int ln);
 
 protected:
-  /** Causal and anti-causal coefficients that multiply the input data. These are already divided by B0 */
+  /** Causal and anti-causal coefficients that multiply the input data. These
+    are already divided by B0 */
   ScalarRealType m_B1;
   ScalarRealType m_B2;
   ScalarRealType m_B3;
@@ -191,13 +191,10 @@ class ITK_EXPORT RecursiveLineYvvGaussianImageFilter : public InPlaceImageFilter
   bool                                  m_NormalizeAcrossScale;
   ImageRegionSplitterDirection::Pointer m_ImageRegionSplitter;
 };
-
-
 } // end namespace itk
 
 #  ifndef ITK_MANUAL_INSTANTIATION
 #    include "itkRecursiveLineYvvGaussianImageFilter.hxx"
 #  endif
 
-
 #endif
diff --git a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkRecursiveLineYvvGaussianImageFilter.hxx b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkRecursiveLineYvvGaussianImageFilter.hxx
index 48d4625ef5f..c403226feca 100644
--- a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkRecursiveLineYvvGaussianImageFilter.hxx
+++ b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkRecursiveLineYvvGaussianImageFilter.hxx
@@ -10,10 +10,8 @@
 
 // #define VERBOSE
 
-
 namespace itk
 {
-
 template <typename TInputImage, typename TOutputImage>
 RecursiveLineYvvGaussianImageFilter<TInputImage, TOutputImage>::RecursiveLineYvvGaussianImageFilter()
 {
@@ -28,22 +26,29 @@ RecursiveLineYvvGaussianImageFilter<TInputImage, TOutputImage>::RecursiveLineYvv
   std::cout << "-----------Line filter TYPES\n";
 
   if (typeid(typename TInputImage::PixelType) == typeid(double))
+  {
     std::cout << "InputPixelType double\n";
+  }
   if (typeid(typename TOutputImage::PixelType) == typeid(double))
+  {
     std::cout << "OutputPixelType double\n";
+  }
 
   if (typeid(ScalarRealType) == typeid(double))
+  {
     std::cout << "ScalarRealType double\n";
+  }
 
   if (typeid(RealType) == typeid(double))
+  {
     std::cout << "RealType double\n";
+  }
 
   /*if( typeid ( InternalRealType ) == typeid ( double ))
           std::cout<<"InternalRealType double\n"; */
 #  endif
 }
 
-
 /**
  * Set Input Image
  */
@@ -58,7 +63,6 @@ RecursiveLineYvvGaussianImageFilter<TInputImage, TOutputImage>::SetInputImage(co
   ProcessObject::SetNthInput(0, const_cast<TInputImage *>(input));
 }
 
-
 /**
  * Get Input Image
  */
@@ -86,12 +90,17 @@ RecursiveLineYvvGaussianImageFilter<TInputImage, TOutputImage>::SetUp(ScalarReal
 
   // Compute q according to 16 in Young et al on Gabor filering
   ScalarRealType q = 0;
+
   if (sigmad >= 3.556)
+  {
     q = 0.9804 * (sigmad - 3.556) + 2.5091;
+  }
   else
   {
     if (sigmad < 0.5)
+    {
       std::cerr << "Too low sigma value (< 0.5), computation will not be precise." << std::endl;
+    }
 
     q = 0.0561 * sigmad * sigmad + 0.5784 * sigmad - 0.2568;
   }
@@ -109,7 +118,8 @@ RecursiveLineYvvGaussianImageFilter<TInputImage, TOutputImage>::SetUp(ScalarReal
   ScalarRealType baseB = (m0 * (m1 * m1 + m2 * m2)) / scale;
   m_B = baseB * baseB;
 
-  // M Matrix for initialization on backward pass, from Triggs and Sdika, IEEE TSP
+  // M Matrix for initialization on backward pass, from Triggs and Sdika, IEEE
+  // TSP
   m_MMatrix = vnl_matrix<ScalarRealType>(3, 3);
 
   m_MMatrix(0, 0) = -m_B3 * m_B1 + 1 - m_B3 * m_B3 - m_B2;
@@ -179,8 +189,9 @@ RecursiveLineYvvGaussianImageFilter<TInputImage, TOutputImage>::FilterDataArray(
    */
 
   for (unsigned int i = 0; i < ln; ++i)
+  {
     outs[i] = scratch[i];
-
+  }
 
   // AntiCausal direction pass
 
@@ -198,14 +209,14 @@ RecursiveLineYvvGaussianImageFilter<TInputImage, TOutputImage>::FilterDataArray(
     Vn2 += (outs[ln - 1 - i] - u_p) * m_MMatrix(2, i);
   }
 
-  // This was not in the 2006 Triggs paper but sounds quite logical since m_B is not one
+  // This was not in the 2006 Triggs paper but sounds quite logical since m_B is
+  // not one
   Vn0 *= m_B;
   Vn1 *= m_B;
   Vn2 *= m_B;
 
   scratch[ln - 1] = Vn0;
 
-
   // Recursively filter the rest
 
   for (int i = ln - 2; i >= 0; i--)
@@ -225,7 +236,6 @@ RecursiveLineYvvGaussianImageFilter<TInputImage, TOutputImage>::FilterDataArray(
   }
 }
 
-
 // we need all of the image in just the "Direction" we are separated into
 template <typename TInputImage, typename TOutputImage>
 void
@@ -257,7 +267,6 @@ RecursiveLineYvvGaussianImageFilter<TInputImage, TOutputImage>::EnlargeOutputReq
   }
 }
 
-
 template <typename TInputImage, typename TOutputImage>
 const ImageRegionSplitterBase *
 RecursiveLineYvvGaussianImageFilter<TInputImage, TOutputImage>::GetImageRegionSplitter(void) const
@@ -270,7 +279,6 @@ RecursiveLineYvvGaussianImageFilter<TInputImage, TOutputImage>::GetImageRegionSp
   return this->m_ImageRegionSplitter;
 }
 
-
 template <typename TInputImage, typename TOutputImage>
 void
 RecursiveLineYvvGaussianImageFilter<TInputImage, TOutputImage>::BeforeThreadedGenerateData()
@@ -310,7 +318,6 @@ RecursiveLineYvvGaussianImageFilter<TInputImage, TOutputImage>::BeforeThreadedGe
   }
 }
 
-
 /**
  * Compute Recursive filter
  * line by line in one of the dimensions
@@ -344,7 +351,6 @@ RecursiveLineYvvGaussianImageFilter<TInputImage, TOutputImage>::ThreadedGenerate
   inputIterator.SetDirection(this->m_Direction);
   outputIterator.SetDirection(this->m_Direction);
 
-
   const unsigned int ln = region.GetSize()[this->m_Direction];
 
   RealType * inps = 0;
@@ -388,7 +394,6 @@ RecursiveLineYvvGaussianImageFilter<TInputImage, TOutputImage>::ThreadedGenerate
     outputRegionForThread.GetNumberOfPixels() / outputRegionForThread.GetSize(this->m_Direction);
   ProgressReporter progress(this, threadId, numberOfLinesToProcess, 10);
 
-
   try // this try is intended to catch an eventual AbortException.
   {
     while (!inputIterator.IsAtEnd() && !outputIterator.IsAtEnd())
@@ -439,7 +444,6 @@ RecursiveLineYvvGaussianImageFilter<TInputImage, TOutputImage>::ThreadedGenerate
   delete[] scratch;
 }
 
-
 template <typename TInputImage, typename TOutputImage>
 void
 RecursiveLineYvvGaussianImageFilter<TInputImage, TOutputImage>::PrintSelf(std::ostream & os, Indent indent) const
@@ -451,7 +455,6 @@ RecursiveLineYvvGaussianImageFilter<TInputImage, TOutputImage>::PrintSelf(std::o
 
   os << indent << "Direction: " << m_Direction << std::endl;
 }
-
 } // end namespace itk
 
 #endif
diff --git a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkSmoothingRecursiveYvvGaussianImageFilter.h b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkSmoothingRecursiveYvvGaussianImageFilter.h
index 935e3467580..7217a1b8195 100644
--- a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkSmoothingRecursiveYvvGaussianImageFilter.h
+++ b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkSmoothingRecursiveYvvGaussianImageFilter.h
@@ -27,7 +27,6 @@
 #  include "itkCommand.h"
 #  include "itkFixedArray.h"
 
-
 namespace itk
 {
 /**
@@ -55,7 +54,6 @@ class ITK_EXPORT SmoothingRecursiveYvvGaussianImageFilter : public InPlaceImageF
   typedef SmartPointer<Self>                            Pointer;
   typedef SmartPointer<const Self>                      ConstPointer;
 
-
   /** Pixel Type of the input image */
   typedef TInputImage                     InputImageType;
   typedef TOutputImage                    OutputImageType;
@@ -93,7 +91,6 @@ class ITK_EXPORT SmoothingRecursiveYvvGaussianImageFilter : public InPlaceImageF
   /**  The last in the pipeline  */
   typedef CastImageFilter<RealImageType, OutputImageType> CastingFilterType;
 
-
   /**  Pointer to a gaussian filter.  */
   typedef typename InternalGaussianFilterType::Pointer InternalGaussianFilterPointer;
 
@@ -115,16 +112,20 @@ class ITK_EXPORT SmoothingRecursiveYvvGaussianImageFilter : public InPlaceImageF
    axis. */
   void
   SetSigmaArray(const SigmaArrayType & sigmas);
+
   void
   SetSigma(ScalarRealType sigma);
+
   SigmaArrayType
   GetSigmaArray() const;
+
   ScalarRealType
   GetSigma() const;
 
   /** Define which normalization factor will be used for the Gaussian */
   void
   SetNormalizeAcrossScale(bool normalizeInScaleSpace);
+
   itkGetConstMacro(NormalizeAcrossScale, bool);
 
   void
@@ -140,10 +141,9 @@ class ITK_EXPORT SmoothingRecursiveYvvGaussianImageFilter : public InPlaceImageF
   itkConceptMacro(InputHasNumericTraitsCheck, (Concept::HasNumericTraits<PixelType>));
   /** End concept checking */
 #  endif
-
 protected:
   SmoothingRecursiveYvvGaussianImageFilter();
-  virtual ~SmoothingRecursiveYvvGaussianImageFilter() {};
+  virtual ~SmoothingRecursiveYvvGaussianImageFilter() {}
   void
   PrintSelf(std::ostream & os, Indent indent) const;
 
@@ -164,9 +164,11 @@ class ITK_EXPORT SmoothingRecursiveYvvGaussianImageFilter : public InPlaceImageF
   EnlargeOutputRequestedRegion(DataObject * output);
 
 private:
-  SmoothingRecursiveYvvGaussianImageFilter(const Self &); // purposely not implemented
+  SmoothingRecursiveYvvGaussianImageFilter(const Self &); // purposely not
+                                                          //  implemented
   void
-  operator=(const Self &); // purposely not implemented
+  operator=(const Self &); // purposely not
+                           //  implemented
 
   InternalGaussianFilterPointer m_SmoothingFilters[ImageDimension - 1];
   FirstGaussianFilterPointer    m_FirstSmoothingFilter;
@@ -179,7 +181,6 @@ class ITK_EXPORT SmoothingRecursiveYvvGaussianImageFilter : public InPlaceImageF
   SigmaArrayType m_Sigma;
   int            telltale; // TODO: REMOVE
 };
-
 } // end namespace itk
 
 #  ifndef ITK_MANUAL_INSTANTIATION
diff --git a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkSmoothingRecursiveYvvGaussianImageFilter.hxx b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkSmoothingRecursiveYvvGaussianImageFilter.hxx
index 2fe2b17700f..4660dbac437 100644
--- a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkSmoothingRecursiveYvvGaussianImageFilter.hxx
+++ b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkSmoothingRecursiveYvvGaussianImageFilter.hxx
@@ -10,7 +10,6 @@
 
 namespace itk
 {
-
 /**
  * Constructor
  */
@@ -61,23 +60,32 @@ SmoothingRecursiveYvvGaussianImageFilter<TInputImage, TOutputImage>::SmoothingRe
   std::cout << "-----------Smoothing filter TYPES\n";
 
   if (typeid(typename TInputImage::PixelType) == typeid(double))
+  {
     std::cout << "PixelType double\n";
+  }
   if (typeid(typename TOutputImage::PixelType) == typeid(double))
+  {
     std::cout << "Output PixelType double\n";
+  }
 
   if (typeid(ScalarRealType) == typeid(double))
+  {
     std::cout << "ScalarRealType double\n";
+  }
 
   if (typeid(RealType) == typeid(double))
+  {
     std::cout << "RealType double\n";
+  }
 
   if (typeid(InternalRealType) == typeid(double))
+  {
     std::cout << "InternalRealType double\n";
+  }
 
 #  endif
 }
 
-
 template <typename TInputImage, typename TOutputImage>
 void
 SmoothingRecursiveYvvGaussianImageFilter<TInputImage, TOutputImage>::SetNumberOfThreads(ThreadIdType nb)
@@ -86,6 +94,7 @@ SmoothingRecursiveYvvGaussianImageFilter<TInputImage, TOutputImage>::SetNumberOf
           std::cout<<telltale  << ". itkSmoothingYvv::SetNumberOfThreads \n";
   #endif*/
   Superclass::SetNumberOfThreads(nb);
+
   for (unsigned int i = 0; i < ImageDimension - 1; i++)
   {
     m_SmoothingFilters[i]->SetNumberOfThreads(nb);
@@ -124,10 +133,10 @@ SmoothingRecursiveYvvGaussianImageFilter<TInputImage, TOutputImage>::SetSigma(Sc
           std::cout<<telltale  << ". itkSmoothingYvv::SetSigma \n";
   #endif*/
   SigmaArrayType sigmas(sigma);
+
   this->SetSigmaArray(sigmas);
 }
 
-
 // Set value of Sigma (an-isotropic)
 
 template <typename TInputImage, typename TOutputImage>
@@ -152,7 +161,6 @@ SmoothingRecursiveYvvGaussianImageFilter<TInputImage, TOutputImage>::SetSigmaArr
   }
 }
 
-
 // Get the sigma array.
 template <typename TInputImage, typename TOutputImage>
 typename SmoothingRecursiveYvvGaussianImageFilter<TInputImage, TOutputImage>::SigmaArrayType
@@ -164,7 +172,6 @@ SmoothingRecursiveYvvGaussianImageFilter<TInputImage, TOutputImage>::GetSigmaArr
   return m_Sigma;
 }
 
-
 // Get the sigma scalar. If the sigma is anisotropic, we will just
 // return the sigma along the first dimension.
 template <typename TInputImage, typename TOutputImage>
@@ -177,7 +184,6 @@ SmoothingRecursiveYvvGaussianImageFilter<TInputImage, TOutputImage>::GetSigma()
   return m_Sigma[0];
 }
 
-
 /**
  * Set Normalize Across Scale Space
  */
@@ -199,7 +205,6 @@ SmoothingRecursiveYvvGaussianImageFilter<TInputImage, TOutputImage>::SetNormaliz
   this->Modified();
 }
 
-
 template <typename TInputImage, typename TOutputImage>
 void
 SmoothingRecursiveYvvGaussianImageFilter<TInputImage, TOutputImage>::GenerateInputRequestedRegion() throw(
@@ -306,7 +311,6 @@ SmoothingRecursiveYvvGaussianImageFilter<TInputImage, TOutputImage>::GenerateDat
   this->GraftOutput(m_CastingFilter->GetOutput());
 }
 
-
 template <typename TInputImage, typename TOutputImage>
 void
 SmoothingRecursiveYvvGaussianImageFilter<TInputImage, TOutputImage>::PrintSelf(std::ostream & os, Indent indent) const
@@ -319,8 +323,6 @@ SmoothingRecursiveYvvGaussianImageFilter<TInputImage, TOutputImage>::PrintSelf(s
   os << "NormalizeAcrossScale: " << m_NormalizeAcrossScale << std::endl;
   os << "Sigma: " << m_Sigma << std::endl;
 }
-
-
 } // end namespace itk
 
 #endif

From 6df664b77b1ea8f15b5ae59a073d6b6b8d11a473 Mon Sep 17 00:00:00 2001
From: Matt McCormick <matt.mccormick@kitware.com>
Date: Fri, 20 Feb 2015 00:42:18 -0500
Subject: [PATCH 20/65] BUG: Add itk_module_target call for library.

This is required when building against an install tree with GPU support to
avoid linking errors.
---
 .../SmoothingRecursiveYvvGaussianFilter/src/CMakeLists.txt      | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/src/CMakeLists.txt b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/src/CMakeLists.txt
index f1860f06c5a..4a4915088d1 100644
--- a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/src/CMakeLists.txt
+++ b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/src/CMakeLists.txt
@@ -23,6 +23,6 @@ if (ITK_USE_GPU)
     add_library(${itk-module} ${GPU_SRC})
     target_link_libraries(${itk-module} ${INRIA_ITK_LIBRARIES} ${OPENCL_LIBRARIES} )
 
-    #itk_module_target(${itk-module})
+    itk_module_target(${itk-module})
 
 endif()

From db4f344f9b3303d6e40f521eccdfe57bfccd4fdf Mon Sep 17 00:00:00 2001
From: Michael Ebner <michael.ebner.14@ucl.ac.uk>
Date: Fri, 8 Jan 2016 12:42:47 +0000
Subject: [PATCH 21/65] ENH: added files for python wrapping of remote module
 YVV Recursive Gaussian

Filter
---
 .../wrapping/CMakeLists.txt                                    | 3 +++
 .../wrapping/itkSmoothingRecursiveYvvGaussianImageFilter.wrap  | 3 +++
 2 files changed, 6 insertions(+)
 create mode 100644 Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/wrapping/CMakeLists.txt
 create mode 100644 Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/wrapping/itkSmoothingRecursiveYvvGaussianImageFilter.wrap

diff --git a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/wrapping/CMakeLists.txt b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/wrapping/CMakeLists.txt
new file mode 100644
index 00000000000..cd6f4293c3e
--- /dev/null
+++ b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/wrapping/CMakeLists.txt
@@ -0,0 +1,3 @@
+itk_wrap_module(SmoothingRecursiveYvvGaussianFilter)
+itk_auto_load_submodules()
+itk_end_wrap_module()
diff --git a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/wrapping/itkSmoothingRecursiveYvvGaussianImageFilter.wrap b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/wrapping/itkSmoothingRecursiveYvvGaussianImageFilter.wrap
new file mode 100644
index 00000000000..a6f80d241a6
--- /dev/null
+++ b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/wrapping/itkSmoothingRecursiveYvvGaussianImageFilter.wrap
@@ -0,0 +1,3 @@
+itk_wrap_class("itk::SmoothingRecursiveYvvGaussianImageFilter" POINTER)
+itk_wrap_image_filter("${WRAP_ITK_SCALAR}" 2 2+)
+itk_end_wrap_class()

From c6d849821b61988fa2dc9a3287129327f0d65e26 Mon Sep 17 00:00:00 2001
From: Zach Williamson <zachary-williamson@uiowa.edu>
Date: Thu, 30 Jun 2016 13:19:26 -0500
Subject: [PATCH 22/65] STYLE: Use Macro for Function Deletion

---
 .../itkGPUSmoothingRecursiveYvvGaussianImageFilter.h      | 8 ++------
 .../include/itkRecursiveLineYvvGaussianImageFilter.h      | 4 +---
 .../include/itkSmoothingRecursiveYvvGaussianImageFilter.h | 6 +-----
 3 files changed, 4 insertions(+), 14 deletions(-)

diff --git a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkGPUSmoothingRecursiveYvvGaussianImageFilter.h b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkGPUSmoothingRecursiveYvvGaussianImageFilter.h
index 99eed2118f2..8966fb5d367 100644
--- a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkGPUSmoothingRecursiveYvvGaussianImageFilter.h
+++ b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkGPUSmoothingRecursiveYvvGaussianImageFilter.h
@@ -186,14 +186,10 @@ class ITK_EXPORT GPUSmoothingRecursiveYvvGaussianImageFilter
   GPUDataPointer m_GPULocalDataManager;
 
 private:
-  GPUSmoothingRecursiveYvvGaussianImageFilter(const Self &); // purposely
-                                                             //  not
-                                                             //  implemented
-  void
-  BuildKernel();
+  ITK_DISALLOW_COPY_AND_ASSIGN(GPUSmoothingecursiveYvvGaussianImageFilter);
 
   void
-  operator=(const Self &); // purposely not implemented
+  BuildKernel();
 
   /** Normalize the image across scale space */
   bool m_NormalizeAcrossScale;
diff --git a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkRecursiveLineYvvGaussianImageFilter.h b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkRecursiveLineYvvGaussianImageFilter.h
index 4058c6d9b56..1861219437c 100644
--- a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkRecursiveLineYvvGaussianImageFilter.h
+++ b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkRecursiveLineYvvGaussianImageFilter.h
@@ -176,9 +176,7 @@ class ITK_EXPORT RecursiveLineYvvGaussianImageFilter : public InPlaceImageFilter
   vnl_matrix<ScalarRealType> m_MMatrix;
 
 private:
-  RecursiveLineYvvGaussianImageFilter(const Self &); // purposely not implemented
-  void
-  operator=(const Self &); // purposely not implemented
+  ITK_DISALLOW_COPY_AND_ASSIGN(RecursiveLineYvvGaussianImageFilter);
 
   /** Direction in which the filter is to be applied
    * this should be in the range [0,ImageDimension-1]. */
diff --git a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkSmoothingRecursiveYvvGaussianImageFilter.h b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkSmoothingRecursiveYvvGaussianImageFilter.h
index 7217a1b8195..6f9e47768f0 100644
--- a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkSmoothingRecursiveYvvGaussianImageFilter.h
+++ b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkSmoothingRecursiveYvvGaussianImageFilter.h
@@ -164,11 +164,7 @@ class ITK_EXPORT SmoothingRecursiveYvvGaussianImageFilter : public InPlaceImageF
   EnlargeOutputRequestedRegion(DataObject * output);
 
 private:
-  SmoothingRecursiveYvvGaussianImageFilter(const Self &); // purposely not
-                                                          //  implemented
-  void
-  operator=(const Self &); // purposely not
-                           //  implemented
+  ITK_DISALLOW_COPY_AND_ASSIGN(SmoothingRecursiveYvvGaussianImageFilter);
 
   InternalGaussianFilterPointer m_SmoothingFilters[ImageDimension - 1];
   FirstGaussianFilterPointer    m_FirstSmoothingFilter;

From 187afde8b1367bf91487088fc7535982c1d1312e Mon Sep 17 00:00:00 2001
From: Hans Johnson <hans-johnson@uiowa.edu>
Date: Sat, 16 Dec 2017 19:17:15 -0600
Subject: [PATCH 23/65] ENH: ITKv5 override consistency
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Provide remove virtual and override

Use clang-tidy to add ITK_OVERRIDE, and to remove
redundant virtual on functions.

cd ../ITK;
clang-tidy -p ITK-clangtidy $find Modules/[A-J]*  -name *.cxx |fgrep -v ThirdParty) -checks=-*,modernize-use-override  -header-filter=.* -fix
clang-tidy -p ITK-clangtidy $(find Modules/[K-Z]*  -name *.cxx |fgrep -v ThirdParty) -checks=-*,modernize-use-override  -header-filter=.* -fix

https://stackoverflow.com/questions/39932391/virtual-override-or-both-c

When you override a function you don't technically need to write either virtual
or override.

The original base class declaration needs the keyword virtual to mark it as virtual.

In the derived class the function is virtual by way of having the ¹same type as
the base class function.

However, an override can help avoid bugs by producing a compilation error when
the intended override isn't technically an override. E.g. that the function
type isn't exactly like the base class function. Or that a maintenance of the
base class changes that function's type, e.g. adding a defaulted argument.

In the same way, a virtual keyword in the derived class can make such a bug
more subtle, by ensuring that the function is still is virtual in further
derived classes.

So the general advice is,

virtual for the base class function declaration.
This is technically necessary.

Use override (only) for a derived class' override.
This helps with maintenance.
---
 .../itkRecursiveLineYvvGaussianImageFilter.h   | 14 +++++++-------
 ...kSmoothingRecursiveYvvGaussianImageFilter.h | 18 +++++++++---------
 2 files changed, 16 insertions(+), 16 deletions(-)

diff --git a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkRecursiveLineYvvGaussianImageFilter.h b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkRecursiveLineYvvGaussianImageFilter.h
index 1861219437c..6dfa5f97125 100644
--- a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkRecursiveLineYvvGaussianImageFilter.h
+++ b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkRecursiveLineYvvGaussianImageFilter.h
@@ -123,19 +123,19 @@ class ITK_EXPORT RecursiveLineYvvGaussianImageFilter : public InPlaceImageFilter
 
 protected:
   RecursiveLineYvvGaussianImageFilter();
-  virtual ~RecursiveLineYvvGaussianImageFilter() {}
+  ~RecursiveLineYvvGaussianImageFilter() ITK_OVERRIDE {}
   void
-  PrintSelf(std::ostream & os, Indent indent) const;
+  PrintSelf(std::ostream & os, Indent indent) const ITK_OVERRIDE;
 
   /** GenerateData (apply) the filter. */
   void
-  BeforeThreadedGenerateData();
+  BeforeThreadedGenerateData() ITK_OVERRIDE;
 
   void
-  ThreadedGenerateData(const OutputImageRegionType & outputRegionForThread, ThreadIdType threadId);
+  ThreadedGenerateData(const OutputImageRegionType & outputRegionForThread, ThreadIdType threadId) ITK_OVERRIDE;
 
-  virtual const ImageRegionSplitterBase *
-  GetImageRegionSplitter(void) const;
+  const ImageRegionSplitterBase *
+  GetImageRegionSplitter(void) const ITK_OVERRIDE;
 
   /** RecursiveLineYvvGaussianImageFilter needs all of the input only in the
    *  "Direction" dimension. Therefore we enlarge the output's
@@ -146,7 +146,7 @@ class ITK_EXPORT RecursiveLineYvvGaussianImageFilter : public InPlaceImageFilter
    * \sa ImageToImageFilter::GenerateInputRequestedRegion()
    */
   void
-  EnlargeOutputRequestedRegion(DataObject * output);
+  EnlargeOutputRequestedRegion(DataObject * output) ITK_OVERRIDE;
 
   /** Set up the coefficients of the filter to approximate a specific kernel.
    * Typically it can be used to approximate a Gaussian or one of its
diff --git a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkSmoothingRecursiveYvvGaussianImageFilter.h b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkSmoothingRecursiveYvvGaussianImageFilter.h
index 6f9e47768f0..56725354f57 100644
--- a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkSmoothingRecursiveYvvGaussianImageFilter.h
+++ b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkSmoothingRecursiveYvvGaussianImageFilter.h
@@ -129,12 +129,12 @@ class ITK_EXPORT SmoothingRecursiveYvvGaussianImageFilter : public InPlaceImageF
   itkGetConstMacro(NormalizeAcrossScale, bool);
 
   void
-  SetNumberOfThreads(ThreadIdType nb);
+  SetNumberOfThreads(ThreadIdType nb) ITK_OVERRIDE;
 
   // See super class for doxygen documentation
   //
-  virtual bool
-  CanRunInPlace(void) const;
+  bool
+  CanRunInPlace(void) const ITK_OVERRIDE;
 
 #  ifdef ITK_USE_CONCEPT_CHECKING
   /** Begin concept checking */
@@ -143,25 +143,25 @@ class ITK_EXPORT SmoothingRecursiveYvvGaussianImageFilter : public InPlaceImageF
 #  endif
 protected:
   SmoothingRecursiveYvvGaussianImageFilter();
-  virtual ~SmoothingRecursiveYvvGaussianImageFilter() {}
+  ~SmoothingRecursiveYvvGaussianImageFilter() ITK_OVERRIDE {}
   void
-  PrintSelf(std::ostream & os, Indent indent) const;
+  PrintSelf(std::ostream & os, Indent indent) const ITK_OVERRIDE;
 
   /** Generate Data */
   void
-  GenerateData(void);
+  GenerateData(void) ITK_OVERRIDE;
 
   /** SmoothingRecursiveYvvGaussianImageFilter needs all of the input to produce an
    * output. Therefore, SmoothingRecursiveYvvGaussianImageFilter needs to provide
    * an implementation for GenerateInputRequestedRegion in order to inform
    * the pipeline execution model.
    * \sa ImageToImageFilter::GenerateInputRequestedRegion() */
-  virtual void
-  GenerateInputRequestedRegion() throw(InvalidRequestedRegionError);
+  void
+  GenerateInputRequestedRegion() throw (InvalidRequestedRegionError)ITK_OVERRIDE;
 
   // Override since the filter produces the entire dataset
   void
-  EnlargeOutputRequestedRegion(DataObject * output);
+  EnlargeOutputRequestedRegion(DataObject * output) ITK_OVERRIDE;
 
 private:
   ITK_DISALLOW_COPY_AND_ASSIGN(SmoothingRecursiveYvvGaussianImageFilter);

From f4c1831aee187609c2f51224aae0070635efbbb7 Mon Sep 17 00:00:00 2001
From: Hans Johnson <hans-johnson@uiowa.edu>
Date: Sat, 16 Dec 2017 19:36:26 -0600
Subject: [PATCH 24/65] COMP:  Use C++11 override directly

git grep -l "ITK_OVERRIDE" |   fgrep -v itk_compiler_detection.h | fgrep -v CMakeLists.txt |fgrep -v .cmake |   xargs sed -i '' -e "s/ITK_OVERRIDE/override/g"
---
 .../itkRecursiveLineYvvGaussianImageFilter.h       | 12 ++++++------
 .../itkSmoothingRecursiveYvvGaussianImageFilter.h  | 14 +++++++-------
 2 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkRecursiveLineYvvGaussianImageFilter.h b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkRecursiveLineYvvGaussianImageFilter.h
index 6dfa5f97125..0323f596ca7 100644
--- a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkRecursiveLineYvvGaussianImageFilter.h
+++ b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkRecursiveLineYvvGaussianImageFilter.h
@@ -123,19 +123,19 @@ class ITK_EXPORT RecursiveLineYvvGaussianImageFilter : public InPlaceImageFilter
 
 protected:
   RecursiveLineYvvGaussianImageFilter();
-  ~RecursiveLineYvvGaussianImageFilter() ITK_OVERRIDE {}
+  ~RecursiveLineYvvGaussianImageFilter() override {}
   void
-  PrintSelf(std::ostream & os, Indent indent) const ITK_OVERRIDE;
+  PrintSelf(std::ostream & os, Indent indent) const override;
 
   /** GenerateData (apply) the filter. */
   void
-  BeforeThreadedGenerateData() ITK_OVERRIDE;
+  BeforeThreadedGenerateData() override;
 
   void
-  ThreadedGenerateData(const OutputImageRegionType & outputRegionForThread, ThreadIdType threadId) ITK_OVERRIDE;
+  ThreadedGenerateData(const OutputImageRegionType & outputRegionForThread, ThreadIdType threadId) override;
 
   const ImageRegionSplitterBase *
-  GetImageRegionSplitter(void) const ITK_OVERRIDE;
+  GetImageRegionSplitter(void) const override;
 
   /** RecursiveLineYvvGaussianImageFilter needs all of the input only in the
    *  "Direction" dimension. Therefore we enlarge the output's
@@ -146,7 +146,7 @@ class ITK_EXPORT RecursiveLineYvvGaussianImageFilter : public InPlaceImageFilter
    * \sa ImageToImageFilter::GenerateInputRequestedRegion()
    */
   void
-  EnlargeOutputRequestedRegion(DataObject * output) ITK_OVERRIDE;
+  EnlargeOutputRequestedRegion(DataObject * output) override;
 
   /** Set up the coefficients of the filter to approximate a specific kernel.
    * Typically it can be used to approximate a Gaussian or one of its
diff --git a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkSmoothingRecursiveYvvGaussianImageFilter.h b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkSmoothingRecursiveYvvGaussianImageFilter.h
index 56725354f57..68e2c749953 100644
--- a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkSmoothingRecursiveYvvGaussianImageFilter.h
+++ b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkSmoothingRecursiveYvvGaussianImageFilter.h
@@ -129,12 +129,12 @@ class ITK_EXPORT SmoothingRecursiveYvvGaussianImageFilter : public InPlaceImageF
   itkGetConstMacro(NormalizeAcrossScale, bool);
 
   void
-  SetNumberOfThreads(ThreadIdType nb) ITK_OVERRIDE;
+  SetNumberOfThreads(ThreadIdType nb) override;
 
   // See super class for doxygen documentation
   //
   bool
-  CanRunInPlace(void) const ITK_OVERRIDE;
+  CanRunInPlace(void) const override;
 
 #  ifdef ITK_USE_CONCEPT_CHECKING
   /** Begin concept checking */
@@ -143,13 +143,13 @@ class ITK_EXPORT SmoothingRecursiveYvvGaussianImageFilter : public InPlaceImageF
 #  endif
 protected:
   SmoothingRecursiveYvvGaussianImageFilter();
-  ~SmoothingRecursiveYvvGaussianImageFilter() ITK_OVERRIDE {}
+  ~SmoothingRecursiveYvvGaussianImageFilter() override {}
   void
-  PrintSelf(std::ostream & os, Indent indent) const ITK_OVERRIDE;
+  PrintSelf(std::ostream & os, Indent indent) const override;
 
   /** Generate Data */
   void
-  GenerateData(void) ITK_OVERRIDE;
+  GenerateData(void) override;
 
   /** SmoothingRecursiveYvvGaussianImageFilter needs all of the input to produce an
    * output. Therefore, SmoothingRecursiveYvvGaussianImageFilter needs to provide
@@ -157,11 +157,11 @@ class ITK_EXPORT SmoothingRecursiveYvvGaussianImageFilter : public InPlaceImageF
    * the pipeline execution model.
    * \sa ImageToImageFilter::GenerateInputRequestedRegion() */
   void
-  GenerateInputRequestedRegion() throw (InvalidRequestedRegionError)ITK_OVERRIDE;
+  GenerateInputRequestedRegion() throw(InvalidRequestedRegionError) override;
 
   // Override since the filter produces the entire dataset
   void
-  EnlargeOutputRequestedRegion(DataObject * output) ITK_OVERRIDE;
+  EnlargeOutputRequestedRegion(DataObject * output) override;
 
 private:
   ITK_DISALLOW_COPY_AND_ASSIGN(SmoothingRecursiveYvvGaussianImageFilter);

From d4da61e6e329462d3a623f23a95ee71a48f76a64 Mon Sep 17 00:00:00 2001
From: Hans Johnson <hans-johnson@uiowa.edu>
Date: Sun, 17 Dec 2017 08:22:48 -0600
Subject: [PATCH 25/65] COMP: Use nullptr instead of 0 or NULL

The check converts the usage of null pointer constants (eg. NULL, 0) to
use the new C++11 nullptr keyword.

SRCDIR= #My local SRC
BLDDIR= #My local BLD

clang-tidy -p ${BLD}  $(find Modules/[A-J]*  -name "*.cxx" \|fgrep -v ThirdParty) -checks=-*,modernize-use-nullptr  -header-filter=.* -fix
clang-tidy -p ${BLD}  $(find Modules/[K-Z]*  -name "*.cxx" \|fgrep -v ThirdParty) -checks=-*,modernize-use-nullptr  -header-filter=.* -fix
---
 .../include/itkRecursiveLineYvvGaussianImageFilter.hxx      | 6 +++---
 .../SmoothingRecursiveYvvGaussianFilter/test/yvvFilter.hxx  | 6 +++---
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkRecursiveLineYvvGaussianImageFilter.hxx b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkRecursiveLineYvvGaussianImageFilter.hxx
index c403226feca..3181a247cd0 100644
--- a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkRecursiveLineYvvGaussianImageFilter.hxx
+++ b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkRecursiveLineYvvGaussianImageFilter.hxx
@@ -353,9 +353,9 @@ RecursiveLineYvvGaussianImageFilter<TInputImage, TOutputImage>::ThreadedGenerate
 
   const unsigned int ln = region.GetSize()[this->m_Direction];
 
-  RealType * inps = 0;
-  RealType * outs = 0;
-  RealType * scratch = 0;
+  RealType * inps = nullptr;
+  RealType * outs = nullptr;
+  RealType * scratch = nullptr;
 
   try
   {
diff --git a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/yvvFilter.hxx b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/yvvFilter.hxx
index 03ee7adcf0f..c582f823b16 100644
--- a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/yvvFilter.hxx
+++ b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/yvvFilter.hxx
@@ -159,9 +159,9 @@ testCpuFilter(std::string &                                 filterLabel,
   }
 
   src->DisconnectPipeline();
-  src = 0;
-  filter = 0;
-  imgPtr = 0;
+  src = nullptr;
+  filter = nullptr;
+  imgPtr = nullptr;
   return EXIT_SUCCESS;
 }
 

From 935d03ad604652fee16636ebd0ffc4e9bef9070d Mon Sep 17 00:00:00 2001
From: Hans Johnson <hans-johnson@uiowa.edu>
Date: Fri, 22 Dec 2017 08:09:56 -0600
Subject: [PATCH 26/65] COMP: Fix unsigned/signed loop index mismatch.

---
 .../SmoothingRecursiveYvvGaussianFilter/test/yvvFilter.hxx      | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/yvvFilter.hxx b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/yvvFilter.hxx
index c582f823b16..68b6b9d5ceb 100644
--- a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/yvvFilter.hxx
+++ b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/yvvFilter.hxx
@@ -123,7 +123,7 @@ testCpuFilter(std::string &                                 filterLabel,
     std::ostringstream sizeStream;
 
     sizeStream << size[0];
-    for (int i = 1; i < InputImage::ImageDimension; ++i)
+    for (unsigned int i = 1; i < InputImage::ImageDimension; ++i)
     {
       sizeStream << "x" << size[i];
     }

From 8ab913bd05f15636b36bbf1d3132e3b67f71a03a Mon Sep 17 00:00:00 2001
From: Hans Johnson <hans-johnson@uiowa.edu>
Date: Mon, 12 Feb 2018 15:24:53 -0600
Subject: [PATCH 27/65] STYLE: Modernize to C++11 conventions

STYLE: Use auto for variable creation

This check is responsible for using the auto type specifier for variable
declarations to improve code readability and maintainability.

The auto type specifier will only be introduced in situations where the
variable type matches the type of the initializer expression. In other words
auto should deduce the same type that was originally spelled in the source

cd /Users/johnsonhj/Dashboard/src/ITK-clangtidy/
run-clang-tidy.py -checks=-*,modernize-use-auto  -header-filter=.* -fix

use auto when declaring iterators
use auto when initializing with a cast to avoid duplicating the type name
use auto when initializing with a template cast to avoid duplicating the type name
use auto when initializing with new to avoid duplicating the type name

SRCDIR=/Users/johnsonhj/Dashboard/src/ITK #My local SRC
BLDDIR=/Users/johnsonhj/Dashboard/src/ITK-clangtidy/ #My local BLD

PERF: Replace explicit return calls of constructor

Replaces explicit calls to the constructor in a return with a braced
initializer list. This way the return type is not needlessly duplicated in the
function definition and the return statement.

SRCDIR=/Users/johnsonhj/Dashboard/src/ITK #My local SRC
BLDDIR=/Users/johnsonhj/Dashboard/src/ITK-clangtidy/ #My local BLD

cd /Users/johnsonhj/Dashboard/src/ITK-clangtidy/
run-clang-tidy.py -checks=-*,modernize-return-braced-init-list  -header-filter=.* -fix

PERF: Allow compiler to choose best way to construct a copy

With move semantics added to the language and the standard library updated with
move constructors added for many types it is now interesting to take an
argument directly by value, instead of by const-reference, and then copy. This
check allows the compiler to take care of choosing the best way to construct
the copy.

The transformation is usually beneficial when the calling code passes an rvalue
and assumes the move construction is a cheap operation. This short example
illustrates how the construction of the value happens:

class Foo {
 public:
-  Foo(const std::string &Copied, const std::string &ReadOnly)
-    : Copied(Copied), ReadOnly(ReadOnly) {}
+  Foo(std::string Moved, const std::string &ReadOnly)
+    : Copied(std::move(Moved)), ReadOnly(ReadOnly) {}
 private:
   private:
   std::string Copied;
   const std::string &ReadOnly;
};

SRCDIR=/Users/johnsonhj/Dashboard/src/ITK #My local SRC
BLDDIR=/Users/johnsonhj/Dashboard/src/ITK-clangtidy/ #My local BLD

cd /Users/johnsonhj/Dashboard/src/ITK-clangtidy/
run-clang-tidy.py -checks=-*,modernize-pass-by-value  -header-filter=.* -fix

STYLE: Use range-based loops from C++11

Used as a more readable equivalent to the traditional for loop operating
over a range of values, such as all elements in a container, in the
forward direction.

====
Range based loopes are more explicit for only computing the
end location once for containers.

for ( ImageIORegion::IndexType::const_iterator i = this->GetIndex().begin();
  i != this->GetIndex().end(); //<- NOTE: Compute end every loop iteration
  ++i )

for (long i : this->GetIndex()) //<- NOTE: Implicitly only compute end once

====
Explicitly reduce the amount of index computations: (The compiler
probably does this too)

for(int i = 0; i < 11; i++)
  {
  pos[0] = testPoints[i][0];
  pos[1] = testPoints[i][1];
                    ^^^^

for(auto & testPoint : testPoints)
  {
  pos[0] = testPoint[0];
  pos[1] = testPoint[1];

====

SRCDIR=/Users/johnsonhj/Dashboard/src/ITK #My local SRC
BLDDIR=/Users/johnsonhj/Dashboard/src/ITK-clangtidy/ #My local BLD

cd /Users/johnsonhj/Dashboard/src/ITK-clangtidy/
run-clang-tidy.py -checks=-*,modernize-loop-convert  -header-filter=.* -fix
---
 .../include/itkRecursiveLineYvvGaussianImageFilter.hxx      | 2 +-
 .../include/itkSmoothingRecursiveYvvGaussianImageFilter.hxx | 2 +-
 .../test/itkYvvWhiteImageTest.cxx                           | 6 +++---
 .../SmoothingRecursiveYvvGaussianFilter/test/yvvFilter.hxx  | 4 ++--
 4 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkRecursiveLineYvvGaussianImageFilter.hxx b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkRecursiveLineYvvGaussianImageFilter.hxx
index 3181a247cd0..ba11daa1f01 100644
--- a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkRecursiveLineYvvGaussianImageFilter.hxx
+++ b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkRecursiveLineYvvGaussianImageFilter.hxx
@@ -246,7 +246,7 @@ RecursiveLineYvvGaussianImageFilter<TInputImage, TOutputImage>::EnlargeOutputReq
           std::cout<<telltale  << ". itkRecursiveLineYvv::EnlargeOutputRequestedRegion \n";
   #endif
   */
-  TOutputImage * out = dynamic_cast<TOutputImage *>(output);
+  auto * out = dynamic_cast<TOutputImage *>(output);
 
   if (out)
   {
diff --git a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkSmoothingRecursiveYvvGaussianImageFilter.hxx b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkSmoothingRecursiveYvvGaussianImageFilter.hxx
index 4660dbac437..b312d84d2e1 100644
--- a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkSmoothingRecursiveYvvGaussianImageFilter.hxx
+++ b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkSmoothingRecursiveYvvGaussianImageFilter.hxx
@@ -233,7 +233,7 @@ SmoothingRecursiveYvvGaussianImageFilter<TInputImage, TOutputImage>::EnlargeOutp
   /*#ifdef VERBOSE
           std::cout<<telltale  << ". itkSmoothingYvv::EnlargeOutputRequestedRegion \n";
   #endif*/
-  TOutputImage * out = dynamic_cast<TOutputImage *>(output);
+  auto * out = dynamic_cast<TOutputImage *>(output);
 
   if (out)
   {
diff --git a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/itkYvvWhiteImageTest.cxx b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/itkYvvWhiteImageTest.cxx
index 1817947c7b4..6efa0fde850 100644
--- a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/itkYvvWhiteImageTest.cxx
+++ b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/itkYvvWhiteImageTest.cxx
@@ -43,9 +43,9 @@ itkYvvWhiteImageTest(int argc, char * argv[])
     die("missing arguments for a 3D image.");
   }
 
-  unsigned int   ntests;
-  unsigned int * size = new unsigned int[dim];
-  float          sigma;
+  unsigned int ntests;
+  auto *       size = new unsigned int[dim];
+  float        sigma;
   try
   {
     sigma = atof(argv[2]);
diff --git a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/yvvFilter.hxx b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/yvvFilter.hxx
index 68b6b9d5ceb..aa79269264c 100644
--- a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/yvvFilter.hxx
+++ b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/yvvFilter.hxx
@@ -72,7 +72,7 @@ getSourceImage(void * sourceImagePtr, std::string inputFilename)
     return -1;
   }
 
-  typename ImageType::Pointer * kimg = (typename ImageType::Pointer *)sourceImagePtr;
+  auto * kimg = (typename ImageType::Pointer *)sourceImagePtr;
   *kimg = readerGPU->GetOutput();
 
   (*kimg)->DisconnectPipeline();
@@ -84,7 +84,7 @@ template <typename ImageType>
 int
 createWhiteImage(void * sourceImagePtr, typename ImageType::SizeType size)
 {
-  typename ImageType::Pointer *  kimg = (typename ImageType::Pointer *)sourceImagePtr;
+  auto *                         kimg = (typename ImageType::Pointer *)sourceImagePtr;
   typename ImageType::RegionType region;
   region.SetSize(size);
 

From 97d7317bce54f0891b0984bd32d55b13bf9ca9c6 Mon Sep 17 00:00:00 2001
From: Hans Johnson <hans-johnson@uiowa.edu>
Date: Mon, 12 Feb 2018 21:05:18 -0600
Subject: [PATCH 28/65] STYLE: Replace itkStaticConstMacro with static
 constexpr

Use static constexpr directly now that C++11 conformance
is required by all compilers.

:%s/itkStaticConstMacro *( *\([^,]*\),[ \_s]*\([^,]*\),\_s*\([^)]*\)) */static constexpr \2 \1 = \3/ge
---
 .../include/itkGPUSmoothingRecursiveYvvGaussianImageFilter.h    | 2 +-
 .../include/itkSmoothingRecursiveYvvGaussianImageFilter.h       | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkGPUSmoothingRecursiveYvvGaussianImageFilter.h b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkGPUSmoothingRecursiveYvvGaussianImageFilter.h
index 8966fb5d367..425702e8c3b 100644
--- a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkGPUSmoothingRecursiveYvvGaussianImageFilter.h
+++ b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkGPUSmoothingRecursiveYvvGaussianImageFilter.h
@@ -89,7 +89,7 @@ class ITK_EXPORT GPUSmoothingRecursiveYvvGaussianImageFilter
   itkTypeMacro(GPUSmoothingRecursiveYvvGaussianImageFilter, GPUImageToImageFilter);
 
   /** Image dimension. */
-  itkStaticConstMacro(ImageDimension, unsigned int, TInputImage::ImageDimension);
+  static constexpr unsigned int ImageDimension = TInputImage::ImageDimension;
 
   /** Define the type for the sigma array */
   typedef FixedArray<ScalarRealType, itkGetStaticConstMacro(ImageDimension)> SigmaArrayType;
diff --git a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkSmoothingRecursiveYvvGaussianImageFilter.h b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkSmoothingRecursiveYvvGaussianImageFilter.h
index 68e2c749953..a8417a11c02 100644
--- a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkSmoothingRecursiveYvvGaussianImageFilter.h
+++ b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkSmoothingRecursiveYvvGaussianImageFilter.h
@@ -70,7 +70,7 @@ class ITK_EXPORT SmoothingRecursiveYvvGaussianImageFilter : public InPlaceImageF
   itkTypeMacro(SmoothingRecursiveYvvGaussianImageFilter, InPlaceImageFilter);
 
   /** Image dimension. */
-  itkStaticConstMacro(ImageDimension, unsigned int, TInputImage::ImageDimension);
+  static constexpr unsigned int ImageDimension = TInputImage::ImageDimension;
 
   /** Define the type for the sigma array */
   typedef FixedArray<ScalarRealType, itkGetStaticConstMacro(ImageDimension)> SigmaArrayType;

From 678ee1256550ff5e009111a720f953258672743c Mon Sep 17 00:00:00 2001
From: Hans Johnson <hans-johnson@uiowa.edu>
Date: Mon, 12 Feb 2018 23:31:13 -0600
Subject: [PATCH 29/65] STYLE: Prefer C++11 type alias over typedef

== http://en.cppreference.com/w/cpp/language/type_alias ==

Type alias is a name that refers to a previously defined type (similar
to typedef).

A type alias declaration introduces a name which can be used as a
synonym for the type denoted by type-id. It does not introduce a new
type and it cannot change the meaning of an existing type name. There is
no difference between a type alias declaration and typedef declaration.
This declaration may appear in block scope, class scope, or namespace
scope.

== https://www.quora.com/Is-using-typedef-in-C++-considered-a-bad-practice ==

While typedef is still available for backward compatibility, the new
Type Alias syntax 'using Alias = ExistingLongName;' is more consistent
with the flow of C++ than the old typedef syntax 'typedef
ExistingLongName Alias;', and it also works for templates (Type alias,
alias template (since C++11)), so leftover 'typedef' aliases will differ
in style from any alias templates.
---
 ...SmoothingRecursiveYvvGaussianImageFilter.h | 50 +++++++++----------
 .../itkRecursiveLineYvvGaussianImageFilter.h  | 32 ++++++------
 ...itkRecursiveLineYvvGaussianImageFilter.hxx | 10 ++--
 ...SmoothingRecursiveYvvGaussianImageFilter.h | 38 +++++++-------
 ...CPURecursiveYvvGaussianImageFilterTest.cxx |  4 +-
 ...GPURecursiveYvvGaussianImageFilterTest.cxx |  4 +-
 .../test/itkYvvBenchmark.cxx                  |  4 +-
 .../test/itkYvvGpuCpuSimilarityTest.cxx       | 22 ++++----
 .../test/itkYvvWhiteImageTest.cxx             | 12 ++---
 .../test/yvvFilter.hxx                        | 38 +++++++-------
 10 files changed, 106 insertions(+), 108 deletions(-)

diff --git a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkGPUSmoothingRecursiveYvvGaussianImageFilter.h b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkGPUSmoothingRecursiveYvvGaussianImageFilter.h
index 425702e8c3b..f1520872003 100644
--- a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkGPUSmoothingRecursiveYvvGaussianImageFilter.h
+++ b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkGPUSmoothingRecursiveYvvGaussianImageFilter.h
@@ -55,35 +55,33 @@ class ITK_EXPORT GPUSmoothingRecursiveYvvGaussianImageFilter
                                  SmoothingRecursiveYvvGaussianImageFilter<TInputImage, TOutputImage>>
 {
 public:
-  /** Standard class typedefs. */
-  typedef GPUSmoothingRecursiveYvvGaussianImageFilter Self;
+  /** Standard class type alias. */
+  using Self = GPUSmoothingRecursiveYvvGaussianImageFilter;
   // typedef SmoothingRecursiveYvvGaussianImageFilter<TInputImage,TOutputImage>
   //    CPUSuperclass;
-  typedef GPUImageToImageFilter<TInputImage,
-                                TOutputImage,
-                                SmoothingRecursiveYvvGaussianImageFilter<TInputImage, TOutputImage>>
-    Superclass;
-  typedef GPUImageToImageFilter<TInputImage,
-                                TOutputImage,
-                                SmoothingRecursiveYvvGaussianImageFilter<TInputImage, TOutputImage>>
-                                   GPUSuperclass;
-  typedef SmartPointer<Self>       Pointer;
-  typedef SmartPointer<const Self> ConstPointer;
+  using Superclass = GPUImageToImageFilter<TInputImage,
+                                           TOutputImage,
+                                           SmoothingRecursiveYvvGaussianImageFilter<TInputImage, TOutputImage>>;
+  using GPUSuperclass = GPUImageToImageFilter<TInputImage,
+                                              TOutputImage,
+                                              SmoothingRecursiveYvvGaussianImageFilter<TInputImage, TOutputImage>>;
+  using Pointer = SmartPointer<Self>;
+  using ConstPointer = SmartPointer<const Self>;
 
   /** Pixel Type of the input image */
-  typedef TInputImage                     InputImageType;
-  typedef TOutputImage                    OutputImageType;
-  typedef typename TInputImage::PixelType PixelType;
+  using InputImageType = TInputImage;
+  using OutputImageType = TOutputImage;
+  using PixelType = typename TInputImage::PixelType;
 #    ifdef WITH_DOUBLE
-  typedef typename NumericTraits<PixelType>::RealType       RealType;
-  typedef typename NumericTraits<PixelType>::ScalarRealType ScalarRealType;
+  using RealType = typename NumericTraits<PixelType>::RealType;
+  using ScalarRealType = typename NumericTraits<PixelType>::ScalarRealType;
 #    else
-  typedef typename NumericTraits<PixelType>::FloatType RealType;
-  typedef typename NumericTraits<PixelType>::FloatType ScalarRealType;
+  using RealType = typename NumericTraits<PixelType>::FloatType;
+  using ScalarRealType = typename NumericTraits<PixelType>::FloatType;
 #    endif
 
-  typedef typename itk::GPUTraits<TInputImage>::Type  GPUInputImage;
-  typedef typename itk::GPUTraits<TOutputImage>::Type GPUOutputImage;
+  using GPUInputImage = typename itk::GPUTraits<TInputImage>::Type;
+  using GPUOutputImage = typename itk::GPUTraits<TOutputImage>::Type;
 
   /** Runtime information support. */
   itkTypeMacro(GPUSmoothingRecursiveYvvGaussianImageFilter, GPUImageToImageFilter);
@@ -92,17 +90,17 @@ class ITK_EXPORT GPUSmoothingRecursiveYvvGaussianImageFilter
   static constexpr unsigned int ImageDimension = TInputImage::ImageDimension;
 
   /** Define the type for the sigma array */
-  typedef FixedArray<ScalarRealType, itkGetStaticConstMacro(ImageDimension)> SigmaArrayType;
+  using SigmaArrayType = FixedArray<ScalarRealType, itkGetStaticConstMacro(ImageDimension)>;
 
   /** Define the image type for internal computations
    RealType is usually 'double' in NumericTraits.
    Here we prefer float in order to save memory.  */
 
-  typedef typename NumericTraits<PixelType>::FloatType                       InternalRealType;
-  typedef GPUImage<InternalRealType, itkGetStaticConstMacro(ImageDimension)> RealImageType;
+  using InternalRealType = typename NumericTraits<PixelType>::FloatType;
+  using RealImageType = GPUImage<InternalRealType, itkGetStaticConstMacro(ImageDimension)>;
 
   /**  Pointer to the Output Image */
-  typedef typename OutputImageType::Pointer OutputImagePointer;
+  using OutputImagePointer = typename OutputImageType::Pointer;
 
   /** Method for creation through the object factory. */
   itkNewMacro(Self);
@@ -179,7 +177,7 @@ class ITK_EXPORT GPUSmoothingRecursiveYvvGaussianImageFilter
   // Initialization matrix for anti-causal pass
   ScalarRealType * m_CPUMatrix;
 
-  typedef GPUDataManager::Pointer GPUDataPointer;
+  using GPUDataPointer = GPUDataManager::Pointer;
 
   GPUDataPointer m_GPUMMatrixDataManager;
   GPUDataPointer m_GPUBCoefficientsDataManager;
diff --git a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkRecursiveLineYvvGaussianImageFilter.h b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkRecursiveLineYvvGaussianImageFilter.h
index 0323f596ca7..4418d841452 100644
--- a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkRecursiveLineYvvGaussianImageFilter.h
+++ b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkRecursiveLineYvvGaussianImageFilter.h
@@ -46,11 +46,11 @@ template <typename TInputImage, typename TOutputImage = TInputImage>
 class ITK_EXPORT RecursiveLineYvvGaussianImageFilter : public InPlaceImageFilter<TInputImage, TOutputImage>
 {
 public:
-  /** Standard class typedefs. */
-  typedef RecursiveLineYvvGaussianImageFilter           Self;
-  typedef InPlaceImageFilter<TInputImage, TOutputImage> Superclass;
-  typedef SmartPointer<Self>                            Pointer;
-  typedef SmartPointer<const Self>                      ConstPointer;
+  /** Standard class type alias. */
+  using Self = RecursiveLineYvvGaussianImageFilter;
+  using Superclass = InPlaceImageFilter<TInputImage, TOutputImage>;
+  using Pointer = SmartPointer<Self>;
+  using ConstPointer = SmartPointer<const Self>;
 
   /** Method for creation through the object factory. */
   itkNewMacro(Self);
@@ -58,31 +58,31 @@ class ITK_EXPORT RecursiveLineYvvGaussianImageFilter : public InPlaceImageFilter
   /** Type macro that defines a name for this class. */
   itkTypeMacro(RecursiveLineYvvGaussianImageFilter, InPlaceImageFilter);
 
-  /** Smart pointer typedef support.  */
-  typedef typename TInputImage::Pointer      InputImagePointer;
-  typedef typename TInputImage::ConstPointer InputImageConstPointer;
+  /** Smart pointer type alias support.  */
+  using InputImagePointer = typename TInputImage::Pointer;
+  using InputImageConstPointer = typename TInputImage::ConstPointer;
 
   /** Real type to be used in internal computations. RealType in general is
    * templated over the pixel type. (For example for vector or tensor pixels,
    * RealType is a vector or a tensor of doubles.) ScalarRealType is a type
    * meant for scalars.
    */
-  typedef typename TInputImage::PixelType InputPixelType;
+  using InputPixelType = typename TInputImage::PixelType;
 #  ifdef WITH_DOUBLE
-  typedef typename NumericTraits<InputPixelType>::RealType       RealType;
-  typedef typename NumericTraits<InputPixelType>::ScalarRealType ScalarRealType;
+  using RealType = typename NumericTraits<InputPixelType>::RealType;
+  using ScalarRealType = typename NumericTraits<InputPixelType>::ScalarRealType;
 #  else
-  typedef typename NumericTraits<InputPixelType>::FloatType RealType;
-  typedef typename NumericTraits<InputPixelType>::FloatType ScalarRealType;
+  using RealType = typename NumericTraits<InputPixelType>::FloatType;
+  using ScalarRealType = typename NumericTraits<InputPixelType>::FloatType;
 #  endif
 
-  typedef typename TOutputImage::RegionType OutputImageRegionType;
+  using OutputImageRegionType = typename TOutputImage::RegionType;
 
   /** Type of the input image */
-  typedef TInputImage InputImageType;
+  using InputImageType = TInputImage;
 
   /** Type of the output image */
-  typedef TOutputImage OutputImageType;
+  using OutputImageType = TOutputImage;
 
   /** Get the direction in which the filter is to be applied. */
   itkGetConstMacro(Direction, unsigned int);
diff --git a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkRecursiveLineYvvGaussianImageFilter.hxx b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkRecursiveLineYvvGaussianImageFilter.hxx
index ba11daa1f01..7fd781d186f 100644
--- a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkRecursiveLineYvvGaussianImageFilter.hxx
+++ b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkRecursiveLineYvvGaussianImageFilter.hxx
@@ -288,7 +288,7 @@ RecursiveLineYvvGaussianImageFilter<TInputImage, TOutputImage>::BeforeThreadedGe
           std::cout<<telltale  << ". itkRecursiveLineYvv::BeforeThreadedGenerateData \n";
   #endif
   */
-  typedef ImageRegion<TInputImage::ImageDimension> RegionType;
+  using RegionType = ImageRegion<TInputImage::ImageDimension>;
 
   typename TInputImage::ConstPointer inputImage(this->GetInputImage());
   typename TOutputImage::Pointer     outputImage(this->GetOutput());
@@ -333,12 +333,12 @@ RecursiveLineYvvGaussianImageFilter<TInputImage, TOutputImage>::ThreadedGenerate
           std::cout <<telltale  << ". itkRecursiveLineYvv::ThreadedGenerateData \n";
   #endif
   */
-  typedef typename TOutputImage::PixelType OutputPixelType;
+  using OutputPixelType = typename TOutputImage::PixelType;
 
-  typedef ImageLinearConstIteratorWithIndex<TInputImage> InputConstIteratorType;
-  typedef ImageLinearIteratorWithIndex<TOutputImage>     OutputIteratorType;
+  using InputConstIteratorType = ImageLinearConstIteratorWithIndex<TInputImage>;
+  using OutputIteratorType = ImageLinearIteratorWithIndex<TOutputImage>;
 
-  typedef ImageRegion<TInputImage::ImageDimension> RegionType;
+  using RegionType = ImageRegion<TInputImage::ImageDimension>;
 
   typename TInputImage::ConstPointer inputImage(this->GetInputImage());
   typename TOutputImage::Pointer     outputImage(this->GetOutput());
diff --git a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkSmoothingRecursiveYvvGaussianImageFilter.h b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkSmoothingRecursiveYvvGaussianImageFilter.h
index a8417a11c02..89f4d91987a 100644
--- a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkSmoothingRecursiveYvvGaussianImageFilter.h
+++ b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkSmoothingRecursiveYvvGaussianImageFilter.h
@@ -48,22 +48,22 @@ template <typename TInputImage, typename TOutputImage = TInputImage>
 class ITK_EXPORT SmoothingRecursiveYvvGaussianImageFilter : public InPlaceImageFilter<TInputImage, TOutputImage>
 {
 public:
-  /** Standard class typedefs. */
-  typedef SmoothingRecursiveYvvGaussianImageFilter      Self;
-  typedef InPlaceImageFilter<TInputImage, TOutputImage> Superclass;
-  typedef SmartPointer<Self>                            Pointer;
-  typedef SmartPointer<const Self>                      ConstPointer;
+  /** Standard class type alias. */
+  using Self = SmoothingRecursiveYvvGaussianImageFilter;
+  using Superclass = InPlaceImageFilter<TInputImage, TOutputImage>;
+  using Pointer = SmartPointer<Self>;
+  using ConstPointer = SmartPointer<const Self>;
 
   /** Pixel Type of the input image */
-  typedef TInputImage                     InputImageType;
-  typedef TOutputImage                    OutputImageType;
-  typedef typename TInputImage::PixelType PixelType;
+  using InputImageType = TInputImage;
+  using OutputImageType = TOutputImage;
+  using PixelType = typename TInputImage::PixelType;
 #  ifdef WITH_DOUBLE
-  typedef typename NumericTraits<PixelType>::RealType       RealType;
-  typedef typename NumericTraits<PixelType>::ScalarRealType ScalarRealType;
+  using RealType = typename NumericTraits<PixelType>::RealType;
+  using ScalarRealType = typename NumericTraits<PixelType>::ScalarRealType;
 #  else
-  typedef typename NumericTraits<PixelType>::FloatType RealType;
-  typedef typename NumericTraits<PixelType>::FloatType ScalarRealType;
+  using RealType = typename NumericTraits<PixelType>::FloatType;
+  using ScalarRealType = typename NumericTraits<PixelType>::FloatType;
 #  endif
 
   /** Runtime information support. */
@@ -73,14 +73,14 @@ class ITK_EXPORT SmoothingRecursiveYvvGaussianImageFilter : public InPlaceImageF
   static constexpr unsigned int ImageDimension = TInputImage::ImageDimension;
 
   /** Define the type for the sigma array */
-  typedef FixedArray<ScalarRealType, itkGetStaticConstMacro(ImageDimension)> SigmaArrayType;
+  using SigmaArrayType = FixedArray<ScalarRealType, itkGetStaticConstMacro(ImageDimension)>;
 
   /** Define the image type for internal computations
    RealType is usually 'double' in NumericTraits.
    Here we prefer float in order to save memory.  */
 
-  typedef typename NumericTraits<PixelType>::FloatType                     InternalRealType;
-  typedef typename InputImageType::template Rebind<InternalRealType>::Type RealImageType;
+  using InternalRealType = typename NumericTraits<PixelType>::FloatType;
+  using RealImageType = typename InputImageType::template Rebind<InternalRealType>::Type;
 
   /**  The first in the pipeline  */
   typedef RecursiveLineYvvGaussianImageFilter<InputImageType, RealImageType> FirstGaussianFilterType;
@@ -92,16 +92,16 @@ class ITK_EXPORT SmoothingRecursiveYvvGaussianImageFilter : public InPlaceImageF
   typedef CastImageFilter<RealImageType, OutputImageType> CastingFilterType;
 
   /**  Pointer to a gaussian filter.  */
-  typedef typename InternalGaussianFilterType::Pointer InternalGaussianFilterPointer;
+  using InternalGaussianFilterPointer = typename InternalGaussianFilterType::Pointer;
 
   /**  Pointer to the first gaussian filter.  */
-  typedef typename FirstGaussianFilterType::Pointer FirstGaussianFilterPointer;
+  using FirstGaussianFilterPointer = typename FirstGaussianFilterType::Pointer;
 
   /**  Pointer to the last filter, casting  */
-  typedef typename CastingFilterType::Pointer CastingFilterPointer;
+  using CastingFilterPointer = typename CastingFilterType::Pointer;
 
   /**  Pointer to the Output Image */
-  typedef typename OutputImageType::Pointer OutputImagePointer;
+  using OutputImagePointer = typename OutputImageType::Pointer;
 
   /** Method for creation through the object factory. */
   itkNewMacro(Self);
diff --git a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/itkCPURecursiveYvvGaussianImageFilterTest.cxx b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/itkCPURecursiveYvvGaussianImageFilterTest.cxx
index 855397ec806..c18ed1c2825 100644
--- a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/itkCPURecursiveYvvGaussianImageFilterTest.cxx
+++ b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/itkCPURecursiveYvvGaussianImageFilterTest.cxx
@@ -4,9 +4,9 @@
 
 
 #ifdef WITH_DOUBLE
-typedef double PixelType;
+using PixelType = double;
 #else
-typedef float PixelType;
+using PixelType = float;
 #endif
 
 int
diff --git a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/itkGPURecursiveYvvGaussianImageFilterTest.cxx b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/itkGPURecursiveYvvGaussianImageFilterTest.cxx
index 0b391bc2b23..b5cc858fc66 100644
--- a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/itkGPURecursiveYvvGaussianImageFilterTest.cxx
+++ b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/itkGPURecursiveYvvGaussianImageFilterTest.cxx
@@ -8,9 +8,9 @@
 
 
 #ifdef WITH_DOUBLE
-typedef double PixelType;
+using PixelType = double;
 #else
-typedef float PixelType;
+using PixelType = float;
 #endif
 
 int
diff --git a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/itkYvvBenchmark.cxx b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/itkYvvBenchmark.cxx
index 98b01386fe5..255f37065fb 100644
--- a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/itkYvvBenchmark.cxx
+++ b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/itkYvvBenchmark.cxx
@@ -7,9 +7,9 @@
 #endif
 
 #ifdef WITH_DOUBLE
-typedef double PixelType;
+using PixelType = double;
 #else
-typedef float PixelType;
+using PixelType = float;
 #endif
 
 int
diff --git a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/itkYvvGpuCpuSimilarityTest.cxx b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/itkYvvGpuCpuSimilarityTest.cxx
index c990361f106..b5acc435497 100644
--- a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/itkYvvGpuCpuSimilarityTest.cxx
+++ b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/itkYvvGpuCpuSimilarityTest.cxx
@@ -22,10 +22,10 @@
 // TODO: Test on Mac/Windows.
 
 #ifdef WITH_DOUBLE
-typedef double PixelType;
+using PixelType = double;
 #  define NRMSTH 5e-07
 #else
-typedef float PixelType;
+using PixelType = float;
 #  define NRMSTH 5e-04
 #endif
 
@@ -33,19 +33,19 @@ template <typename ImageType>
 int
 runYvvGpuCpuSimilarityTest(const std::string & inFile, float mySigma)
 {
-  typedef PixelType InputPixelType;
-  typedef PixelType OutputPixelType;
+  using InputPixelType = PixelType;
+  using OutputPixelType = PixelType;
 
-  typedef itk::GPUImage<InputPixelType, ImageType::ImageDimension>     InputImageType;
-  typedef itk::GPUImage<OutputPixelType, ImageType::ImageDimension>    OutputImageType;
-  typedef itk::Image<unsigned char, ImageType::ImageDimension>         UnsignedCharImageType;
-  typedef itk::CastImageFilter<OutputImageType, UnsignedCharImageType> CastFilterType;
+  using InputImageType = itk::GPUImage<InputPixelType, ImageType::ImageDimension>;
+  using OutputImageType = itk::GPUImage<OutputPixelType, ImageType::ImageDimension>;
+  using UnsignedCharImageType = itk::Image<unsigned char, ImageType::ImageDimension>;
+  using CastFilterType = itk::CastImageFilter<OutputImageType, UnsignedCharImageType>;
 
   typedef itk::SmoothingRecursiveYvvGaussianImageFilter<InputImageType, OutputImageType>    CPUYvvFilterType;
   typedef itk::GPUSmoothingRecursiveYvvGaussianImageFilter<InputImageType, OutputImageType> GPUYvvFilterType;
 
-  typedef itk::ImageFileReader<InputImageType>        ReaderType;
-  typedef itk::ImageFileWriter<UnsignedCharImageType> WriterType;
+  using ReaderType = itk::ImageFileReader<InputImageType>;
+  using WriterType = itk::ImageFileWriter<UnsignedCharImageType>;
 
   typename ReaderType::Pointer     reader = ReaderType::New();
   typename WriterType::Pointer     writer = WriterType::New();
@@ -122,7 +122,7 @@ runYvvGpuCpuSimilarityTest(const std::string & inFile, float mySigma)
     // RMS Error check
     // ---------------
 
-    typedef itk::MinimumMaximumImageCalculator<ImageType> ImageCalculatorFilterType;
+    using ImageCalculatorFilterType = itk::MinimumMaximumImageCalculator<ImageType>;
 
     typename ImageCalculatorFilterType::Pointer imageCalculatorFilter = ImageCalculatorFilterType::New();
     imageCalculatorFilter->SetImage(CPUFilter->GetOutput());
diff --git a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/itkYvvWhiteImageTest.cxx b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/itkYvvWhiteImageTest.cxx
index 6efa0fde850..cc33a2e3acb 100644
--- a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/itkYvvWhiteImageTest.cxx
+++ b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/itkYvvWhiteImageTest.cxx
@@ -7,9 +7,9 @@
 #endif
 
 #ifdef WITH_DOUBLE
-typedef double PixelType;
+using PixelType = double;
 #else
-typedef float PixelType;
+using PixelType = float;
 #endif
 
 #define die(error_msg)                                                                                   \
@@ -73,14 +73,14 @@ itkYvvWhiteImageTest(int argc, char * argv[])
   itk::TimeProbesCollectorBase timeCollector;
   if (dim == 2)
   {
-    typedef itk::Image<PixelType, 2> ImageType;
-    ImageType::SizeType              size2D = { { size[0], size[1] } };
+    using ImageType = itk::Image<PixelType, 2>;
+    ImageType::SizeType size2D = { { size[0], size[1] } };
     result = testWhite<ImageType>(size2D, sigma, &timeCollector, ntests);
   }
   else if (dim == 3)
   {
-    typedef itk::Image<PixelType, 3> ImageType;
-    ImageType::SizeType              size3D = { { size[0], size[1], size[2] } };
+    using ImageType = itk::Image<PixelType, 3>;
+    ImageType::SizeType size3D = { { size[0], size[1], size[2] } };
     result = testWhite<ImageType>(size3D, sigma, &timeCollector, ntests);
   }
   else
diff --git a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/yvvFilter.hxx b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/yvvFilter.hxx
index aa79269264c..651c7b7543e 100644
--- a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/yvvFilter.hxx
+++ b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/yvvFilter.hxx
@@ -15,9 +15,9 @@ template <typename ImageType>
 void
 writeImage(std::string filterLabel, ImageType * result)
 {
-  typedef itk::Image<unsigned char, ImageType::ImageDimension>   UnsignedCharImageType;
-  typedef itk::CastImageFilter<ImageType, UnsignedCharImageType> CastFilterType;
-  typedef itk::ImageFileWriter<UnsignedCharImageType>            WriterType;
+  using UnsignedCharImageType = itk::Image<unsigned char, ImageType::ImageDimension>;
+  using CastFilterType = itk::CastImageFilter<ImageType, UnsignedCharImageType>;
+  using WriterType = itk::ImageFileWriter<UnsignedCharImageType>;
 #ifdef VERBOSE
   std::cout << "..........." << filterLabel << ": Preparing to write out filtered image.\n";
 #endif
@@ -59,8 +59,8 @@ template <typename ImageType>
 int
 getSourceImage(void * sourceImagePtr, std::string inputFilename)
 {
-  typedef itk::ImageFileReader<ImageType> ReaderType;
-  typename ReaderType::Pointer            readerGPU = ReaderType::New();
+  using ReaderType = itk::ImageFileReader<ImageType>;
+  typename ReaderType::Pointer readerGPU = ReaderType::New();
   readerGPU->SetFileName(inputFilename);
   try
   {
@@ -111,9 +111,9 @@ testCpuFilter(std::string &                                 filterLabel,
   std::cout << "-----------" << filterLabel << ": Starting tests.\n";
 #endif
 
-  typedef typename FilterType::InputImageType InputImage;
-  typename InputImage::Pointer                src;
-  void *                                      imgPtr = &src;
+  using InputImage = typename FilterType::InputImageType;
+  typename InputImage::Pointer src;
+  void *                       imgPtr = &src;
 
   if (inputFilename.empty())
   {
@@ -181,7 +181,7 @@ testGpuFilter(std::string &                                 filterLabel,
 #  ifdef VERBOSE
   std::cout << "-----------" << filterLabel << ": Starting tests.\n";
 #  endif
-  typedef typename FilterType::InputImageType InputImage;
+  using InputImage = typename FilterType::InputImageType;
 
   typename InputImage::Pointer src;
   void *                       imgPtr = &src;
@@ -253,12 +253,12 @@ int
 testImage(std::string inputFilename, float sigma, itk::TimeProbesCollectorBase * timeCollector, unsigned int ntests)
 {
 #ifdef GPU
-  typedef itk::GPUImage<typename ImageType::PixelType, ImageType::ImageDimension>      GPUImageType;
-  typedef itk::GPUSmoothingRecursiveYvvGaussianImageFilter<GPUImageType, GPUImageType> GPUrecursiveYVVFilterType;
+  using GPUImageType = itk::GPUImage<typename ImageType::PixelType, ImageType::ImageDimension>;
+  using GPUrecursiveYVVFilterType = itk::GPUSmoothingRecursiveYvvGaussianImageFilter<GPUImageType, GPUImageType>;
 #endif
-  typedef ImageType                                                                 CPUImageType;
-  typedef itk::SmoothingRecursiveYvvGaussianImageFilter<CPUImageType, CPUImageType> RecursiveYVVFilterType;
-  typedef itk::SmoothingRecursiveGaussianImageFilter<CPUImageType, CPUImageType>    DericheFilterType;
+  using CPUImageType = ImageType;
+  using RecursiveYVVFilterType = itk::SmoothingRecursiveYvvGaussianImageFilter<CPUImageType, CPUImageType>;
+  using DericheFilterType = itk::SmoothingRecursiveGaussianImageFilter<CPUImageType, CPUImageType>;
 
   std::cout << ":::: Testing on " << inputFilename << ", using sigma = " << sigma << "   ::::" << std::endl;
   typename ImageType::SizeType size;
@@ -315,12 +315,12 @@ testWhite(typename ImageType::SizeType   size,
   std::cout << "Testing: " << size << " with sigma = " << sigma << ". Average over " << ntests << " runs." << std::endl;
 
 #ifdef GPU
-  typedef itk::GPUImage<typename ImageType::PixelType, ImageType::ImageDimension>      GPUImageType;
-  typedef itk::GPUSmoothingRecursiveYvvGaussianImageFilter<GPUImageType, GPUImageType> GPUrecursiveYVVFilterType;
+  using GPUImageType = itk::GPUImage<typename ImageType::PixelType, ImageType::ImageDimension>;
+  using GPUrecursiveYVVFilterType = itk::GPUSmoothingRecursiveYvvGaussianImageFilter<GPUImageType, GPUImageType>;
 #endif
-  typedef ImageType                                                                 CPUImageType;
-  typedef itk::SmoothingRecursiveYvvGaussianImageFilter<CPUImageType, CPUImageType> RecursiveYVVFilterType;
-  typedef itk::SmoothingRecursiveGaussianImageFilter<CPUImageType, CPUImageType>    DericheFilterType;
+  using CPUImageType = ImageType;
+  using RecursiveYVVFilterType = itk::SmoothingRecursiveYvvGaussianImageFilter<CPUImageType, CPUImageType>;
+  using DericheFilterType = itk::SmoothingRecursiveGaussianImageFilter<CPUImageType, CPUImageType>;
 
   std::string        emptyFilename;
   std::ostringstream parameterStream;

From 7fd8ed200164b0e86d3a038a677c69a646c939ba Mon Sep 17 00:00:00 2001
From: Hans Johnson <hans-johnson@uiowa.edu>
Date: Tue, 13 Feb 2018 08:25:35 -0600
Subject: [PATCH 30/65] STYLE: Prefer constexpr for const numeric literals

Use constexpr for constant numeric literals.
---
 .../itkGPUSmoothingRecursiveYvvGaussianImageFilter.hxx      | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkGPUSmoothingRecursiveYvvGaussianImageFilter.hxx b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkGPUSmoothingRecursiveYvvGaussianImageFilter.hxx
index e770c4a2ed9..1d9f8dd0331 100644
--- a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkGPUSmoothingRecursiveYvvGaussianImageFilter.hxx
+++ b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkGPUSmoothingRecursiveYvvGaussianImageFilter.hxx
@@ -337,9 +337,9 @@ GPUSmoothingRecursiveYvvGaussianImageFilter<TInputImage, TOutputImage>::GPUGener
     this->BuildKernel();
   }
 
-  const unsigned int X = 0;
-  const unsigned int Y = 1;
-  const unsigned int Z = 2;
+  constexpr unsigned int X = 0;
+  constexpr unsigned int Y = 1;
+  constexpr unsigned int Z = 2;
   // arguments set up
   int       argidx = 0;
   const int ndim = (int)TInputImage::ImageDimension;

From bdce855dff95ddf0e0e30d8f9fafaca6f97ded3f Mon Sep 17 00:00:00 2001
From: Jon Haitz Legarreta <jhlegarreta@vicomtech.org>
Date: Sat, 14 Apr 2018 19:27:53 +0200
Subject: [PATCH 31/65] COMP: Move ITK_DISALLOW_COPY_AND_ASSIGN calls to public
 section.

Move `ITK_DISALLOW_COPY_AND_ASSIGN` calls to public section following
the discussion in
https://discourse.itk.org/t/noncopyable

If legacy (pre-macro) copy and assing methods existed, subsitute them
for the `ITK_DISALLOW_COPY_AND_ASSIGN` macro.

Fix class name in `ITK_DISALLOW_COPY_AND_ASSIGN` macro declaration
argument for class `itk::GPUSmoothingRecursiveYvvGaussianImageFilter`:

`GPUSmoothingecursiveYvvGaussianImageFilter`
to
`GPUSmoothingeRecursiveYvvGaussianImageFilter`
---
 .../include/itkGPUSmoothingRecursiveYvvGaussianImageFilter.h  | 4 ++--
 .../include/itkRecursiveLineYvvGaussianImageFilter.h          | 4 ++--
 .../include/itkSmoothingRecursiveYvvGaussianImageFilter.h     | 4 ++--
 3 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkGPUSmoothingRecursiveYvvGaussianImageFilter.h b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkGPUSmoothingRecursiveYvvGaussianImageFilter.h
index 8966fb5d367..b4aff4f7cf8 100644
--- a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkGPUSmoothingRecursiveYvvGaussianImageFilter.h
+++ b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkGPUSmoothingRecursiveYvvGaussianImageFilter.h
@@ -55,6 +55,8 @@ class ITK_EXPORT GPUSmoothingRecursiveYvvGaussianImageFilter
                                  SmoothingRecursiveYvvGaussianImageFilter<TInputImage, TOutputImage>>
 {
 public:
+  ITK_DISALLOW_COPY_AND_ASSIGN(GPUSmoothingRecursiveYvvGaussianImageFilterKernel);
+
   /** Standard class typedefs. */
   typedef GPUSmoothingRecursiveYvvGaussianImageFilter Self;
   // typedef SmoothingRecursiveYvvGaussianImageFilter<TInputImage,TOutputImage>
@@ -186,8 +188,6 @@ class ITK_EXPORT GPUSmoothingRecursiveYvvGaussianImageFilter
   GPUDataPointer m_GPULocalDataManager;
 
 private:
-  ITK_DISALLOW_COPY_AND_ASSIGN(GPUSmoothingecursiveYvvGaussianImageFilter);
-
   void
   BuildKernel();
 
diff --git a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkRecursiveLineYvvGaussianImageFilter.h b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkRecursiveLineYvvGaussianImageFilter.h
index 0323f596ca7..eb917caea8b 100644
--- a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkRecursiveLineYvvGaussianImageFilter.h
+++ b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkRecursiveLineYvvGaussianImageFilter.h
@@ -46,6 +46,8 @@ template <typename TInputImage, typename TOutputImage = TInputImage>
 class ITK_EXPORT RecursiveLineYvvGaussianImageFilter : public InPlaceImageFilter<TInputImage, TOutputImage>
 {
 public:
+  ITK_DISALLOW_COPY_AND_ASSIGN(RecursiveLineYvvGaussianImageFilter);
+
   /** Standard class typedefs. */
   typedef RecursiveLineYvvGaussianImageFilter           Self;
   typedef InPlaceImageFilter<TInputImage, TOutputImage> Superclass;
@@ -176,8 +178,6 @@ class ITK_EXPORT RecursiveLineYvvGaussianImageFilter : public InPlaceImageFilter
   vnl_matrix<ScalarRealType> m_MMatrix;
 
 private:
-  ITK_DISALLOW_COPY_AND_ASSIGN(RecursiveLineYvvGaussianImageFilter);
-
   /** Direction in which the filter is to be applied
    * this should be in the range [0,ImageDimension-1]. */
   unsigned int m_Direction;
diff --git a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkSmoothingRecursiveYvvGaussianImageFilter.h b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkSmoothingRecursiveYvvGaussianImageFilter.h
index 68e2c749953..75db9a59227 100644
--- a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkSmoothingRecursiveYvvGaussianImageFilter.h
+++ b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkSmoothingRecursiveYvvGaussianImageFilter.h
@@ -48,6 +48,8 @@ template <typename TInputImage, typename TOutputImage = TInputImage>
 class ITK_EXPORT SmoothingRecursiveYvvGaussianImageFilter : public InPlaceImageFilter<TInputImage, TOutputImage>
 {
 public:
+  ITK_DISALLOW_COPY_AND_ASSIGN(SmoothingRecursiveYvvGaussianImageFilter);
+
   /** Standard class typedefs. */
   typedef SmoothingRecursiveYvvGaussianImageFilter      Self;
   typedef InPlaceImageFilter<TInputImage, TOutputImage> Superclass;
@@ -164,8 +166,6 @@ class ITK_EXPORT SmoothingRecursiveYvvGaussianImageFilter : public InPlaceImageF
   EnlargeOutputRequestedRegion(DataObject * output) override;
 
 private:
-  ITK_DISALLOW_COPY_AND_ASSIGN(SmoothingRecursiveYvvGaussianImageFilter);
-
   InternalGaussianFilterPointer m_SmoothingFilters[ImageDimension - 1];
   FirstGaussianFilterPointer    m_FirstSmoothingFilter;
   CastingFilterPointer          m_CastingFilter;

From dacc5ae1301504d1004c24b366944144a7e0f949 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?D=C5=BEenan=20Zuki=C4=87?= <dzenan.zukic@kitware.com>
Date: Fri, 20 Jul 2018 17:03:16 -0400
Subject: [PATCH 32/65] STYLE: reformatting the tests to be more compliant with
 ITK style

---
 ...CPURecursiveYvvGaussianImageFilterTest.cxx | 27 ++++++++++++-----
 ...GPURecursiveYvvGaussianImageFilterTest.cxx | 23 ++++++++++++--
 .../test/itkYvvBenchmark.cxx                  | 22 ++++++++++++--
 .../test/itkYvvGpuCpuSimilarityTest.cxx       | 30 +++++++++++++++----
 .../test/itkYvvWhiteImageTest.cxx             | 22 ++++++++++++--
 .../test/yvvFilter.hxx                        | 20 ++++++++++++-
 6 files changed, 123 insertions(+), 21 deletions(-)

diff --git a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/itkCPURecursiveYvvGaussianImageFilterTest.cxx b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/itkCPURecursiveYvvGaussianImageFilterTest.cxx
index 855397ec806..b3ff95dc05c 100644
--- a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/itkCPURecursiveYvvGaussianImageFilterTest.cxx
+++ b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/itkCPURecursiveYvvGaussianImageFilterTest.cxx
@@ -1,7 +1,24 @@
-#include <iostream>
-#include <fstream>
-#include "yvvFilter.hxx"
+/*=========================================================================
+ *
+ *  Copyright Insight Software Consortium
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *         http://www.apache.org/licenses/LICENSE-2.0.txt
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ *
+ *=========================================================================*/
 
+#include "yvvFilter.hxx"
+#include <fstream>
+#include <iostream>
 
 #ifdef WITH_DOUBLE
 typedef double PixelType;
@@ -12,7 +29,6 @@ typedef float PixelType;
 int
 itkCPURecursiveYvvGaussianImageFilterTest(int argc, char * argv[])
 {
-
   if (argc < 5)
   {
     std::cerr << "Error: missing arguments" << std::endl;
@@ -25,7 +41,6 @@ itkCPURecursiveYvvGaussianImageFilterTest(int argc, char * argv[])
   float        sigma = atof(argv[3]);
   unsigned int ntests = atoi(argv[4]);
 
-
   int                          res = EXIT_SUCCESS;
   itk::TimeProbesCollectorBase timeCollector;
 
@@ -45,7 +60,5 @@ itkCPURecursiveYvvGaussianImageFilterTest(int argc, char * argv[])
 
   timeCollector.Report();
   std::cout << "\n(!) GPU results will only be shown if GPU support has been detected and activated by the user.\n";
-
-
   return res;
 }
diff --git a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/itkGPURecursiveYvvGaussianImageFilterTest.cxx b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/itkGPURecursiveYvvGaussianImageFilterTest.cxx
index 0b391bc2b23..9f552dcc353 100644
--- a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/itkGPURecursiveYvvGaussianImageFilterTest.cxx
+++ b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/itkGPURecursiveYvvGaussianImageFilterTest.cxx
@@ -1,12 +1,29 @@
-#include <iostream>
-#include <fstream>
+/*=========================================================================
+ *
+ *  Copyright Insight Software Consortium
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *         http://www.apache.org/licenses/LICENSE-2.0.txt
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ *
+ *=========================================================================*/
+
 #include "yvvFilter.hxx"
+#include <fstream>
+#include <iostream>
 
 #ifdef GPU
 #  include "itkGPUContextManager.h"
 #endif
 
-
 #ifdef WITH_DOUBLE
 typedef double PixelType;
 #else
diff --git a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/itkYvvBenchmark.cxx b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/itkYvvBenchmark.cxx
index 98b01386fe5..298fcdb3acc 100644
--- a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/itkYvvBenchmark.cxx
+++ b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/itkYvvBenchmark.cxx
@@ -1,6 +1,24 @@
-#include <iostream>
-#include <fstream>
+/*=========================================================================
+ *
+ *  Copyright Insight Software Consortium
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *         http://www.apache.org/licenses/LICENSE-2.0.txt
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ *
+ *=========================================================================*/
+
 #include "yvvFilter.hxx"
+#include <fstream>
+#include <iostream>
 
 #ifdef GPU
 #  include "itkGPUContextManager.h"
diff --git a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/itkYvvGpuCpuSimilarityTest.cxx b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/itkYvvGpuCpuSimilarityTest.cxx
index c990361f106..2d3ad5a845a 100644
--- a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/itkYvvGpuCpuSimilarityTest.cxx
+++ b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/itkYvvGpuCpuSimilarityTest.cxx
@@ -1,16 +1,34 @@
-#include <iostream>
+/*=========================================================================
+ *
+ *  Copyright Insight Software Consortium
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *         http://www.apache.org/licenses/LICENSE-2.0.txt
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ *
+ *=========================================================================*/
+
 #include <fstream>
+#include <iostream>
 
 #include "itkCastImageFilter.h"
-#include "itkSmoothingRecursiveYvvGaussianImageFilter.h"
 #include "itkImageFileReader.h"
 #include "itkImageFileWriter.h"
-#include "itkTimeProbe.h"
 #include "itkMinimumMaximumImageCalculator.h"
+#include "itkSmoothingRecursiveYvvGaussianImageFilter.h"
+#include "itkTimeProbe.h"
 
+#include "itkGPUContextManager.h"
 #include "itkGPUImage.h"
 #include "itkGPUKernelManager.h"
-#include "itkGPUContextManager.h"
 #include "itkGPUSmoothingRecursiveYvvGaussianImageFilter.h"
 
 
@@ -140,8 +158,8 @@ runYvvGpuCpuSimilarityTest(const std::string & inFile, float mySigma)
     for (cit.GoToBegin(), git.GoToBegin(); !cit.IsAtEnd(); ++cit, ++git)
     {
       double err = (double)(cit.Get()) - (double)(git.Get());
-      //         if(err > 0.1 || (double)cit.Get() < 0.1) std::cout << "CPU : " << (double)(cit.Get()) << ", GPU : " <<
-      //         (double)(git.Get()) << std::endl;
+      //         if(err > 0.1 || (double)cit.Get() < 0.1) std::cout << "CPU : " << (double)(cit.Get()) << ", GPU : "
+      //         << (double)(git.Get()) << std::endl;
       diff += err * err;
       nPix++;
     }
diff --git a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/itkYvvWhiteImageTest.cxx b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/itkYvvWhiteImageTest.cxx
index 1817947c7b4..f3f75ec2a5d 100644
--- a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/itkYvvWhiteImageTest.cxx
+++ b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/itkYvvWhiteImageTest.cxx
@@ -1,6 +1,24 @@
-#include <iostream>
-#include <fstream>
+/*=========================================================================
+ *
+ *  Copyright Insight Software Consortium
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *         http://www.apache.org/licenses/LICENSE-2.0.txt
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ *
+ *=========================================================================*/
+
 #include "yvvFilter.hxx"
+#include <fstream>
+#include <iostream>
 
 #ifdef GPU
 #  include "itkGPUContextManager.h"
diff --git a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/yvvFilter.hxx b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/yvvFilter.hxx
index 68b6b9d5ceb..306d9f825c9 100644
--- a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/yvvFilter.hxx
+++ b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/yvvFilter.hxx
@@ -1,8 +1,26 @@
+/*=========================================================================
+ *
+ *  Copyright Insight Software Consortium
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *         http://www.apache.org/licenses/LICENSE-2.0.txt
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ *
+ *=========================================================================*/
+
 #include "itkCastImageFilter.h"
 #include "itkImageFileReader.h"
 #include "itkImageFileWriter.h"
-#include "itkSmoothingRecursiveYvvGaussianImageFilter.h"
 #include "itkSmoothingRecursiveGaussianImageFilter.h"
+#include "itkSmoothingRecursiveYvvGaussianImageFilter.h"
 #include "itkTimeProbesCollectorBase.h"
 
 #ifdef GPU

From 37eb36947e9bba24d57c17b01bb7fba81d4fd87e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?D=C5=BEenan=20Zuki=C4=87?= <dzenan.zukic@kitware.com>
Date: Fri, 20 Jul 2018 17:33:28 -0400
Subject: [PATCH 33/65] STYLE: adding copyright headers and style-compliant
 include guards

---
 ...SmoothingRecursiveYvvGaussianImageFilter.h |  61 +++++-----
 ...oothingRecursiveYvvGaussianImageFilter.hxx | 114 ++++++++++--------
 .../itkRecursiveLineYvvGaussianImageFilter.h  |  45 ++++---
 ...itkRecursiveLineYvvGaussianImageFilter.hxx |  43 +++++--
 ...SmoothingRecursiveYvvGaussianImageFilter.h |  53 ++++----
 ...oothingRecursiveYvvGaussianImageFilter.hxx |  35 ++++--
 6 files changed, 201 insertions(+), 150 deletions(-)

diff --git a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkGPUSmoothingRecursiveYvvGaussianImageFilter.h b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkGPUSmoothingRecursiveYvvGaussianImageFilter.h
index b4aff4f7cf8..c2f3f038ba3 100644
--- a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkGPUSmoothingRecursiveYvvGaussianImageFilter.h
+++ b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkGPUSmoothingRecursiveYvvGaussianImageFilter.h
@@ -1,33 +1,33 @@
 /*=========================================================================
  *
- * Copyright Insight Software Consortium
+ *  Copyright Insight Software Consortium
  *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
  *
- * http://www.apache.org/licenses/LICENSE-2.0.txt
+ *         http://www.apache.org/licenses/LICENSE-2.0.txt
  *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
  *
  *=========================================================================*/
 
-#ifdef GPU
+#ifndef itkGPUSmoothingRecursiveYvvGaussianImageFilter_h
+#define itkGPUSmoothingRecursiveYvvGaussianImageFilter_h
 
-#  ifndef _ITK_GPU_SMOOTHING_RECURSIVE_YVV_GAUSSIAN_IMAGE_FILTER_H_
-#    define _ITK_GPU_SMOOTHING_RECURSIVE_YVV_GAUSSIAN_IMAGE_FILTER_H_
+#ifdef GPU
 
-#    include "itkImage.h"
-#    include "itkPixelTraits.h"
-#    include "itkCommand.h"
-#    include "itkFixedArray.h"
-#    include "itkSmoothingRecursiveYvvGaussianImageFilter.h"
-#    include "itkOpenCLUtil.h"
-#    include "itkGPUImageToImageFilter.h"
+#  include "itkImage.h"
+#  include "itkPixelTraits.h"
+#  include "itkCommand.h"
+#  include "itkFixedArray.h"
+#  include "itkSmoothingRecursiveYvvGaussianImageFilter.h"
+#  include "itkOpenCLUtil.h"
+#  include "itkGPUImageToImageFilter.h"
 
 namespace itk
 {
@@ -76,13 +76,13 @@ class ITK_EXPORT GPUSmoothingRecursiveYvvGaussianImageFilter
   typedef TInputImage                     InputImageType;
   typedef TOutputImage                    OutputImageType;
   typedef typename TInputImage::PixelType PixelType;
-#    ifdef WITH_DOUBLE
+#  ifdef WITH_DOUBLE
   typedef typename NumericTraits<PixelType>::RealType       RealType;
   typedef typename NumericTraits<PixelType>::ScalarRealType ScalarRealType;
-#    else
+#  else
   typedef typename NumericTraits<PixelType>::FloatType RealType;
   typedef typename NumericTraits<PixelType>::FloatType ScalarRealType;
-#    endif
+#  endif
 
   typedef typename itk::GPUTraits<TInputImage>::Type  GPUInputImage;
   typedef typename itk::GPUTraits<TOutputImage>::Type GPUOutputImage;
@@ -134,11 +134,11 @@ class ITK_EXPORT GPUSmoothingRecursiveYvvGaussianImageFilter
   virtual void
   SetUp(ScalarRealType spacing);
 
-#    ifdef ITK_USE_CONCEPT_CHECKING
+#  ifdef ITK_USE_CONCEPT_CHECKING
   /** Begin concept checking */
   itkConceptMacro(InputHasNumericTraitsCheck, (Concept::HasNumericTraits<PixelType>));
   /** End concept checking */
-#    endif
+#  endif
   /** Get OpenCL Kernel source as a string, creates a GetOpenCLSource method */
   itkGetOpenCLSourceFromKernelMacro(GPUSmoothingRecursiveYvvGaussianImageFilterKernel);
   void
@@ -204,9 +204,10 @@ class ITK_EXPORT GPUSmoothingRecursiveYvvGaussianImageFilter
 };
 } // end namespace itk
 
-#    ifndef ITK_MANUAL_INSTANTIATION
-#      include "itkGPUSmoothingRecursiveYvvGaussianImageFilter.hxx"
-#    endif
+#  ifndef ITK_MANUAL_INSTANTIATION
+#    include "itkGPUSmoothingRecursiveYvvGaussianImageFilter.hxx"
+#  endif
+
+#endif // GPU
 
-#  endif //_ITK_GPU_SMOOTHING_RECURSIVE_YVV_GAUSSIAN_IMAGE_FILTER_H_
-#endif   // GPU
+#endif // itkGPUSmoothingRecursiveYvvGaussianImageFilter_h
diff --git a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkGPUSmoothingRecursiveYvvGaussianImageFilter.hxx b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkGPUSmoothingRecursiveYvvGaussianImageFilter.hxx
index e770c4a2ed9..e3a0995ab17 100644
--- a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkGPUSmoothingRecursiveYvvGaussianImageFilter.hxx
+++ b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkGPUSmoothingRecursiveYvvGaussianImageFilter.hxx
@@ -1,9 +1,27 @@
-#ifdef GPU
+/*=========================================================================
+ *
+ *  Copyright Insight Software Consortium
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *         http://www.apache.org/licenses/LICENSE-2.0.txt
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ *
+ *=========================================================================*/
+
+#ifndef itkGPUSmoothingRecursiveYvvGaussianImageFilter_hxx
+#define itkGPUSmoothingRecursiveYvvGaussianImageFilter_hxx
 
-#  ifndef _ITK_GPU_SMOOTHING_RECURSIVE_YVV_GAUSSIAN_IMAGE_FILTER_HXX_
-#    define _ITK_GPU_SMOOTHING_RECURSIVE_YVV_GAUSSIAN_IMAGE_FILTER_HXX_
+#ifdef GPU
 
-#    include "itkGPUSmoothingRecursiveYvvGaussianImageFilter.h"
+#  include "itkGPUSmoothingRecursiveYvvGaussianImageFilter.h"
 
 // #define VERBOSE
 namespace itk
@@ -14,10 +32,10 @@ namespace itk
 template <typename TInputImage, typename TOutputImage>
 GPUSmoothingRecursiveYvvGaussianImageFilter<TInputImage, TOutputImage>::GPUSmoothingRecursiveYvvGaussianImageFilter()
 {
-#    ifdef VERBOSE
+#  ifdef VERBOSE
   telltale = rand();
   std::cout << telltale << ". GPUSmoothing::constructor \n";
-#    endif
+#  endif
   m_NormalizeAcrossScale = false;
   otPtr = dynamic_cast<GPUOutputImage *>(this->ProcessObject::GetOutput(0));
 
@@ -44,13 +62,13 @@ GPUSmoothingRecursiveYvvGaussianImageFilter<TInputImage, TOutputImage>::BuildKer
     maxLineSize = maxLineSize < lineSizes[d] ? lineSizes[d] : maxLineSize;
   }
 
-#    ifdef WITH_DOUBLE
+#  ifdef WITH_DOUBLE
   defines << "#pragma OPENCL EXTENSION cl_khr_fp64 : enable \n";
-#    endif
+#  endif
 
-#    ifdef NVIDIA
+#  ifdef NVIDIA
   defines << "#pragma OPENCL EXTENSION cl_nv_pragma_unroll : enable \n";
-#    endif
+#  endif
 
   defines << "#define DIM_" << TInputImage::ImageDimension << "\n";
   defines << "#define INPIXELTYPE ";
@@ -61,9 +79,9 @@ GPUSmoothingRecursiveYvvGaussianImageFilter<TInputImage, TOutputImage>::BuildKer
   GetTypenameInString(typeid(ScalarRealType), defines);
   defines << "#define MAX_LINE_LENGTH " << maxLineSize << "\n";
 
-#    ifdef VERBOSE
+#  ifdef VERBOSE
   std::cout << telltale << ".   Defines: \n" << defines.str() << "\n";
-#    endif
+#  endif
 
   // load, build, create kernel
   this->m_GPUKernelManager->LoadProgramFromString(GPUSource, defines.str().c_str());
@@ -77,16 +95,16 @@ template <typename TInputImage, typename TOutputImage>
 void
 GPUSmoothingRecursiveYvvGaussianImageFilter<TInputImage, TOutputImage>::SetUp(ScalarRealType spacing)
 {
-#    ifdef VERBOSE
+#  ifdef VERBOSE
   std::cout << telltale << ". GPUSmoothing::SetUp with spacing " << spacing << "\n";
-#    endif
+#  endif
   const ScalarRealType sigmad = this->GetSigma() / spacing;
 
   if (this->GetSigma() >= 0.5)
   {
-#    ifdef VERBOSE
+#  ifdef VERBOSE
     std::cout << telltale << ". GPUSmoothing::SetUp with sigma " << m_Sigma << "\n";
-#    endif
+#  endif
     // Compute q according to 16 in Young et al on Gabor filering
     ScalarRealType q = 0;
     if (sigmad >= 3.556)
@@ -137,7 +155,7 @@ GPUSmoothingRecursiveYvvGaussianImageFilter<TInputImage, TOutputImage>::SetUp(Sc
       (m_B1 * m_B2 + m_B3 * m_B2 * m_B2 - m_B1 * m_B3 * m_B3 - m_B3 * m_B3 * m_B3 - m_B3 * m_B2 + m_B3) / factor;
     m_CPUMatrix[8] = (m_B3 * (m_B1 + m_B3 * m_B2)) / factor;
 
-#    ifdef VERBOSE
+#  ifdef VERBOSE
     for (int i = 0; i < 4; ++i)
     {
       std::cout << "B" << i << "  " << m_Bvalues[i] << std::endl;
@@ -147,7 +165,7 @@ GPUSmoothingRecursiveYvvGaussianImageFilter<TInputImage, TOutputImage>::SetUp(Sc
     {
       std::cout << "M" << i << "  " << m_CPUMatrix[i] << std::endl;
     }
-#    endif
+#  endif
     this->AllocateGPUCoefficients();
     this->Modified();
   }
@@ -157,9 +175,9 @@ template <typename TInputImage, typename TOutputImage>
 void
 GPUSmoothingRecursiveYvvGaussianImageFilter<TInputImage, TOutputImage>::SetInput(const TInputImage * input)
 {
-#    ifdef VERBOSE
+#  ifdef VERBOSE
   std::cout << telltale << ".   GPUSmoothingRecursiveYvvGaussianImageFilter::SetInput \n";
-#    endif
+#  endif
   // ProcessObject is not const_correct so this const_cast is required
   ProcessObject::SetNthInput(0, const_cast<TInputImage *>(input));
 
@@ -186,9 +204,9 @@ template <typename TInputImage, typename TOutputImage>
 void
 GPUSmoothingRecursiveYvvGaussianImageFilter<TInputImage, TOutputImage>::SetSigma(ScalarRealType sigma)
 {
-#    ifdef VERBOSE
+#  ifdef VERBOSE
   std::cout << telltale << ". GPUSmoothing::SetSigma: " << sigma << " \n";
-#    endif
+#  endif
   SigmaArrayType sigmas(sigma);
   this->SetSigmaArray(sigmas);
 }
@@ -199,9 +217,9 @@ template <typename TInputImage, typename TOutputImage>
 void
 GPUSmoothingRecursiveYvvGaussianImageFilter<TInputImage, TOutputImage>::SetSigmaArray(const SigmaArrayType & sigma)
 {
-#    ifdef VERBOSE
+#  ifdef VERBOSE
   std::cout << telltale << ". GPUSmoothing::SetSigmaArray" << m_Sigma << " vs new: " << sigma[0] << " \n";
-#    endif
+#  endif
   if (this->m_Sigma != sigma)
   {
     this->m_Sigma = sigma;
@@ -209,10 +227,10 @@ GPUSmoothingRecursiveYvvGaussianImageFilter<TInputImage, TOutputImage>::SetSigma
     const typename InputImageType::SpacingType & pixelSize = this->GetOutput()->GetSpacing();
     if (pixelSize[0] != 0)
     {
-#    ifdef VERBOSE
+#  ifdef VERBOSE
       std::cout << telltale << ". GPUSmoothing::SetSigmaArray. pixelSize: [" << pixelSize[0] << "," << pixelSize[1]
                 << "," << pixelSize[2] << "] \n";
-#    endif
+#  endif
       this->SetUp(pixelSize[0]);
     }
     this->Modified();
@@ -261,9 +279,9 @@ void
 GPUSmoothingRecursiveYvvGaussianImageFilter<TInputImage, TOutputImage>::GenerateInputRequestedRegion() throw(
   InvalidRequestedRegionError)
 {
-#    ifdef VERBOSE
+#  ifdef VERBOSE
   std::cout << telltale << ". GPUSmoothing::GenerateInputRequestedRegion \n";
-#    endif
+#  endif
   // call the superclass' implementation of this method. this should
   // copy the output requested region to the input requested region
   Superclass::GenerateInputRequestedRegion();
@@ -282,9 +300,9 @@ void
 GPUSmoothingRecursiveYvvGaussianImageFilter<TInputImage, TOutputImage>::EnlargeOutputRequestedRegion(
   DataObject * output)
 {
-#    ifdef VERBOSE
+#  ifdef VERBOSE
   std::cout << telltale << ". GPUSmoothing::EnlargeOutputRequestedRegion \n";
-#    endif
+#  endif
   TOutputImage * out = dynamic_cast<TOutputImage *>(output);
 
   if (out)
@@ -297,9 +315,9 @@ template <typename TInputImage, typename TOutputImage>
 void
 GPUSmoothingRecursiveYvvGaussianImageFilter<TInputImage, TOutputImage>::AllocateGPUCoefficients()
 {
-#    ifdef VERBOSE
+#  ifdef VERBOSE
   std::cout << telltale << ".   GPUSmoothingRecursiveYvvGaussianImageFilter::AllocateGPUInputBuffer \n";
-#    endif
+#  endif
 
   m_GPUBCoefficientsDataManager = GPUDataManager::New();
   m_GPUBCoefficientsDataManager->SetBufferSize(4 * sizeof(ScalarRealType));
@@ -329,9 +347,9 @@ template <typename TInputImage, typename TOutputImage>
 void
 GPUSmoothingRecursiveYvvGaussianImageFilter<TInputImage, TOutputImage>::GPUGenerateData(void)
 {
-#    ifdef VERBOSE
+#  ifdef VERBOSE
   std::cout << telltale << ".    GPUSmoothing::GPUGenerateData \n";
-#    endif
+#  endif
   if (m_FilterGPUKernelHandle == -1)
   {
     this->BuildKernel();
@@ -352,9 +370,9 @@ GPUSmoothingRecursiveYvvGaussianImageFilter<TInputImage, TOutputImage>::GPUGener
   for (int i = 0; i < ndim; ++i)
   {
     this->m_GPUKernelManager->SetKernelArg(m_FilterGPUKernelHandle, argidx++, sizeof(int), &(m_requestedSize[i]));
-#    ifdef VERBOSE
+#  ifdef VERBOSE
     std::cout << telltale << ".Arg     " << argidx << ": " << m_requestedSize[i] << "\n";
-#    endif
+#  endif
   }
 
   const unsigned int dimArg = argidx;
@@ -364,17 +382,17 @@ GPUSmoothingRecursiveYvvGaussianImageFilter<TInputImage, TOutputImage>::GPUGener
     int globalSize1D = (m_requestedSize[1] > m_requestedSize[0] ? m_requestedSize[1] : m_requestedSize[0]);
 
     this->m_GPUKernelManager->SetKernelArg(m_FilterGPUKernelHandle, dimArg, sizeof(unsigned int), &(X));
-#    ifdef VERBOSE
+#  ifdef VERBOSE
     std::cout << telltale << ". Calling 1D kernel on X.\n";
-#    endif
+#  endif
     this->m_GPUKernelManager->LaunchKernel1D(m_FilterGPUKernelHandle, globalSize1D, 16);
 
     // change ONLY input and direction of filter
     this->m_GPUKernelManager->SetKernelArgWithImage(m_FilterGPUKernelHandle, 0, otPtr->GetGPUDataManager());
     this->m_GPUKernelManager->SetKernelArg(m_FilterGPUKernelHandle, dimArg, sizeof(unsigned int), &(Y));
-#    ifdef VERBOSE
+#  ifdef VERBOSE
     std::cout << telltale << ". Calling 1D kernel on Y.\n";
-#    endif
+#  endif
     this->m_GPUKernelManager->LaunchKernel1D(m_FilterGPUKernelHandle, globalSize1D, 16);
   }
   else
@@ -383,25 +401,25 @@ GPUSmoothingRecursiveYvvGaussianImageFilter<TInputImage, TOutputImage>::GPUGener
     //  dimension.
 
     this->m_GPUKernelManager->SetKernelArg(m_FilterGPUKernelHandle, argidx++, sizeof(unsigned int), &(X));
-#    ifdef VERBOSE
+#  ifdef VERBOSE
     std::cout << telltale << ". Calling 2D kernel on X.\n";
-#    endif
+#  endif
     this->m_GPUKernelManager->LaunchKernel2D(m_FilterGPUKernelHandle, m_requestedSize[2], m_requestedSize[1], 16, 16);
 
     // change ONLY input and direction of filter
     this->m_GPUKernelManager->SetKernelArgWithImage(m_FilterGPUKernelHandle, 0, otPtr->GetGPUDataManager());
     this->m_GPUKernelManager->SetKernelArg(m_FilterGPUKernelHandle, dimArg, sizeof(unsigned int), &(Y));
-#    ifdef VERBOSE
+#  ifdef VERBOSE
     std::cout << telltale << ". Calling 2D kernel on Y.\n";
-#    endif
+#  endif
     this->m_GPUKernelManager->LaunchKernel2D(m_FilterGPUKernelHandle, m_requestedSize[0], m_requestedSize[2], 16, 16);
 
     // input is already pointing to previous output; change ONLY direction of
     //  filter
     this->m_GPUKernelManager->SetKernelArg(m_FilterGPUKernelHandle, dimArg, sizeof(unsigned int), &(Z));
-#    ifdef VERBOSE
+#  ifdef VERBOSE
     std::cout << telltale << ". Calling 2D kernel on Z.\n";
-#    endif
+#  endif
     this->m_GPUKernelManager->LaunchKernel2D(m_FilterGPUKernelHandle, m_requestedSize[0], m_requestedSize[1], 16, 16);
   }
 }
@@ -421,5 +439,5 @@ GPUSmoothingRecursiveYvvGaussianImageFilter<TInputImage, TOutputImage>::PrintSel
 }
 } // end namespace itk
 
-#  endif //_ITK_GPU_SMOOTHING_RECURSIVE_YVV_GAUSSIAN_IMAGE_FILTER_HXX_
-#endif   // GPU
+#endif // GPU
+#endif // itkGPUSmoothingRecursiveYvvGaussianImageFilter_hxx
diff --git a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkRecursiveLineYvvGaussianImageFilter.h b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkRecursiveLineYvvGaussianImageFilter.h
index eb917caea8b..d7a10814c01 100644
--- a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkRecursiveLineYvvGaussianImageFilter.h
+++ b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkRecursiveLineYvvGaussianImageFilter.h
@@ -1,28 +1,27 @@
 /*=========================================================================
  *
- * Copyright Insight Software Consortium
+ *  Copyright Insight Software Consortium
  *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
  *
- * http://www.apache.org/licenses/LICENSE-2.0.txt
+ *         http://www.apache.org/licenses/LICENSE-2.0.txt
  *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
  *
  *=========================================================================*/
 
-#pragma once
-#ifndef _ITK_RECURSIVE_LINE_YVV_GAUSSIAN_IMAGE_FILTER_H_
-#  define _ITK_RECURSIVE_LINE_YVV_GAUSSIAN_IMAGE_FILTER_H_
+#ifndef itkRecursiveLineYvvGaussianImageFilter_h
+#define itkRecursiveLineYvvGaussianImageFilter_h
 
-#  include <itkInPlaceImageFilter.h>
-#  include <itkNumericTraits.h>
-#  include <itkImageRegionSplitterDirection.h>
+#include <itkInPlaceImageFilter.h>
+#include <itkNumericTraits.h>
+#include <itkImageRegionSplitterDirection.h>
 
 namespace itk
 {
@@ -70,13 +69,13 @@ class ITK_EXPORT RecursiveLineYvvGaussianImageFilter : public InPlaceImageFilter
    * meant for scalars.
    */
   typedef typename TInputImage::PixelType InputPixelType;
-#  ifdef WITH_DOUBLE
+#ifdef WITH_DOUBLE
   typedef typename NumericTraits<InputPixelType>::RealType       RealType;
   typedef typename NumericTraits<InputPixelType>::ScalarRealType ScalarRealType;
-#  else
+#else
   typedef typename NumericTraits<InputPixelType>::FloatType RealType;
   typedef typename NumericTraits<InputPixelType>::FloatType ScalarRealType;
-#  endif
+#endif
 
   typedef typename TOutputImage::RegionType OutputImageRegionType;
 
@@ -191,8 +190,8 @@ class ITK_EXPORT RecursiveLineYvvGaussianImageFilter : public InPlaceImageFilter
 };
 } // end namespace itk
 
-#  ifndef ITK_MANUAL_INSTANTIATION
-#    include "itkRecursiveLineYvvGaussianImageFilter.hxx"
-#  endif
-
+#ifndef ITK_MANUAL_INSTANTIATION
+#  include "itkRecursiveLineYvvGaussianImageFilter.hxx"
 #endif
+
+#endif // itkRecursiveLineYvvGaussianImageFilter_h
diff --git a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkRecursiveLineYvvGaussianImageFilter.hxx b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkRecursiveLineYvvGaussianImageFilter.hxx
index 3181a247cd0..de2e55712e3 100644
--- a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkRecursiveLineYvvGaussianImageFilter.hxx
+++ b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkRecursiveLineYvvGaussianImageFilter.hxx
@@ -1,12 +1,29 @@
-#pragma once
-#ifndef _ITK_RECURSIVE_LINE_YVV_GAUSSIAN_IMAGE_FILTER_HXX_
-#  define _ITK_RECURSIVE_LINE_YVV_GAUSSIAN_IMAGE_FILTER_HXX_
-
-#  include "itkRecursiveLineYvvGaussianImageFilter.h"
-#  include "itkObjectFactory.h"
-#  include "itkImageLinearIteratorWithIndex.h"
-#  include "itkImageLinearConstIteratorWithIndex.h"
-#  include "itkProgressReporter.h"
+/*=========================================================================
+ *
+ *  Copyright Insight Software Consortium
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *         http://www.apache.org/licenses/LICENSE-2.0.txt
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ *
+ *=========================================================================*/
+
+#ifndef itkRecursiveLineYvvGaussianImageFilter_hxx
+#define itkRecursiveLineYvvGaussianImageFilter_hxx
+
+#include "itkRecursiveLineYvvGaussianImageFilter.h"
+#include "itkObjectFactory.h"
+#include "itkImageLinearIteratorWithIndex.h"
+#include "itkImageLinearConstIteratorWithIndex.h"
+#include "itkProgressReporter.h"
 
 // #define VERBOSE
 
@@ -22,7 +39,7 @@ RecursiveLineYvvGaussianImageFilter<TInputImage, TOutputImage>::RecursiveLineYvv
   this->InPlaceOff();
 
   m_ImageRegionSplitter = ImageRegionSplitterDirection::New();
-#  ifdef VERBOSE
+#ifdef VERBOSE
   std::cout << "-----------Line filter TYPES\n";
 
   if (typeid(typename TInputImage::PixelType) == typeid(double))
@@ -46,7 +63,7 @@ RecursiveLineYvvGaussianImageFilter<TInputImage, TOutputImage>::RecursiveLineYvv
 
   /*if( typeid ( InternalRealType ) == typeid ( double ))
           std::cout<<"InternalRealType double\n"; */
-#  endif
+#endif
 }
 
 /**
@@ -136,7 +153,7 @@ RecursiveLineYvvGaussianImageFilter<TInputImage, TOutputImage>::SetUp(ScalarReal
 
   m_MMatrix /= (1 + m_B1 - m_B2 + m_B3) * (1 - m_B1 - m_B2 - m_B3) * (1 + m_B2 + (m_B1 - m_B3) * m_B3);
 
-#  ifdef VERBOSE
+#ifdef VERBOSE
   std::cout << "cB   " << m_B << std::endl;
   std::cout << "cB1  " << m_B1 << std::endl;
   std::cout << "cB2  " << m_B2 << std::endl;
@@ -149,7 +166,7 @@ RecursiveLineYvvGaussianImageFilter<TInputImage, TOutputImage>::SetUp(ScalarReal
       std::cout << "cM(" << i << "," << j << ")  " << m_MMatrix(i, j) << std::endl;
     }
   }
-#  endif
+#endif
 }
 
 /**
diff --git a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkSmoothingRecursiveYvvGaussianImageFilter.h b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkSmoothingRecursiveYvvGaussianImageFilter.h
index 75db9a59227..5bf0aa29be8 100644
--- a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkSmoothingRecursiveYvvGaussianImageFilter.h
+++ b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkSmoothingRecursiveYvvGaussianImageFilter.h
@@ -1,31 +1,30 @@
 /*=========================================================================
  *
- * Copyright Insight Software Consortium
+ *  Copyright Insight Software Consortium
  *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
  *
- * http://www.apache.org/licenses/LICENSE-2.0.txt
+ *         http://www.apache.org/licenses/LICENSE-2.0.txt
  *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
  *
  *=========================================================================*/
-#pragma once
 
-#ifndef _ITK_SMOOTHING_RECURSIVE_YVV_GAUSSIAN_IMAGE_FILTER_H_
-#  define _ITK_SMOOTHING_RECURSIVE_YVV_GAUSSIAN_IMAGE_FILTER_H_
+#ifndef itkSmoothingRecursiveYvvGaussianImageFilter_h
+#define itkSmoothingRecursiveYvvGaussianImageFilter_h
 
-#  include "itkRecursiveLineYvvGaussianImageFilter.h"
-#  include "itkCastImageFilter.h"
-#  include "itkImage.h"
-#  include "itkPixelTraits.h"
-#  include "itkCommand.h"
-#  include "itkFixedArray.h"
+#include "itkRecursiveLineYvvGaussianImageFilter.h"
+#include "itkCastImageFilter.h"
+#include "itkImage.h"
+#include "itkPixelTraits.h"
+#include "itkCommand.h"
+#include "itkFixedArray.h"
 
 namespace itk
 {
@@ -60,13 +59,13 @@ class ITK_EXPORT SmoothingRecursiveYvvGaussianImageFilter : public InPlaceImageF
   typedef TInputImage                     InputImageType;
   typedef TOutputImage                    OutputImageType;
   typedef typename TInputImage::PixelType PixelType;
-#  ifdef WITH_DOUBLE
+#ifdef WITH_DOUBLE
   typedef typename NumericTraits<PixelType>::RealType       RealType;
   typedef typename NumericTraits<PixelType>::ScalarRealType ScalarRealType;
-#  else
+#else
   typedef typename NumericTraits<PixelType>::FloatType RealType;
   typedef typename NumericTraits<PixelType>::FloatType ScalarRealType;
-#  endif
+#endif
 
   /** Runtime information support. */
   itkTypeMacro(SmoothingRecursiveYvvGaussianImageFilter, InPlaceImageFilter);
@@ -138,11 +137,11 @@ class ITK_EXPORT SmoothingRecursiveYvvGaussianImageFilter : public InPlaceImageF
   bool
   CanRunInPlace(void) const override;
 
-#  ifdef ITK_USE_CONCEPT_CHECKING
+#ifdef ITK_USE_CONCEPT_CHECKING
   /** Begin concept checking */
   itkConceptMacro(InputHasNumericTraitsCheck, (Concept::HasNumericTraits<PixelType>));
   /** End concept checking */
-#  endif
+#endif
 protected:
   SmoothingRecursiveYvvGaussianImageFilter();
   ~SmoothingRecursiveYvvGaussianImageFilter() override {}
@@ -179,8 +178,8 @@ class ITK_EXPORT SmoothingRecursiveYvvGaussianImageFilter : public InPlaceImageF
 };
 } // end namespace itk
 
-#  ifndef ITK_MANUAL_INSTANTIATION
-#    include "itkSmoothingRecursiveYvvGaussianImageFilter.hxx"
-#  endif
+#ifndef ITK_MANUAL_INSTANTIATION
+#  include "itkSmoothingRecursiveYvvGaussianImageFilter.hxx"
+#endif
 
 #endif
diff --git a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkSmoothingRecursiveYvvGaussianImageFilter.hxx b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkSmoothingRecursiveYvvGaussianImageFilter.hxx
index 4660dbac437..d74652de3f9 100644
--- a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkSmoothingRecursiveYvvGaussianImageFilter.hxx
+++ b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkSmoothingRecursiveYvvGaussianImageFilter.hxx
@@ -1,10 +1,27 @@
-#pragma once
-#ifndef _ITK_SMOOTHING_RECURSIVE_YVV_GAUSSIAN_IMAGE_FILTER_HXX_
-#  define _ITK_SMOOTHING_RECURSIVE_YVV_GAUSSIAN_IMAGE_FILTER_HXX_
-
-#  include "itkSmoothingRecursiveYvvGaussianImageFilter.h"
-#  include "itkImageRegionIteratorWithIndex.h"
-#  include "itkProgressAccumulator.h"
+/*=========================================================================
+ *
+ *  Copyright Insight Software Consortium
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *         http://www.apache.org/licenses/LICENSE-2.0.txt
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ *
+ *=========================================================================*/
+
+#ifndef itkSmoothingRecursiveYvvGaussianImageFilter_hxx
+#define itkSmoothingRecursiveYvvGaussianImageFilter_hxx
+
+#include "itkSmoothingRecursiveYvvGaussianImageFilter.h"
+#include "itkImageRegionIteratorWithIndex.h"
+#include "itkProgressAccumulator.h"
 
 // #define VERBOSE
 
@@ -56,7 +73,7 @@ SmoothingRecursiveYvvGaussianImageFilter<TInputImage, TOutputImage>::SmoothingRe
   this->m_Sigma.Fill(0.0);
   this->SetSigma(1.0);
 
-#  ifdef VERBOSE
+#ifdef VERBOSE
   std::cout << "-----------Smoothing filter TYPES\n";
 
   if (typeid(typename TInputImage::PixelType) == typeid(double))
@@ -83,7 +100,7 @@ SmoothingRecursiveYvvGaussianImageFilter<TInputImage, TOutputImage>::SmoothingRe
     std::cout << "InternalRealType double\n";
   }
 
-#  endif
+#endif
 }
 
 template <typename TInputImage, typename TOutputImage>

From 793f5517f7bd4b49a199035880e06467001910c7 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?D=C5=BEenan=20Zuki=C4=87?= <dzenan.zukic@kitware.com>
Date: Fri, 20 Jul 2018 17:46:05 -0400
Subject: [PATCH 34/65] STYLE: removing verbose debugging code

---
 ...SmoothingRecursiveYvvGaussianImageFilter.h |   1 -
 ...oothingRecursiveYvvGaussianImageFilter.hxx | 101 ++--------------
 ...itkRecursiveLineYvvGaussianImageFilter.hxx | 109 ++++++------------
 ...SmoothingRecursiveYvvGaussianImageFilter.h |   7 --
 ...oothingRecursiveYvvGaussianImageFilter.hxx | 100 ++++------------
 .../test/yvvFilter.hxx                        |  28 -----
 6 files changed, 66 insertions(+), 280 deletions(-)

diff --git a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkGPUSmoothingRecursiveYvvGaussianImageFilter.h b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkGPUSmoothingRecursiveYvvGaussianImageFilter.h
index c2f3f038ba3..6022efa445c 100644
--- a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkGPUSmoothingRecursiveYvvGaussianImageFilter.h
+++ b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkGPUSmoothingRecursiveYvvGaussianImageFilter.h
@@ -200,7 +200,6 @@ class ITK_EXPORT GPUSmoothingRecursiveYvvGaussianImageFilter
   typename GPUOutputImage::SizeType m_requestedSize;
   /** Standard deviation of the gaussian used for smoothing */
   SigmaArrayType m_Sigma;
-  int            telltale; // TODO: REMOVE
 };
 } // end namespace itk
 
diff --git a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkGPUSmoothingRecursiveYvvGaussianImageFilter.hxx b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkGPUSmoothingRecursiveYvvGaussianImageFilter.hxx
index e3a0995ab17..1f45dd5080a 100644
--- a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkGPUSmoothingRecursiveYvvGaussianImageFilter.hxx
+++ b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkGPUSmoothingRecursiveYvvGaussianImageFilter.hxx
@@ -23,19 +23,11 @@
 
 #  include "itkGPUSmoothingRecursiveYvvGaussianImageFilter.h"
 
-// #define VERBOSE
 namespace itk
 {
-/**
- * Constructor
- */
 template <typename TInputImage, typename TOutputImage>
 GPUSmoothingRecursiveYvvGaussianImageFilter<TInputImage, TOutputImage>::GPUSmoothingRecursiveYvvGaussianImageFilter()
 {
-#  ifdef VERBOSE
-  telltale = rand();
-  std::cout << telltale << ". GPUSmoothing::constructor \n";
-#  endif
   m_NormalizeAcrossScale = false;
   otPtr = dynamic_cast<GPUOutputImage *>(this->ProcessObject::GetOutput(0));
 
@@ -79,32 +71,19 @@ GPUSmoothingRecursiveYvvGaussianImageFilter<TInputImage, TOutputImage>::BuildKer
   GetTypenameInString(typeid(ScalarRealType), defines);
   defines << "#define MAX_LINE_LENGTH " << maxLineSize << "\n";
 
-#  ifdef VERBOSE
-  std::cout << telltale << ".   Defines: \n" << defines.str() << "\n";
-#  endif
-
   // load, build, create kernel
   this->m_GPUKernelManager->LoadProgramFromString(GPUSource, defines.str().c_str());
   m_FilterGPUKernelHandle = this->m_GPUKernelManager->CreateKernel("YvvFilter");
 }
 
-/**
- *   Compute filter for Gaussian kernel.
- */
 template <typename TInputImage, typename TOutputImage>
 void
 GPUSmoothingRecursiveYvvGaussianImageFilter<TInputImage, TOutputImage>::SetUp(ScalarRealType spacing)
 {
-#  ifdef VERBOSE
-  std::cout << telltale << ". GPUSmoothing::SetUp with spacing " << spacing << "\n";
-#  endif
   const ScalarRealType sigmad = this->GetSigma() / spacing;
 
   if (this->GetSigma() >= 0.5)
   {
-#  ifdef VERBOSE
-    std::cout << telltale << ". GPUSmoothing::SetUp with sigma " << m_Sigma << "\n";
-#  endif
     // Compute q according to 16 in Young et al on Gabor filering
     ScalarRealType q = 0;
     if (sigmad >= 3.556)
@@ -155,17 +134,18 @@ GPUSmoothingRecursiveYvvGaussianImageFilter<TInputImage, TOutputImage>::SetUp(Sc
       (m_B1 * m_B2 + m_B3 * m_B2 * m_B2 - m_B1 * m_B3 * m_B3 - m_B3 * m_B3 * m_B3 - m_B3 * m_B2 + m_B3) / factor;
     m_CPUMatrix[8] = (m_B3 * (m_B1 + m_B3 * m_B2)) / factor;
 
-#  ifdef VERBOSE
-    for (int i = 0; i < 4; ++i)
+    if (this->GetDebug())
     {
-      std::cout << "B" << i << "  " << m_Bvalues[i] << std::endl;
-    }
+      for (int i = 0; i < 4; ++i)
+      {
+        std::cout << "B" << i << "  " << m_Bvalues[i] << std::endl;
+      }
 
-    for (int i = 0; i < 9; ++i)
-    {
-      std::cout << "M" << i << "  " << m_CPUMatrix[i] << std::endl;
+      for (int i = 0; i < 9; ++i)
+      {
+        std::cout << "M" << i << "  " << m_CPUMatrix[i] << std::endl;
+      }
     }
-#  endif
     this->AllocateGPUCoefficients();
     this->Modified();
   }
@@ -175,9 +155,6 @@ template <typename TInputImage, typename TOutputImage>
 void
 GPUSmoothingRecursiveYvvGaussianImageFilter<TInputImage, TOutputImage>::SetInput(const TInputImage * input)
 {
-#  ifdef VERBOSE
-  std::cout << telltale << ".   GPUSmoothingRecursiveYvvGaussianImageFilter::SetInput \n";
-#  endif
   // ProcessObject is not const_correct so this const_cast is required
   ProcessObject::SetNthInput(0, const_cast<TInputImage *>(input));
 
@@ -199,27 +176,18 @@ GPUSmoothingRecursiveYvvGaussianImageFilter<TInputImage, TOutputImage>::SetInput
   }
 }
 
-// Set value of Sigma (isotropic)
 template <typename TInputImage, typename TOutputImage>
 void
 GPUSmoothingRecursiveYvvGaussianImageFilter<TInputImage, TOutputImage>::SetSigma(ScalarRealType sigma)
 {
-#  ifdef VERBOSE
-  std::cout << telltale << ". GPUSmoothing::SetSigma: " << sigma << " \n";
-#  endif
   SigmaArrayType sigmas(sigma);
   this->SetSigmaArray(sigmas);
 }
 
-// Set value of Sigma (an-isotropic)
-
 template <typename TInputImage, typename TOutputImage>
 void
 GPUSmoothingRecursiveYvvGaussianImageFilter<TInputImage, TOutputImage>::SetSigmaArray(const SigmaArrayType & sigma)
 {
-#  ifdef VERBOSE
-  std::cout << telltale << ". GPUSmoothing::SetSigmaArray" << m_Sigma << " vs new: " << sigma[0] << " \n";
-#  endif
   if (this->m_Sigma != sigma)
   {
     this->m_Sigma = sigma;
@@ -227,24 +195,16 @@ GPUSmoothingRecursiveYvvGaussianImageFilter<TInputImage, TOutputImage>::SetSigma
     const typename InputImageType::SpacingType & pixelSize = this->GetOutput()->GetSpacing();
     if (pixelSize[0] != 0)
     {
-#  ifdef VERBOSE
-      std::cout << telltale << ". GPUSmoothing::SetSigmaArray. pixelSize: [" << pixelSize[0] << "," << pixelSize[1]
-                << "," << pixelSize[2] << "] \n";
-#  endif
       this->SetUp(pixelSize[0]);
     }
     this->Modified();
   }
 }
 
-// Get the sigma array.
 template <typename TInputImage, typename TOutputImage>
 typename GPUSmoothingRecursiveYvvGaussianImageFilter<TInputImage, TOutputImage>::SigmaArrayType
 GPUSmoothingRecursiveYvvGaussianImageFilter<TInputImage, TOutputImage>::GetSigmaArray() const
 {
-  /*#ifdef VERBOSE
-          std::cout<< telltale << ". GPUSmoothing::GetSigmaArray \n";
-  #endif*/
   return m_Sigma;
 }
 
@@ -254,22 +214,13 @@ template <typename TInputImage, typename TOutputImage>
 typename GPUSmoothingRecursiveYvvGaussianImageFilter<TInputImage, TOutputImage>::ScalarRealType
 GPUSmoothingRecursiveYvvGaussianImageFilter<TInputImage, TOutputImage>::GetSigma() const
 {
-  /*#ifdef VERBOSE
-          std::cout<< telltale << ". GPUSmoothing::GetSigma \n";
-  #endif*/
   return m_Sigma[0];
 }
 
-/**
- * Set Normalize Across Scale Space
- */
 template <typename TInputImage, typename TOutputImage>
 void
 GPUSmoothingRecursiveYvvGaussianImageFilter<TInputImage, TOutputImage>::SetNormalizeAcrossScale(bool normalize)
 {
-  /*#ifdef VERBOSE
-          std::cout<< telltale << ". GPUSmoothing::SetNormalizeAcrossScale \n";
-  #endif*/
   m_NormalizeAcrossScale = normalize;
   this->Modified();
 }
@@ -279,9 +230,6 @@ void
 GPUSmoothingRecursiveYvvGaussianImageFilter<TInputImage, TOutputImage>::GenerateInputRequestedRegion() throw(
   InvalidRequestedRegionError)
 {
-#  ifdef VERBOSE
-  std::cout << telltale << ". GPUSmoothing::GenerateInputRequestedRegion \n";
-#  endif
   // call the superclass' implementation of this method. this should
   // copy the output requested region to the input requested region
   Superclass::GenerateInputRequestedRegion();
@@ -300,9 +248,6 @@ void
 GPUSmoothingRecursiveYvvGaussianImageFilter<TInputImage, TOutputImage>::EnlargeOutputRequestedRegion(
   DataObject * output)
 {
-#  ifdef VERBOSE
-  std::cout << telltale << ". GPUSmoothing::EnlargeOutputRequestedRegion \n";
-#  endif
   TOutputImage * out = dynamic_cast<TOutputImage *>(output);
 
   if (out)
@@ -315,10 +260,6 @@ template <typename TInputImage, typename TOutputImage>
 void
 GPUSmoothingRecursiveYvvGaussianImageFilter<TInputImage, TOutputImage>::AllocateGPUCoefficients()
 {
-#  ifdef VERBOSE
-  std::cout << telltale << ".   GPUSmoothingRecursiveYvvGaussianImageFilter::AllocateGPUInputBuffer \n";
-#  endif
-
   m_GPUBCoefficientsDataManager = GPUDataManager::New();
   m_GPUBCoefficientsDataManager->SetBufferSize(4 * sizeof(ScalarRealType));
   m_GPUBCoefficientsDataManager->SetCPUBufferPointer(m_Bvalues);
@@ -347,9 +288,6 @@ template <typename TInputImage, typename TOutputImage>
 void
 GPUSmoothingRecursiveYvvGaussianImageFilter<TInputImage, TOutputImage>::GPUGenerateData(void)
 {
-#  ifdef VERBOSE
-  std::cout << telltale << ".    GPUSmoothing::GPUGenerateData \n";
-#  endif
   if (m_FilterGPUKernelHandle == -1)
   {
     this->BuildKernel();
@@ -370,9 +308,6 @@ GPUSmoothingRecursiveYvvGaussianImageFilter<TInputImage, TOutputImage>::GPUGener
   for (int i = 0; i < ndim; ++i)
   {
     this->m_GPUKernelManager->SetKernelArg(m_FilterGPUKernelHandle, argidx++, sizeof(int), &(m_requestedSize[i]));
-#  ifdef VERBOSE
-    std::cout << telltale << ".Arg     " << argidx << ": " << m_requestedSize[i] << "\n";
-#  endif
   }
 
   const unsigned int dimArg = argidx;
@@ -382,17 +317,11 @@ GPUSmoothingRecursiveYvvGaussianImageFilter<TInputImage, TOutputImage>::GPUGener
     int globalSize1D = (m_requestedSize[1] > m_requestedSize[0] ? m_requestedSize[1] : m_requestedSize[0]);
 
     this->m_GPUKernelManager->SetKernelArg(m_FilterGPUKernelHandle, dimArg, sizeof(unsigned int), &(X));
-#  ifdef VERBOSE
-    std::cout << telltale << ". Calling 1D kernel on X.\n";
-#  endif
     this->m_GPUKernelManager->LaunchKernel1D(m_FilterGPUKernelHandle, globalSize1D, 16);
 
     // change ONLY input and direction of filter
     this->m_GPUKernelManager->SetKernelArgWithImage(m_FilterGPUKernelHandle, 0, otPtr->GetGPUDataManager());
     this->m_GPUKernelManager->SetKernelArg(m_FilterGPUKernelHandle, dimArg, sizeof(unsigned int), &(Y));
-#  ifdef VERBOSE
-    std::cout << telltale << ". Calling 1D kernel on Y.\n";
-#  endif
     this->m_GPUKernelManager->LaunchKernel1D(m_FilterGPUKernelHandle, globalSize1D, 16);
   }
   else
@@ -401,25 +330,16 @@ GPUSmoothingRecursiveYvvGaussianImageFilter<TInputImage, TOutputImage>::GPUGener
     //  dimension.
 
     this->m_GPUKernelManager->SetKernelArg(m_FilterGPUKernelHandle, argidx++, sizeof(unsigned int), &(X));
-#  ifdef VERBOSE
-    std::cout << telltale << ". Calling 2D kernel on X.\n";
-#  endif
     this->m_GPUKernelManager->LaunchKernel2D(m_FilterGPUKernelHandle, m_requestedSize[2], m_requestedSize[1], 16, 16);
 
     // change ONLY input and direction of filter
     this->m_GPUKernelManager->SetKernelArgWithImage(m_FilterGPUKernelHandle, 0, otPtr->GetGPUDataManager());
     this->m_GPUKernelManager->SetKernelArg(m_FilterGPUKernelHandle, dimArg, sizeof(unsigned int), &(Y));
-#  ifdef VERBOSE
-    std::cout << telltale << ". Calling 2D kernel on Y.\n";
-#  endif
     this->m_GPUKernelManager->LaunchKernel2D(m_FilterGPUKernelHandle, m_requestedSize[0], m_requestedSize[2], 16, 16);
 
     // input is already pointing to previous output; change ONLY direction of
     //  filter
     this->m_GPUKernelManager->SetKernelArg(m_FilterGPUKernelHandle, dimArg, sizeof(unsigned int), &(Z));
-#  ifdef VERBOSE
-    std::cout << telltale << ". Calling 2D kernel on Z.\n";
-#  endif
     this->m_GPUKernelManager->LaunchKernel2D(m_FilterGPUKernelHandle, m_requestedSize[0], m_requestedSize[1], 16, 16);
   }
 }
@@ -429,9 +349,6 @@ void
 GPUSmoothingRecursiveYvvGaussianImageFilter<TInputImage, TOutputImage>::PrintSelf(std::ostream & os,
                                                                                   Indent         indent) const
 {
-  /*#ifdef VERBOSE
-          std::cout<< telltale << ". GPUSmoothing::PrintSelf \n";
-  #endif*/
   Superclass::PrintSelf(os, indent);
 
   os << "NormalizeAcrossScale: " << m_NormalizeAcrossScale << std::endl;
diff --git a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkRecursiveLineYvvGaussianImageFilter.hxx b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkRecursiveLineYvvGaussianImageFilter.hxx
index de2e55712e3..d9eac973d29 100644
--- a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkRecursiveLineYvvGaussianImageFilter.hxx
+++ b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkRecursiveLineYvvGaussianImageFilter.hxx
@@ -25,8 +25,6 @@
 #include "itkImageLinearConstIteratorWithIndex.h"
 #include "itkProgressReporter.h"
 
-// #define VERBOSE
-
 namespace itk
 {
 template <typename TInputImage, typename TOutputImage>
@@ -39,31 +37,30 @@ RecursiveLineYvvGaussianImageFilter<TInputImage, TOutputImage>::RecursiveLineYvv
   this->InPlaceOff();
 
   m_ImageRegionSplitter = ImageRegionSplitterDirection::New();
-#ifdef VERBOSE
-  std::cout << "-----------Line filter TYPES\n";
 
-  if (typeid(typename TInputImage::PixelType) == typeid(double))
-  {
-    std::cout << "InputPixelType double\n";
-  }
-  if (typeid(typename TOutputImage::PixelType) == typeid(double))
+  if (this->GetDebug())
   {
-    std::cout << "OutputPixelType double\n";
-  }
+    std::cout << "-----------Line filter TYPES\n";
 
-  if (typeid(ScalarRealType) == typeid(double))
-  {
-    std::cout << "ScalarRealType double\n";
-  }
+    if (typeid(typename TInputImage::PixelType) == typeid(double))
+    {
+      std::cout << "InputPixelType double\n";
+    }
+    if (typeid(typename TOutputImage::PixelType) == typeid(double))
+    {
+      std::cout << "OutputPixelType double\n";
+    }
 
-  if (typeid(RealType) == typeid(double))
-  {
-    std::cout << "RealType double\n";
-  }
+    if (typeid(ScalarRealType) == typeid(double))
+    {
+      std::cout << "ScalarRealType double\n";
+    }
 
-  /*if( typeid ( InternalRealType ) == typeid ( double ))
-          std::cout<<"InternalRealType double\n"; */
-#endif
+    if (typeid(RealType) == typeid(double))
+    {
+      std::cout << "RealType double\n";
+    }
+  }
 }
 
 /**
@@ -73,36 +70,22 @@ template <typename TInputImage, typename TOutputImage>
 void
 RecursiveLineYvvGaussianImageFilter<TInputImage, TOutputImage>::SetInputImage(const TInputImage * input)
 {
-  /*#ifdef VERBOSE
-          std::cout<<telltale << ". itkRecursiveLineYvv::setInput \n";
-  #endif*/
   // ProcessObject is not const_correct so this const_cast is required
   ProcessObject::SetNthInput(0, const_cast<TInputImage *>(input));
 }
 
-/**
- * Get Input Image
- */
+
 template <typename TInputImage, typename TOutputImage>
 const TInputImage *
 RecursiveLineYvvGaussianImageFilter<TInputImage, TOutputImage>::GetInputImage(void)
 {
-  /*#ifdef VERBOSE
-          std::cout<<telltale << ". itkRecursiveLineYvv::getInput \n";
-  #endif*/
   return dynamic_cast<const TInputImage *>((ProcessObject::GetInput(0)));
 }
 
-/**
- *   Compute filter for Gaussian kernel.
- */
 template <typename TInputImage, typename TOutputImage>
 void
 RecursiveLineYvvGaussianImageFilter<TInputImage, TOutputImage>::SetUp(ScalarRealType spacing)
 {
-  /*#ifdef VERBOSE
-          std::cout<<telltale << ". itkRecursiveLineYvv::setUp\n";
-  #endif*/
   const ScalarRealType sigmad = m_Sigma / spacing;
 
   // Compute q according to 16 in Young et al on Gabor filering
@@ -153,25 +136,25 @@ RecursiveLineYvvGaussianImageFilter<TInputImage, TOutputImage>::SetUp(ScalarReal
 
   m_MMatrix /= (1 + m_B1 - m_B2 + m_B3) * (1 - m_B1 - m_B2 - m_B3) * (1 + m_B2 + (m_B1 - m_B3) * m_B3);
 
-#ifdef VERBOSE
-  std::cout << "cB   " << m_B << std::endl;
-  std::cout << "cB1  " << m_B1 << std::endl;
-  std::cout << "cB2  " << m_B2 << std::endl;
-  std::cout << "cB3  " << m_B3 << std::endl;
-
-  for (int i = 0; i < 3; ++i)
+  if (this->GetDebug())
   {
-    for (int j = 0; j < 3; ++j)
+    std::cout << "cB   " << m_B << std::endl;
+    std::cout << "cB1  " << m_B1 << std::endl;
+    std::cout << "cB2  " << m_B2 << std::endl;
+    std::cout << "cB3  " << m_B3 << std::endl;
+
+    for (int i = 0; i < 3; ++i)
     {
-      std::cout << "cM(" << i << "," << j << ")  " << m_MMatrix(i, j) << std::endl;
+      for (int j = 0; j < 3; ++j)
+      {
+        std::cout << "cM(" << i << "," << j << ")  " << m_MMatrix(i, j) << std::endl;
+      }
     }
   }
-#endif
 }
 
-/**
- * Apply Recursive Filter
- */
+
+// Apply Recursive Filter
 template <typename TInputImage, typename TOutputImage>
 void
 RecursiveLineYvvGaussianImageFilter<TInputImage, TOutputImage>::FilterDataArray(RealType *       outs,
@@ -179,9 +162,6 @@ RecursiveLineYvvGaussianImageFilter<TInputImage, TOutputImage>::FilterDataArray(
                                                                                 RealType *       scratch,
                                                                                 unsigned int     ln)
 {
-  // #ifdef VERBOSE
-  // std::cout<<telltale << ". itkRecursiveLineYvv::filterDataArray \n";
-  // #endif*/
   /**
    * Causal direction pass
    */
@@ -258,11 +238,6 @@ template <typename TInputImage, typename TOutputImage>
 void
 RecursiveLineYvvGaussianImageFilter<TInputImage, TOutputImage>::EnlargeOutputRequestedRegion(DataObject * output)
 {
-  /*
-  #ifdef VERBOSE
-          std::cout<<telltale  << ". itkRecursiveLineYvv::EnlargeOutputRequestedRegion \n";
-  #endif
-  */
   TOutputImage * out = dynamic_cast<TOutputImage *>(output);
 
   if (out)
@@ -288,11 +263,6 @@ template <typename TInputImage, typename TOutputImage>
 const ImageRegionSplitterBase *
 RecursiveLineYvvGaussianImageFilter<TInputImage, TOutputImage>::GetImageRegionSplitter(void) const
 {
-  /*
-  #ifdef VERBOSE
-          std::cout<<telltale  << ". itkRecursiveLineYvv::SplitRequestedRegion \n";
-  #endif
-  */
   return this->m_ImageRegionSplitter;
 }
 
@@ -300,11 +270,6 @@ template <typename TInputImage, typename TOutputImage>
 void
 RecursiveLineYvvGaussianImageFilter<TInputImage, TOutputImage>::BeforeThreadedGenerateData()
 {
-  /*
-  #ifdef VERBOSE
-          std::cout<<telltale  << ". itkRecursiveLineYvv::BeforeThreadedGenerateData \n";
-  #endif
-  */
   typedef ImageRegion<TInputImage::ImageDimension> RegionType;
 
   typename TInputImage::ConstPointer inputImage(this->GetInputImage());
@@ -345,11 +310,6 @@ RecursiveLineYvvGaussianImageFilter<TInputImage, TOutputImage>::ThreadedGenerate
   const OutputImageRegionType & outputRegionForThread,
   ThreadIdType                  threadId)
 {
-  /*
-  #ifdef VERBOSE
-          std::cout <<telltale  << ". itkRecursiveLineYvv::ThreadedGenerateData \n";
-  #endif
-  */
   typedef typename TOutputImage::PixelType OutputPixelType;
 
   typedef ImageLinearConstIteratorWithIndex<TInputImage> InputConstIteratorType;
@@ -465,9 +425,6 @@ template <typename TInputImage, typename TOutputImage>
 void
 RecursiveLineYvvGaussianImageFilter<TInputImage, TOutputImage>::PrintSelf(std::ostream & os, Indent indent) const
 {
-  /*#ifdef VERBOSE
-          std::cout<<telltale  << ". itkRecursiveLineYvv::PrintSelf \n";
-  #endif*/
   Superclass::PrintSelf(os, indent);
 
   os << indent << "Direction: " << m_Direction << std::endl;
diff --git a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkSmoothingRecursiveYvvGaussianImageFilter.h b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkSmoothingRecursiveYvvGaussianImageFilter.h
index 5bf0aa29be8..30fb3002229 100644
--- a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkSmoothingRecursiveYvvGaussianImageFilter.h
+++ b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkSmoothingRecursiveYvvGaussianImageFilter.h
@@ -113,27 +113,21 @@ class ITK_EXPORT SmoothingRecursiveYvvGaussianImageFilter : public InPlaceImageF
    axis. */
   void
   SetSigmaArray(const SigmaArrayType & sigmas);
-
   void
   SetSigma(ScalarRealType sigma);
-
   SigmaArrayType
   GetSigmaArray() const;
-
   ScalarRealType
   GetSigma() const;
 
   /** Define which normalization factor will be used for the Gaussian */
   void
   SetNormalizeAcrossScale(bool normalizeInScaleSpace);
-
   itkGetConstMacro(NormalizeAcrossScale, bool);
 
   void
   SetNumberOfThreads(ThreadIdType nb) override;
 
-  // See super class for doxygen documentation
-  //
   bool
   CanRunInPlace(void) const override;
 
@@ -174,7 +168,6 @@ class ITK_EXPORT SmoothingRecursiveYvvGaussianImageFilter : public InPlaceImageF
 
   /** Standard deviation of the gaussian used for smoothing */
   SigmaArrayType m_Sigma;
-  int            telltale; // TODO: REMOVE
 };
 } // end namespace itk
 
diff --git a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkSmoothingRecursiveYvvGaussianImageFilter.hxx b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkSmoothingRecursiveYvvGaussianImageFilter.hxx
index d74652de3f9..80ba993cde0 100644
--- a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkSmoothingRecursiveYvvGaussianImageFilter.hxx
+++ b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkSmoothingRecursiveYvvGaussianImageFilter.hxx
@@ -23,20 +23,11 @@
 #include "itkImageRegionIteratorWithIndex.h"
 #include "itkProgressAccumulator.h"
 
-// #define VERBOSE
-
 namespace itk
 {
-/**
- * Constructor
- */
 template <typename TInputImage, typename TOutputImage>
 SmoothingRecursiveYvvGaussianImageFilter<TInputImage, TOutputImage>::SmoothingRecursiveYvvGaussianImageFilter()
 {
-  /*#ifdef VERBOSE
-          telltale = rand();
-          std::cout<<telltale << ". itkSmoothingYvv::constructor \n";
-  #endif*/
   m_NormalizeAcrossScale = false;
 
   m_FirstSmoothingFilter = FirstGaussianFilterType::New();
@@ -73,43 +64,40 @@ SmoothingRecursiveYvvGaussianImageFilter<TInputImage, TOutputImage>::SmoothingRe
   this->m_Sigma.Fill(0.0);
   this->SetSigma(1.0);
 
-#ifdef VERBOSE
-  std::cout << "-----------Smoothing filter TYPES\n";
-
-  if (typeid(typename TInputImage::PixelType) == typeid(double))
-  {
-    std::cout << "PixelType double\n";
-  }
-  if (typeid(typename TOutputImage::PixelType) == typeid(double))
+  if (this->GetDebug())
   {
-    std::cout << "Output PixelType double\n";
-  }
+    std::cout << "-----------Smoothing filter TYPES\n";
 
-  if (typeid(ScalarRealType) == typeid(double))
-  {
-    std::cout << "ScalarRealType double\n";
-  }
+    if (typeid(typename TInputImage::PixelType) == typeid(double))
+    {
+      std::cout << "PixelType double\n";
+    }
+    if (typeid(typename TOutputImage::PixelType) == typeid(double))
+    {
+      std::cout << "Output PixelType double\n";
+    }
 
-  if (typeid(RealType) == typeid(double))
-  {
-    std::cout << "RealType double\n";
-  }
+    if (typeid(ScalarRealType) == typeid(double))
+    {
+      std::cout << "ScalarRealType double\n";
+    }
 
-  if (typeid(InternalRealType) == typeid(double))
-  {
-    std::cout << "InternalRealType double\n";
-  }
+    if (typeid(RealType) == typeid(double))
+    {
+      std::cout << "RealType double\n";
+    }
 
-#endif
+    if (typeid(InternalRealType) == typeid(double))
+    {
+      std::cout << "InternalRealType double\n";
+    }
+  }
 }
 
 template <typename TInputImage, typename TOutputImage>
 void
 SmoothingRecursiveYvvGaussianImageFilter<TInputImage, TOutputImage>::SetNumberOfThreads(ThreadIdType nb)
 {
-  /*#ifdef VERBOSE
-          std::cout<<telltale  << ". itkSmoothingYvv::SetNumberOfThreads \n";
-  #endif*/
   Superclass::SetNumberOfThreads(nb);
 
   for (unsigned int i = 0; i < ImageDimension - 1; i++)
@@ -140,29 +128,18 @@ SmoothingRecursiveYvvGaussianImageFilter<TInputImage, TOutputImage>::CanRunInPla
   return m_FirstSmoothingFilter->CanRunInPlace() || this->Superclass::CanRunInPlace();
 }
 
-// Set value of Sigma (isotropic)
-
 template <typename TInputImage, typename TOutputImage>
 void
 SmoothingRecursiveYvvGaussianImageFilter<TInputImage, TOutputImage>::SetSigma(ScalarRealType sigma)
 {
-  /*#ifdef VERBOSE
-          std::cout<<telltale  << ". itkSmoothingYvv::SetSigma \n";
-  #endif*/
   SigmaArrayType sigmas(sigma);
-
   this->SetSigmaArray(sigmas);
 }
 
-// Set value of Sigma (an-isotropic)
-
 template <typename TInputImage, typename TOutputImage>
 void
 SmoothingRecursiveYvvGaussianImageFilter<TInputImage, TOutputImage>::SetSigmaArray(const SigmaArrayType & sigma)
 {
-  /*#ifdef VERBOSE
-          std::cout<<telltale  << ". itkSmoothingYvv::SetSigmaArray \n";
-  #endif*/
   if (this->m_Sigma != sigma)
   {
     this->m_Sigma = sigma;
@@ -178,39 +155,24 @@ SmoothingRecursiveYvvGaussianImageFilter<TInputImage, TOutputImage>::SetSigmaArr
   }
 }
 
-// Get the sigma array.
 template <typename TInputImage, typename TOutputImage>
 typename SmoothingRecursiveYvvGaussianImageFilter<TInputImage, TOutputImage>::SigmaArrayType
 SmoothingRecursiveYvvGaussianImageFilter<TInputImage, TOutputImage>::GetSigmaArray() const
 {
-  /*#ifdef VERBOSE
-          std::cout<<telltale  << ". itkSmoothingYvv::GetSigmaArray \n";
-  #endif*/
   return m_Sigma;
 }
 
-// Get the sigma scalar. If the sigma is anisotropic, we will just
-// return the sigma along the first dimension.
 template <typename TInputImage, typename TOutputImage>
 typename SmoothingRecursiveYvvGaussianImageFilter<TInputImage, TOutputImage>::ScalarRealType
 SmoothingRecursiveYvvGaussianImageFilter<TInputImage, TOutputImage>::GetSigma() const
 {
-  /*#ifdef VERBOSE
-          std::cout<<telltale  << ". itkSmoothingYvv::GetSigma \n";
-  #endif*/
   return m_Sigma[0];
 }
 
-/**
- * Set Normalize Across Scale Space
- */
 template <typename TInputImage, typename TOutputImage>
 void
 SmoothingRecursiveYvvGaussianImageFilter<TInputImage, TOutputImage>::SetNormalizeAcrossScale(bool normalize)
 {
-  /*#ifdef VERBOSE
-          std::cout<<telltale  << ". itkSmoothingYvv::SetNormalizeAcrossScale \n";
-  #endif*/
   m_NormalizeAcrossScale = normalize;
 
   for (unsigned int i = 0; i < ImageDimension - 1; i++)
@@ -227,9 +189,6 @@ void
 SmoothingRecursiveYvvGaussianImageFilter<TInputImage, TOutputImage>::GenerateInputRequestedRegion() throw(
   InvalidRequestedRegionError)
 {
-  /*#ifdef VERBOSE
-          std::cout<<telltale  << ". itkSmoothingYvv::GenerateInputRequestedRegion \n";
-  #endif*/
   // call the superclass' implementation of this method. this should
   // copy the output requested region to the input requested region
   Superclass::GenerateInputRequestedRegion();
@@ -247,9 +206,6 @@ template <typename TInputImage, typename TOutputImage>
 void
 SmoothingRecursiveYvvGaussianImageFilter<TInputImage, TOutputImage>::EnlargeOutputRequestedRegion(DataObject * output)
 {
-  /*#ifdef VERBOSE
-          std::cout<<telltale  << ". itkSmoothingYvv::EnlargeOutputRequestedRegion \n";
-  #endif*/
   TOutputImage * out = dynamic_cast<TOutputImage *>(output);
 
   if (out)
@@ -258,16 +214,11 @@ SmoothingRecursiveYvvGaussianImageFilter<TInputImage, TOutputImage>::EnlargeOutp
   }
 }
 
-/**
- * Compute filter for Gaussian kernel
- */
+// Compute filter for Gaussian kernel
 template <typename TInputImage, typename TOutputImage>
 void
 SmoothingRecursiveYvvGaussianImageFilter<TInputImage, TOutputImage>::GenerateData(void)
 {
-  /*#ifdef VERBOSE
-          std::cout<<telltale  << ". itkSmoothingYvv::GenerateData \n";
-  #endif*/
   itkDebugMacro(<< "SmoothingRecursiveYvvGaussianImageFilter generating data ");
 
   const typename TInputImage::ConstPointer inputImage(this->GetInput());
@@ -332,9 +283,6 @@ template <typename TInputImage, typename TOutputImage>
 void
 SmoothingRecursiveYvvGaussianImageFilter<TInputImage, TOutputImage>::PrintSelf(std::ostream & os, Indent indent) const
 {
-  /*#ifdef VERBOSE
-          std::cout<<telltale  << ". itkSmoothingYvv::PrintSelf \n";
-  #endif*/
   Superclass::PrintSelf(os, indent);
 
   os << "NormalizeAcrossScale: " << m_NormalizeAcrossScale << std::endl;
diff --git a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/yvvFilter.hxx b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/yvvFilter.hxx
index 306d9f825c9..a738c664eba 100644
--- a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/yvvFilter.hxx
+++ b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/yvvFilter.hxx
@@ -36,9 +36,6 @@ writeImage(std::string filterLabel, ImageType * result)
   typedef itk::Image<unsigned char, ImageType::ImageDimension>   UnsignedCharImageType;
   typedef itk::CastImageFilter<ImageType, UnsignedCharImageType> CastFilterType;
   typedef itk::ImageFileWriter<UnsignedCharImageType>            WriterType;
-#ifdef VERBOSE
-  std::cout << "..........." << filterLabel << ": Preparing to write out filtered image.\n";
-#endif
 
   std::string outputFilename = filterLabel;
 
@@ -66,10 +63,6 @@ writeImage(std::string filterLabel, ImageType * result)
   {
     std::cerr << e << std::endl;
   }
-
-#ifdef VERBOSE
-  std::cout << "..........." << filterLabel << ": result written to " << outputFilename << "\n";
-#endif
 }
 
 
@@ -125,10 +118,6 @@ testCpuFilter(std::string &                                 filterLabel,
               std::string                                   parameters,
               itk::TimeProbesCollectorBase *                timeCollector)
 {
-#ifdef VERBOSE
-  std::cout << "-----------" << filterLabel << ": Starting tests.\n";
-#endif
-
   typedef typename FilterType::InputImageType InputImage;
   typename InputImage::Pointer                src;
   void *                                      imgPtr = &src;
@@ -160,9 +149,6 @@ testCpuFilter(std::string &                                 filterLabel,
   {
     src->Modified();
     filter->Modified();
-#ifdef VERBOSE
-    std::cout << "-----------" << filterLabel << ": Start.\n";
-#endif
 
     timeCollector->Start(filterLabel.c_str());
     filter->Update();
@@ -170,10 +156,6 @@ testCpuFilter(std::string &                                 filterLabel,
     timeCollector->Stop(filterLabel.c_str());
 
     writeImage<typename FilterType::InputImageType>(filterLabel + parameters, filter->GetOutput());
-
-#ifdef VERBOSE
-    std::cout << "-----------" << filterLabel << ": Stop.\n";
-#endif
   }
 
   src->DisconnectPipeline();
@@ -196,9 +178,6 @@ testGpuFilter(std::string &                                 filterLabel,
               itk::TimeProbesCollectorBase *                timeCollector,
               bool                                          measureWithSync)
 {
-#  ifdef VERBOSE
-  std::cout << "-----------" << filterLabel << ": Starting tests.\n";
-#  endif
   typedef typename FilterType::InputImageType InputImage;
 
   typename InputImage::Pointer src;
@@ -232,9 +211,6 @@ testGpuFilter(std::string &                                 filterLabel,
   {
     // src->Modified(); //No need, filter->Update forces call to GPUGenerateData()
     filter->Modified();
-#  ifdef VERBOSE
-    std::cout << "-----------" << filterLabel << ": Start run.\n";
-#  endif
     if (measureWithSync)
     {
       timeCollector->Start(filterLabel.c_str());
@@ -250,10 +226,6 @@ testGpuFilter(std::string &                                 filterLabel,
       filter->GetOutput()->UpdateBuffers();
     }
     writeImage<InputImage>(filterLabel + parameters, filter->GetOutput());
-
-#  ifdef VERBOSE
-    std::cout << "-----------" << filterLabel << ": Stop.\n";
-#  endif
   }
 
   src->DisconnectPipeline();

From 47bc5e748303f3390549044f0ceaaeabd5e75bda Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?D=C5=BEenan=20Zuki=C4=87?= <dzenan.zukic@kitware.com>
Date: Fri, 20 Jul 2018 17:20:31 -0400
Subject: [PATCH 35/65] ENH: adapting to new threading mechanism introduced by
 ITKv5

---
 .../include/itkRecursiveLineYvvGaussianImageFilter.hxx    | 8 ++++++++
 .../include/itkSmoothingRecursiveYvvGaussianImageFilter.h | 2 +-
 .../itkSmoothingRecursiveYvvGaussianImageFilter.hxx       | 8 ++++----
 3 files changed, 13 insertions(+), 5 deletions(-)

diff --git a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkRecursiveLineYvvGaussianImageFilter.hxx b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkRecursiveLineYvvGaussianImageFilter.hxx
index d9eac973d29..4101de6c405 100644
--- a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkRecursiveLineYvvGaussianImageFilter.hxx
+++ b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkRecursiveLineYvvGaussianImageFilter.hxx
@@ -35,6 +35,7 @@ RecursiveLineYvvGaussianImageFilter<TInputImage, TOutputImage>::RecursiveLineYvv
   this->SetNumberOfRequiredInputs(1);
 
   this->InPlaceOff();
+  this->DynamicMultiThreadingOff();
 
   m_ImageRegionSplitter = ImageRegionSplitterDirection::New();
 
@@ -330,6 +331,13 @@ RecursiveLineYvvGaussianImageFilter<TInputImage, TOutputImage>::ThreadedGenerate
 
   const unsigned int ln = region.GetSize()[this->m_Direction];
 
+  if (ln < 4)
+  {
+    itkExceptionMacro("The number of pixels along direction "
+                      << this->m_Direction << " in this work-unit image region is less than 4."
+                      << " Note: TBBMultiThreader can divide small regions into really small pieces.");
+  }
+
   RealType * inps = nullptr;
   RealType * outs = nullptr;
   RealType * scratch = nullptr;
diff --git a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkSmoothingRecursiveYvvGaussianImageFilter.h b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkSmoothingRecursiveYvvGaussianImageFilter.h
index 30fb3002229..06e6ddf0326 100644
--- a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkSmoothingRecursiveYvvGaussianImageFilter.h
+++ b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkSmoothingRecursiveYvvGaussianImageFilter.h
@@ -126,7 +126,7 @@ class ITK_EXPORT SmoothingRecursiveYvvGaussianImageFilter : public InPlaceImageF
   itkGetConstMacro(NormalizeAcrossScale, bool);
 
   void
-  SetNumberOfThreads(ThreadIdType nb) override;
+  SetNumberOfWorkUnits(ThreadIdType nb) override;
 
   bool
   CanRunInPlace(void) const override;
diff --git a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkSmoothingRecursiveYvvGaussianImageFilter.hxx b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkSmoothingRecursiveYvvGaussianImageFilter.hxx
index 80ba993cde0..f02fe0647ca 100644
--- a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkSmoothingRecursiveYvvGaussianImageFilter.hxx
+++ b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkSmoothingRecursiveYvvGaussianImageFilter.hxx
@@ -96,15 +96,15 @@ SmoothingRecursiveYvvGaussianImageFilter<TInputImage, TOutputImage>::SmoothingRe
 
 template <typename TInputImage, typename TOutputImage>
 void
-SmoothingRecursiveYvvGaussianImageFilter<TInputImage, TOutputImage>::SetNumberOfThreads(ThreadIdType nb)
+SmoothingRecursiveYvvGaussianImageFilter<TInputImage, TOutputImage>::SetNumberOfWorkUnits(ThreadIdType nb)
 {
-  Superclass::SetNumberOfThreads(nb);
+  Superclass::SetNumberOfWorkUnits(nb);
 
   for (unsigned int i = 0; i < ImageDimension - 1; i++)
   {
-    m_SmoothingFilters[i]->SetNumberOfThreads(nb);
+    m_SmoothingFilters[i]->SetNumberOfWorkUnits(nb);
   }
-  m_FirstSmoothingFilter->SetNumberOfThreads(nb);
+  m_FirstSmoothingFilter->SetNumberOfWorkUnits(nb);
 }
 
 template <typename TInputImage, typename TOutputImage>

From 886b6b224413ae8c72a060d7431883aea8a55fb9 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jon=20Haitz=20Legarreta=20Gorro=C3=B1o?=
 <jon.haitz.legarreta@gmail.com>
Date: Tue, 16 Oct 2018 22:39:29 -0400
Subject: [PATCH 36/65] COMP: Change the include file style.

Use double quotes to include ITKs/module's header files.
---
 .../include/itkRecursiveLineYvvGaussianImageFilter.h        | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkRecursiveLineYvvGaussianImageFilter.h b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkRecursiveLineYvvGaussianImageFilter.h
index d7a10814c01..dde8437f156 100644
--- a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkRecursiveLineYvvGaussianImageFilter.h
+++ b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkRecursiveLineYvvGaussianImageFilter.h
@@ -19,9 +19,9 @@
 #ifndef itkRecursiveLineYvvGaussianImageFilter_h
 #define itkRecursiveLineYvvGaussianImageFilter_h
 
-#include <itkInPlaceImageFilter.h>
-#include <itkNumericTraits.h>
-#include <itkImageRegionSplitterDirection.h>
+#include "itkInPlaceImageFilter.h"
+#include "itkNumericTraits.h"
+#include "itkImageRegionSplitterDirection.h"
 
 namespace itk
 {

From d8553e12c2fba9fed7d378adccddeab62f616466 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jon=20Haitz=20Legarreta=20Gorro=C3=B1o?=
 <jon.haitz.legarreta@gmail.com>
Date: Tue, 16 Oct 2018 21:16:56 -0400
Subject: [PATCH 37/65] ENH: Add CI.

- Add `*.yml` configuration files for CI.
- Make the `README` file be a reSTructured text format file to conform to
  the `ITKModuleTemplate` directions.
- Update the `README.rst` file to reflect the CI status.
- Remove the outdated installation instructions from the `README.rst`
  file.
- Refer to the `LICENSE` file in the `README.rst` *License* section.
- Modify the current `CTestConfig.cmake` file to make the build results
  be sent to the **Insight** project in **open.cdash.org**.
- Add the `setup.py` file for Python packaging.
- Modify the `CTestConfig.cmake` to take advantage of the module
  documentation in the `README.rst` file.
---
 .../itk-module.cmake                                | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/itk-module.cmake b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/itk-module.cmake
index ae10b7bc9d9..2daeba4cc84 100644
--- a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/itk-module.cmake
+++ b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/itk-module.cmake
@@ -1,7 +1,16 @@
-set(DOCUMENTATION "This module contains a collection of classes for performing
-recursive gaussian filtering (Young Van Vliet implementation).")
+# the top-level README is used for describing this module, just
+# re-used it for documentation here
+get_filename_component(MY_CURRENT_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH)
+file(READ "${MY_CURRENT_DIR}/README.rst" DOCUMENTATION)
 
+# itk_module() defines the module dependencies in
+# SmoothingRecursiveYvvGaussianFilter
+# The testing module in SmoothingRecursiveYvvGaussianFilter depends on
+# ITKTestKernel
+# By convention those modules outside of ITK are not prefixed with
+# ITK.
 
+# define the dependencies of the include module and the tests
 set(ModuleName "SmoothingRecursiveYvvGaussianFilter")
 if(ITK_USE_GPU)
     itk_module(${ModuleName}

From b2b939d23608d16c1ff8f459b8b0b974ba5c1ca0 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jon=20Haitz=20Legarreta=20Gorro=C3=B1o?=
 <jon.haitz.legarreta@gmail.com>
Date: Thu, 1 Nov 2018 21:21:45 -0400
Subject: [PATCH 38/65] STYLE: Prefer error checked std::sto[id] over ato[if].

The ato[if] functions do not provide mechanisms for distinguishing between
'0' and the error condion where the input can not be converted.

std::sto[id] provides exception handling and detects when an invalid
string attempts to be converted to an [integer|double].

ato[if]()
   Con: No error handling.
   Con: Handle neither hexadecimal nor octal.

The use of ato[if] in code can cause it to be subtly broken.
ato[if] makes two very big assumptions indeed:
   The string represents an integer/floating point value.
   The integer can fit into an int.

As stated in
http://review.source.kitware.com/#/c/23738/
---
 .../test/itkCPURecursiveYvvGaussianImageFilterTest.cxx    | 6 +++---
 .../test/itkGPURecursiveYvvGaussianImageFilterTest.cxx    | 6 +++---
 .../test/itkYvvBenchmark.cxx                              | 6 +++---
 .../test/itkYvvGpuCpuSimilarityTest.cxx                   | 6 +++---
 .../test/itkYvvWhiteImageTest.cxx                         | 8 ++++----
 5 files changed, 16 insertions(+), 16 deletions(-)

diff --git a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/itkCPURecursiveYvvGaussianImageFilterTest.cxx b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/itkCPURecursiveYvvGaussianImageFilterTest.cxx
index b3ff95dc05c..fbd49d475e3 100644
--- a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/itkCPURecursiveYvvGaussianImageFilterTest.cxx
+++ b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/itkCPURecursiveYvvGaussianImageFilterTest.cxx
@@ -37,9 +37,9 @@ itkCPURecursiveYvvGaussianImageFilterTest(int argc, char * argv[])
   }
 
   std::string  inputFilename(argv[1]);
-  unsigned int dim = atoi(argv[2]);
-  float        sigma = atof(argv[3]);
-  unsigned int ntests = atoi(argv[4]);
+  unsigned int dim = std::stoi(argv[2]);
+  float        sigma = std::stod(argv[3]);
+  unsigned int ntests = std::stoi(argv[4]);
 
   int                          res = EXIT_SUCCESS;
   itk::TimeProbesCollectorBase timeCollector;
diff --git a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/itkGPURecursiveYvvGaussianImageFilterTest.cxx b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/itkGPURecursiveYvvGaussianImageFilterTest.cxx
index 9f552dcc353..68b7044745b 100644
--- a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/itkGPURecursiveYvvGaussianImageFilterTest.cxx
+++ b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/itkGPURecursiveYvvGaussianImageFilterTest.cxx
@@ -49,9 +49,9 @@ itkGPURecursiveYvvGaussianImageFilterTest(int argc, char * argv[])
   }
 
   std::string  inputFilename(argv[1]);
-  unsigned int dim = atoi(argv[2]);
-  float        sigma = atof(argv[3]);
-  unsigned int ntests = atoi(argv[4]);
+  unsigned int dim = std::stoi(argv[2]);
+  float        sigma = std::stod(argv[3]);
+  unsigned int ntests = std::stoi(argv[4]);
 
 
   int                          res = EXIT_SUCCESS;
diff --git a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/itkYvvBenchmark.cxx b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/itkYvvBenchmark.cxx
index 298fcdb3acc..87334545a82 100644
--- a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/itkYvvBenchmark.cxx
+++ b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/itkYvvBenchmark.cxx
@@ -49,9 +49,9 @@ itkYvvBenchmark(int argc, char * argv[])
   }
 
   std::string  inputFilename(argv[1]);
-  unsigned int dim = atoi(argv[2]);
-  float        sigma = atof(argv[3]);
-  unsigned int ntests = atoi(argv[4]);
+  unsigned int dim = std::stoi(argv[2]);
+  float        sigma = std::stod(argv[3]);
+  unsigned int ntests = std::stoi(argv[4]);
 
 
   int                          res = EXIT_SUCCESS;
diff --git a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/itkYvvGpuCpuSimilarityTest.cxx b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/itkYvvGpuCpuSimilarityTest.cxx
index 2d3ad5a845a..1ace29d8209 100644
--- a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/itkYvvGpuCpuSimilarityTest.cxx
+++ b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/itkYvvGpuCpuSimilarityTest.cxx
@@ -213,12 +213,12 @@ itkYvvGpuCpuSimilarityTest(int argc, char * argv[])
   }
 
   std::string  inputFilename(argv[1]);
-  unsigned int dim = atoi(argv[2]);
+  unsigned int dim = std::stoi(argv[2]);
 
   float sigma = 0.5;
-  if (argc > 3 && atoi(argv[3]) >= 0.5)
+  if (argc > 3 && std::stoi(argv[3]) >= 0.5)
   {
-    sigma = atof(argv[3]);
+    sigma = std::stod(argv[3]);
   }
 
   if (dim == 2)
diff --git a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/itkYvvWhiteImageTest.cxx b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/itkYvvWhiteImageTest.cxx
index f3f75ec2a5d..df2ba1f8aa8 100644
--- a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/itkYvvWhiteImageTest.cxx
+++ b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/itkYvvWhiteImageTest.cxx
@@ -51,7 +51,7 @@ itkYvvWhiteImageTest(int argc, char * argv[])
     die("missing arguments.");
   }
 
-  int dim = atoi(argv[1]);
+  int dim = std::stoi(argv[1]);
   if (argc < 4 + dim - 1)
   {
     die("missing arguments.");
@@ -66,11 +66,11 @@ itkYvvWhiteImageTest(int argc, char * argv[])
   float          sigma;
   try
   {
-    sigma = atof(argv[2]);
-    ntests = atoi(argv[3]);
+    sigma = std::stod(argv[2]);
+    ntests = std::stoi(argv[3]);
     for (int i = 0; i < dim; ++i)
     {
-      size[i] = atoi(argv[4 + i]);
+      size[i] = std::stoi(argv[4 + i]);
     }
   }
   catch (...)

From 5df34638961091cd4ec057822a178e9535ec09a3 Mon Sep 17 00:00:00 2001
From: Hans Johnson <hans-johnson@uiowa.edu>
Date: Sat, 3 Nov 2018 10:54:58 -0500
Subject: [PATCH 39/65] COMP: Future proof vnl_math_XXX function usage.

Prefer C++ over aliased names vnl_math_[min|max] -> std::[min|max]
Prefer vnl_math::abs over deprecated alias vnl_math_abs

In all compilers currently supported by VXL, vnl_math_[min|max]
could be replaced with std::[min|max] without loss of
functionality.  This also circumvents part of the backwards
compatibility requirements as vnl_math_ has been recently
replaced with a namespace of vnl_math::.

Since Wed Nov 14 07:42:48 2012:
The vnl_math_* functions use #define aliases to their
vnl_math::* counterparts in the "real" vnl_math:: namespace.

The new syntax should be backwards compatible to
VXL versions as old as 2012.

Prefer to use itk::Math:: over vnl_math:: namespace
---
 .../test/itkYvvGpuCpuSimilarityTest.cxx                         | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/itkYvvGpuCpuSimilarityTest.cxx b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/itkYvvGpuCpuSimilarityTest.cxx
index 1ace29d8209..f8f84557e8f 100644
--- a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/itkYvvGpuCpuSimilarityTest.cxx
+++ b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/itkYvvGpuCpuSimilarityTest.cxx
@@ -170,7 +170,7 @@ runYvvGpuCpuSimilarityTest(const std::string & inFile, float mySigma)
       double NormRMSError = sqrt(diff / (double)nPix) / (maxPx - minPx); //
       std::cout << "Normalised RMS Error with sigma = " << sigma << " : " << NormRMSError << std::endl;
 
-      if (vnl_math_isnan(NormRMSError))
+      if (std::isnan(NormRMSError))
       {
         std::cout << "Normalised RMS Error with sigma = " << sigma << " is NaN! nPix: " << nPix << std::endl;
         return EXIT_FAILURE;

From 5028a47c89213114494095e3b505e1b1a277c3fa Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jon=20Haitz=20Legarreta=20Gorro=C3=B1o?=
 <jon.haitz.legarreta@gmail.com>
Date: Mon, 26 Nov 2018 09:39:49 -0500
Subject: [PATCH 40/65] BUG: Fix test errors.

Fix `yvvFilter.hxx` file redeclaration errors:
```
/ITKSmoothingRecursiveYvvGaussianFilter/test/yvvFilter.hxx: In function
'int testCpuFilter(std::__cxx11::string&, std::__cxx11::string&, typename
FilterType::InputImageType::SizeType, float, std::__cxx11::string,
itk::TimeProbesCollectorBase*)':
/ITKSmoothingRecursiveYvvGaussianFilter/test/yvvFilter.hxx:118:32: error:
redeclaration of 'typename FilterType::InputImageType::Pointer src'
   typename InputImage::Pointer src;
```

And issues derived from bad function body definition issues.
---
 .../test/yvvFilter.hxx                        | 65 ++++++++++---------
 1 file changed, 33 insertions(+), 32 deletions(-)

diff --git a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/yvvFilter.hxx b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/yvvFilter.hxx
index 76024c6a008..abf5396e462 100644
--- a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/yvvFilter.hxx
+++ b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/yvvFilter.hxx
@@ -118,50 +118,51 @@ testCpuFilter(std::string &                                 filterLabel,
               std::string                                   parameters,
               itk::TimeProbesCollectorBase *                timeCollector)
 {
-  typedef typename FilterType::InputImageType InputImage;
-  typename InputImage::Pointer                src;
-  void *                                      imgPtr = &src;
-
   using InputImage = typename FilterType::InputImageType;
   typename InputImage::Pointer src;
   void *                       imgPtr = &src;
 
-  std::ostringstream sizeStream;
+  if (inputFilename.empty())
+  {
+    createWhiteImage<InputImage>(imgPtr, size);
+    // createStepImage< InputImage >( imgPtr, size );
+
+    std::ostringstream sizeStream;
 
-  sizeStream << size[0];
-  for (unsigned int i = 1; i < InputImage::ImageDimension; ++i)
+    sizeStream << size[0];
+    for (unsigned int i = 1; i < InputImage::ImageDimension; ++i)
+    {
+      sizeStream << "x" << size[i];
+    }
+    parameters += sizeStream.str();
+  }
+  else
   {
-    sizeStream << "x" << size[i];
+    getSourceImage<InputImage>(imgPtr, inputFilename);
   }
-  parameters += sizeStream.str();
-}
-else
-{
-  getSourceImage<InputImage>(imgPtr, inputFilename);
-}
 
-typename FilterType::Pointer filter = FilterType::New();
-filter->SetSigma(sigma);
-filter->SetInput(src);
-filter->Update();
+  typename FilterType::Pointer filter = FilterType::New();
+  filter->SetSigma(sigma);
+  filter->SetInput(src);
+  filter->Update();
 
-{
-  src->Modified();
-  filter->Modified();
+  {
+    src->Modified();
+    filter->Modified();
 
-  timeCollector->Start(filterLabel.c_str());
-  filter->Update();
-  filter->GetOutput();
-  timeCollector->Stop(filterLabel.c_str());
+    timeCollector->Start(filterLabel.c_str());
+    filter->Update();
+    filter->GetOutput();
+    timeCollector->Stop(filterLabel.c_str());
 
-  writeImage<typename FilterType::InputImageType>(filterLabel + parameters, filter->GetOutput());
-}
+    writeImage<typename FilterType::InputImageType>(filterLabel + parameters, filter->GetOutput());
+  }
 
-src->DisconnectPipeline();
-src = nullptr;
-filter = nullptr;
-imgPtr = nullptr;
-return EXIT_SUCCESS;
+  src->DisconnectPipeline();
+  src = nullptr;
+  filter = nullptr;
+  imgPtr = nullptr;
+  return EXIT_SUCCESS;
 }
 
 

From 43aa1f842cc99411279ae71fcf9af2f4d7e2e9dd Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jon=20Haitz=20Legarreta=20Gorro=C3=B1o?=
 <jon.haitz.legarreta@gmail.com>
Date: Mon, 26 Nov 2018 08:45:49 -0500
Subject: [PATCH 41/65] STYLE: Conform to modern CMake coding style.

Conform to modern CMake coding style:
- Use lowercase for commands consistently.
- Use 2 white space indentation consistently.
- Remove white spaces before/after brackets in flow control commands.
---
 .../src/CMakeLists.txt                        | 35 ++++++++-----------
 1 file changed, 15 insertions(+), 20 deletions(-)

diff --git a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/src/CMakeLists.txt b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/src/CMakeLists.txt
index 4a4915088d1..da1bd2700f9 100644
--- a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/src/CMakeLists.txt
+++ b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/src/CMakeLists.txt
@@ -1,28 +1,23 @@
-if (ITK_USE_GPU)
+if(ITK_USE_GPU)
+  if(GPU_HANDLES_DOUBLE)
+    add_definitions(-DWITH_DOUBLE)
+  endif()
 
-   if(GPU_HANDLES_DOUBLE)
-       add_definitions(-DWITH_DOUBLE)
-   endif()
+  set(GPU_SRC)
 
-    set(GPU_SRC
-    )
+  set(GPU_Kernels GPUSmoothingRecursiveYvvGaussianImageFilter.cl)
 
-    set(GPU_Kernels
-    GPUSmoothingRecursiveYvvGaussianImageFilter.cl
-    )
+  #essentially a #define GPU.
+  add_definitions(-DGPU)
 
-    #essentially a #define GPU.
-    add_definitions(-DGPU)
+  if(NVIDIA_GPU)
+    add_definitions(-DNVIDIA)
+  endif()
 
-    if(NVIDIA_GPU)
-        add_definitions(-DNVIDIA)
-    endif()
+  write_gpu_kernels("${GPU_Kernels}" GPU_SRC)
 
-    write_gpu_kernels("${GPU_Kernels}" GPU_SRC)
-
-    add_library(${itk-module} ${GPU_SRC})
-    target_link_libraries(${itk-module} ${INRIA_ITK_LIBRARIES} ${OPENCL_LIBRARIES} )
-
-    itk_module_target(${itk-module})
+  add_library(${itk-module} ${GPU_SRC})
+  target_link_libraries(${itk-module} ${INRIA_ITK_LIBRARIES} ${OPENCL_LIBRARIES})
 
+  itk_module_target(${itk-module})
 endif()

From cc87088fda3ee3fd17269ab25bbeea2f021e6653 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jon=20Haitz=20Legarreta=20Gorro=C3=B1o?=
 <jon.haitz.legarreta@gmail.com>
Date: Sun, 23 Dec 2018 19:16:05 -0500
Subject: [PATCH 42/65] STYLE: Make the test arguments be grouped compactly.

Make the test arguments be grouped compactly: improve readability and
reduces unnecessary vertical scroll.
---
 .../SmoothingRecursiveYvvGaussianFilter/test/CMakeLists.txt     | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/CMakeLists.txt b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/CMakeLists.txt
index 6babf2b3425..9fdab8d9c3b 100644
--- a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/CMakeLists.txt
+++ b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/CMakeLists.txt
@@ -106,7 +106,7 @@ if(ITK_USE_GPU)
       itkGPURecursiveYvvGaussianImageFilterTest
       ${TEST_DATA_ROOT}/512ex.jpg
       2
-      0.5 #Lower limit for sigma
+      0.5
       1
   )
 

From ee5638597db435551e204286e7595d03ca2e6d43 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jon=20Haitz=20Legarreta=20Gorro=C3=B1o?=
 <jon.haitz.legarreta@gmail.com>
Date: Sun, 23 Dec 2018 19:12:15 -0500
Subject: [PATCH 43/65] ENH: Cast the binary data to the testing framework.

Cast the binary data to the testing framework: move the testing input
images to a `test/Input` folder and change the `CMakeLists.txt` file
accordingly.
---
 .../test/CMakeLists.txt                         |  13 ++++++-------
 .../test/Input/512ex.jpg                        | Bin 0 -> 33782 bytes
 2 files changed, 6 insertions(+), 7 deletions(-)
 create mode 100644 Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/Input/512ex.jpg

diff --git a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/CMakeLists.txt b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/CMakeLists.txt
index 9fdab8d9c3b..6024dc46ba4 100644
--- a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/CMakeLists.txt
+++ b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/CMakeLists.txt
@@ -37,7 +37,6 @@ endif()
 #set(ITK_TEST_DRIVER itkTestDriver)
 
 createtestdriver(${itk-module} "${${itk-module}-Test_LIBRARIES}" "${${itk-module}Tests}")
-set(TEST_DATA_ROOT "${${itk-module}_SOURCE_DIR}/Data")
 
 #Common tests for CPU and/or GPU
 itk_add_test(
@@ -45,7 +44,7 @@ itk_add_test(
   COMMAND
     ${itk-module}TestDriver
     itkCPURecursiveYvvGaussianImageFilterTest
-    ${TEST_DATA_ROOT}/512ex.jpg
+    DATA{Input/512ex.jpg}
     2
     12.0
     4
@@ -56,7 +55,7 @@ itk_add_test(
   COMMAND
     ${itk-module}TestDriver
     itkYvvBenchmark
-    ${TEST_DATA_ROOT}/512ex.jpg
+    DATA{Input/512ex.jpg}
     2
     12.0
     4
@@ -67,7 +66,7 @@ itk_add_test(
   COMMAND
     ${itk-module}TestDriver
     itkYvvBenchmark
-    ${TEST_DATA_ROOT}/256x256x64.tif
+    DATA{Input/256x256x64.tif}
     3
     12.0
     2
@@ -104,7 +103,7 @@ if(ITK_USE_GPU)
     COMMAND
       ${itk-module}TestDriver
       itkGPURecursiveYvvGaussianImageFilterTest
-      ${TEST_DATA_ROOT}/512ex.jpg
+      DATA{Input/512ex.jpg}
       2
       0.5
       1
@@ -115,7 +114,7 @@ if(ITK_USE_GPU)
     COMMAND
       ${itk-module}TestDriver
       itkGPURecursiveYvvGaussianImageFilterTest
-      ${TEST_DATA_ROOT}/512ex.jpg
+      DATA{Input/512ex.jpg}
       2
       20
       1
@@ -126,7 +125,7 @@ if(ITK_USE_GPU)
     COMMAND
       ${itk-module}TestDriver
       itkYvvGpuCpuSimilarityTest
-      ${TEST_DATA_ROOT}/512ex.jpg
+      DATA{Input/512ex.jpg}
       2
       14
   )
diff --git a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/Input/512ex.jpg b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/Input/512ex.jpg
new file mode 100644
index 0000000000000000000000000000000000000000..b41adabfcd624c09a50c466e3bc32787850dafc9
GIT binary patch

From e9aec33b00604b3db057eb48efdc1ed5b52a1bd0 Mon Sep 17 00:00:00 2001
From: Hans Johnson <hans-johnson@uiowa.edu>
Date: Thu, 20 Feb 2020 08:27:02 -0600
Subject: [PATCH 44/65] ENH: Add .gitattributes to allow running ITK
 clang-formatting scripts

```
git filter-branch -f \
--tree-filter "~/ITK/Utilities/Maintenance/clang-format.bash --clang-format ~/Dashboard/src/ITK-clang11/clang-format-Linux --tracked" \
    master..
```
---
 .../include/itkGPUSmoothingRecursiveYvvGaussianImageFilter.h  | 2 +-
 .../itkGPUSmoothingRecursiveYvvGaussianImageFilter.hxx        | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkGPUSmoothingRecursiveYvvGaussianImageFilter.h b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkGPUSmoothingRecursiveYvvGaussianImageFilter.h
index 112ec7126fe..ba4baea2f74 100644
--- a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkGPUSmoothingRecursiveYvvGaussianImageFilter.h
+++ b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkGPUSmoothingRecursiveYvvGaussianImageFilter.h
@@ -60,7 +60,7 @@ class ITK_EXPORT GPUSmoothingRecursiveYvvGaussianImageFilter
   /** Standard class type alias. */
   using Self = GPUSmoothingRecursiveYvvGaussianImageFilter;
   // typedef SmoothingRecursiveYvvGaussianImageFilter<TInputImage,TOutputImage>
-  //    CPUSuperclass;
+  //   CPUSuperclass;
   using Superclass = GPUImageToImageFilter<TInputImage,
                                            TOutputImage,
                                            SmoothingRecursiveYvvGaussianImageFilter<TInputImage, TOutputImage>>;
diff --git a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkGPUSmoothingRecursiveYvvGaussianImageFilter.hxx b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkGPUSmoothingRecursiveYvvGaussianImageFilter.hxx
index a40c85c4866..483d57408fb 100644
--- a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkGPUSmoothingRecursiveYvvGaussianImageFilter.hxx
+++ b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkGPUSmoothingRecursiveYvvGaussianImageFilter.hxx
@@ -327,7 +327,7 @@ GPUSmoothingRecursiveYvvGaussianImageFilter<TInputImage, TOutputImage>::GPUGener
   else
   {
     // We must optimize our 2D workgroup sizes to go over our 3D volume in each
-    //  dimension.
+    // dimension.
 
     this->m_GPUKernelManager->SetKernelArg(m_FilterGPUKernelHandle, argidx++, sizeof(unsigned int), &(X));
     this->m_GPUKernelManager->LaunchKernel2D(m_FilterGPUKernelHandle, m_requestedSize[2], m_requestedSize[1], 16, 16);
@@ -338,7 +338,7 @@ GPUSmoothingRecursiveYvvGaussianImageFilter<TInputImage, TOutputImage>::GPUGener
     this->m_GPUKernelManager->LaunchKernel2D(m_FilterGPUKernelHandle, m_requestedSize[0], m_requestedSize[2], 16, 16);
 
     // input is already pointing to previous output; change ONLY direction of
-    //  filter
+    // filter
     this->m_GPUKernelManager->SetKernelArg(m_FilterGPUKernelHandle, dimArg, sizeof(unsigned int), &(Z));
     this->m_GPUKernelManager->LaunchKernel2D(m_FilterGPUKernelHandle, m_requestedSize[0], m_requestedSize[1], 16, 16);
   }

From 18e8028f1e048bf8a5a9eda58c8282c4d9cc979b Mon Sep 17 00:00:00 2001
From: Hans Johnson <hans-johnson@uiowa.edu>
Date: Sun, 16 Feb 2020 10:13:49 -0600
Subject: [PATCH 45/65] STYLE: Remove CMake-language block-end command
 arguments

Ancient versions of CMake required else(), endif(), and similar block
termination commands to have arguments matching the command starting the block.
This is no longer the preferred style.
---
 .../SmoothingRecursiveYvvGaussianFilter/itk-module.cmake        | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/itk-module.cmake b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/itk-module.cmake
index 2daeba4cc84..420f325fe19 100644
--- a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/itk-module.cmake
+++ b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/itk-module.cmake
@@ -24,6 +24,7 @@ if(ITK_USE_GPU)
      TEST_DEPENDS
         ITKTestKernel #to handle IO in src
         ITKGPUCommon
+        ITKSmoothing
      EXCLUDE_FROM_DEFAULT
      DESCRIPTION
          "${DOCUMENTATION}"
@@ -37,6 +38,7 @@ else()
         ITKSmoothing
      TEST_DEPENDS
         ITKTestKernel #to handle IO in src
+        ITKSmoothing
      EXCLUDE_FROM_DEFAULT
      DESCRIPTION
          "${DOCUMENTATION}"

From 9e44ed26fc901edacc11fbd292c45a14f003400f Mon Sep 17 00:00:00 2001
From: Hans Johnson <hans-johnson@uiowa.edu>
Date: Mon, 17 Feb 2020 13:52:08 -0600
Subject: [PATCH 46/65] COMP: Use nullptr instead of 0 or NULL

The check converts the usage of null pointer constants (eg. NULL, 0) to
use the new C++11 nullptr keyword.

SRCDIR= #My local SRC
BLDDIR= #My local BLD

cd
run-clang-tidy.py -extra-arg=-D__clang__ -checks=-*,modernize-use-nullptr  -header-filter=.* -fix
---
 .../SmoothingRecursiveYvvGaussianFilter/test/yvvFilter.hxx  | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/yvvFilter.hxx b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/yvvFilter.hxx
index abf5396e462..15edcf69265 100644
--- a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/yvvFilter.hxx
+++ b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/yvvFilter.hxx
@@ -229,9 +229,9 @@ testGpuFilter(std::string &                                 filterLabel,
   }
 
   src->DisconnectPipeline();
-  src = 0;
-  filter = 0;
-  imgPtr = 0;
+  src = nullptr;
+  filter = nullptr;
+  imgPtr = nullptr;
   return EXIT_SUCCESS;
 }
 

From 95fe028c0e05f566bbf4d20e47e8994eb0387c7e Mon Sep 17 00:00:00 2001
From: Hans Johnson <hans-johnson@uiowa.edu>
Date: Mon, 17 Feb 2020 14:01:49 -0600
Subject: [PATCH 47/65] STYLE: Use override statements for C++11

Describe function overrides using the override
keyword from C++11.

SRCDIR= #My local SRC
BLDDIR= #My local BLD

cd
run-clang-tidy.py -extra-arg=-D__clang__ -checks=-*,modernize-use-override  -header-filter=.* -fix
---
 ...tkGPUSmoothingRecursiveYvvGaussianImageFilter.h | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkGPUSmoothingRecursiveYvvGaussianImageFilter.h b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkGPUSmoothingRecursiveYvvGaussianImageFilter.h
index ba4baea2f74..cf1345fab13 100644
--- a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkGPUSmoothingRecursiveYvvGaussianImageFilter.h
+++ b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkGPUSmoothingRecursiveYvvGaussianImageFilter.h
@@ -140,30 +140,30 @@ class ITK_EXPORT GPUSmoothingRecursiveYvvGaussianImageFilter
   /** Get OpenCL Kernel source as a string, creates a GetOpenCLSource method */
   itkGetOpenCLSourceFromKernelMacro(GPUSmoothingRecursiveYvvGaussianImageFilterKernel);
   void
-  SetInput(const TInputImage * input);
+  SetInput(const TInputImage * input) override;
   using Superclass::SetInput;
 
 protected:
   GPUSmoothingRecursiveYvvGaussianImageFilter();
-  virtual ~GPUSmoothingRecursiveYvvGaussianImageFilter() {}
+  ~GPUSmoothingRecursiveYvvGaussianImageFilter() override {}
   void
-  PrintSelf(std::ostream & os, Indent indent) const;
+  PrintSelf(std::ostream & os, Indent indent) const override;
 
   /** Generate Data */
   void
-  GPUGenerateData(void);
+  GPUGenerateData(void) override;
 
   /** GPUSmoothingRecursiveYvvGaussianImageFilter needs all of the input to produce an
    * output. Therefore, GPUSmoothingRecursiveYvvGaussianImageFilter needs to provide
    * an implementation for GenerateInputRequestedRegion in order to inform
    * the pipeline execution model.
    * \sa ImageToImageFilter::GenerateInputRequestedRegion() */
-  virtual void
-  GenerateInputRequestedRegion() throw(InvalidRequestedRegionError);
+  void
+  GenerateInputRequestedRegion() throw(InvalidRequestedRegionError) override;
 
   // Override since the filter produces the entire dataset
   void
-  EnlargeOutputRequestedRegion(DataObject * output);
+  EnlargeOutputRequestedRegion(DataObject * output) override;
 
   void
   AllocateGPUCoefficients();

From 1b4629ee87d0c85a0c99d1b951689f6f2e750f6c Mon Sep 17 00:00:00 2001
From: Hans Johnson <hans-johnson@uiowa.edu>
Date: Mon, 17 Feb 2020 14:29:59 -0600
Subject: [PATCH 48/65] STYLE: Prefer = default to explicitly trivial
 implementations

This check replaces default bodies of special member functions with
= default;. The explicitly defaulted function declarations enable more
opportunities in optimization, because the compiler might treat
explicitly defaulted functions as trivial.

Additionally, the C++11 use of = default more clearly expreses the
intent for the special member functions.
---
 .../include/itkGPUSmoothingRecursiveYvvGaussianImageFilter.h    | 2 +-
 .../include/itkRecursiveLineYvvGaussianImageFilter.h            | 2 +-
 .../include/itkSmoothingRecursiveYvvGaussianImageFilter.h       | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkGPUSmoothingRecursiveYvvGaussianImageFilter.h b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkGPUSmoothingRecursiveYvvGaussianImageFilter.h
index cf1345fab13..9df42ca5d4b 100644
--- a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkGPUSmoothingRecursiveYvvGaussianImageFilter.h
+++ b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkGPUSmoothingRecursiveYvvGaussianImageFilter.h
@@ -145,7 +145,7 @@ class ITK_EXPORT GPUSmoothingRecursiveYvvGaussianImageFilter
 
 protected:
   GPUSmoothingRecursiveYvvGaussianImageFilter();
-  ~GPUSmoothingRecursiveYvvGaussianImageFilter() override {}
+  ~GPUSmoothingRecursiveYvvGaussianImageFilter() override = default;
   void
   PrintSelf(std::ostream & os, Indent indent) const override;
 
diff --git a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkRecursiveLineYvvGaussianImageFilter.h b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkRecursiveLineYvvGaussianImageFilter.h
index 4d6187c20cf..5684d0183eb 100644
--- a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkRecursiveLineYvvGaussianImageFilter.h
+++ b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkRecursiveLineYvvGaussianImageFilter.h
@@ -124,7 +124,7 @@ class ITK_EXPORT RecursiveLineYvvGaussianImageFilter : public InPlaceImageFilter
 
 protected:
   RecursiveLineYvvGaussianImageFilter();
-  ~RecursiveLineYvvGaussianImageFilter() override {}
+  ~RecursiveLineYvvGaussianImageFilter() override = default;
   void
   PrintSelf(std::ostream & os, Indent indent) const override;
 
diff --git a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkSmoothingRecursiveYvvGaussianImageFilter.h b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkSmoothingRecursiveYvvGaussianImageFilter.h
index 78fc797f1b2..3f8f4b485b7 100644
--- a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkSmoothingRecursiveYvvGaussianImageFilter.h
+++ b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkSmoothingRecursiveYvvGaussianImageFilter.h
@@ -138,7 +138,7 @@ class ITK_EXPORT SmoothingRecursiveYvvGaussianImageFilter : public InPlaceImageF
 #endif
 protected:
   SmoothingRecursiveYvvGaussianImageFilter();
-  ~SmoothingRecursiveYvvGaussianImageFilter() override {}
+  ~SmoothingRecursiveYvvGaussianImageFilter() override = default;
   void
   PrintSelf(std::ostream & os, Indent indent) const override;
 

From 903c312ddf4e4533aba824e18021ddee20a555cf Mon Sep 17 00:00:00 2001
From: Hans Johnson <hans-johnson@uiowa.edu>
Date: Mon, 17 Feb 2020 14:48:34 -0600
Subject: [PATCH 49/65] STYLE: Remove redundant void argument lists

Find and remove redundant void argument lists.
---
 .../include/itkGPUSmoothingRecursiveYvvGaussianImageFilter.h  | 2 +-
 .../itkGPUSmoothingRecursiveYvvGaussianImageFilter.hxx        | 2 +-
 .../include/itkRecursiveLineYvvGaussianImageFilter.h          | 4 ++--
 .../include/itkRecursiveLineYvvGaussianImageFilter.hxx        | 4 ++--
 .../include/itkSmoothingRecursiveYvvGaussianImageFilter.h     | 4 ++--
 .../include/itkSmoothingRecursiveYvvGaussianImageFilter.hxx   | 4 ++--
 6 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkGPUSmoothingRecursiveYvvGaussianImageFilter.h b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkGPUSmoothingRecursiveYvvGaussianImageFilter.h
index 9df42ca5d4b..cd2c3a6c5f9 100644
--- a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkGPUSmoothingRecursiveYvvGaussianImageFilter.h
+++ b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkGPUSmoothingRecursiveYvvGaussianImageFilter.h
@@ -151,7 +151,7 @@ class ITK_EXPORT GPUSmoothingRecursiveYvvGaussianImageFilter
 
   /** Generate Data */
   void
-  GPUGenerateData(void) override;
+  GPUGenerateData() override;
 
   /** GPUSmoothingRecursiveYvvGaussianImageFilter needs all of the input to produce an
    * output. Therefore, GPUSmoothingRecursiveYvvGaussianImageFilter needs to provide
diff --git a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkGPUSmoothingRecursiveYvvGaussianImageFilter.hxx b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkGPUSmoothingRecursiveYvvGaussianImageFilter.hxx
index 483d57408fb..eb1d855d8e6 100644
--- a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkGPUSmoothingRecursiveYvvGaussianImageFilter.hxx
+++ b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkGPUSmoothingRecursiveYvvGaussianImageFilter.hxx
@@ -286,7 +286,7 @@ GPUSmoothingRecursiveYvvGaussianImageFilter<TInputImage, TOutputImage>::Allocate
  */
 template <typename TInputImage, typename TOutputImage>
 void
-GPUSmoothingRecursiveYvvGaussianImageFilter<TInputImage, TOutputImage>::GPUGenerateData(void)
+GPUSmoothingRecursiveYvvGaussianImageFilter<TInputImage, TOutputImage>::GPUGenerateData()
 {
   if (m_FilterGPUKernelHandle == -1)
   {
diff --git a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkRecursiveLineYvvGaussianImageFilter.h b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkRecursiveLineYvvGaussianImageFilter.h
index 5684d0183eb..96543c68cc2 100644
--- a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkRecursiveLineYvvGaussianImageFilter.h
+++ b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkRecursiveLineYvvGaussianImageFilter.h
@@ -97,7 +97,7 @@ class ITK_EXPORT RecursiveLineYvvGaussianImageFilter : public InPlaceImageFilter
 
   /** Get Input Image. */
   const TInputImage *
-  GetInputImage(void);
+  GetInputImage();
 
   /** Set/Get the flag for normalizing the gaussian over scale space.
    When this flag is ON the filter will be normalized in such a way
@@ -136,7 +136,7 @@ class ITK_EXPORT RecursiveLineYvvGaussianImageFilter : public InPlaceImageFilter
   ThreadedGenerateData(const OutputImageRegionType & outputRegionForThread, ThreadIdType threadId) override;
 
   const ImageRegionSplitterBase *
-  GetImageRegionSplitter(void) const override;
+  GetImageRegionSplitter() const override;
 
   /** RecursiveLineYvvGaussianImageFilter needs all of the input only in the
    *  "Direction" dimension. Therefore we enlarge the output's
diff --git a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkRecursiveLineYvvGaussianImageFilter.hxx b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkRecursiveLineYvvGaussianImageFilter.hxx
index 49349aa8539..cb629e7d962 100644
--- a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkRecursiveLineYvvGaussianImageFilter.hxx
+++ b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkRecursiveLineYvvGaussianImageFilter.hxx
@@ -78,7 +78,7 @@ RecursiveLineYvvGaussianImageFilter<TInputImage, TOutputImage>::SetInputImage(co
 
 template <typename TInputImage, typename TOutputImage>
 const TInputImage *
-RecursiveLineYvvGaussianImageFilter<TInputImage, TOutputImage>::GetInputImage(void)
+RecursiveLineYvvGaussianImageFilter<TInputImage, TOutputImage>::GetInputImage()
 {
   return dynamic_cast<const TInputImage *>((ProcessObject::GetInput(0)));
 }
@@ -262,7 +262,7 @@ RecursiveLineYvvGaussianImageFilter<TInputImage, TOutputImage>::EnlargeOutputReq
 
 template <typename TInputImage, typename TOutputImage>
 const ImageRegionSplitterBase *
-RecursiveLineYvvGaussianImageFilter<TInputImage, TOutputImage>::GetImageRegionSplitter(void) const
+RecursiveLineYvvGaussianImageFilter<TInputImage, TOutputImage>::GetImageRegionSplitter() const
 {
   return this->m_ImageRegionSplitter;
 }
diff --git a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkSmoothingRecursiveYvvGaussianImageFilter.h b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkSmoothingRecursiveYvvGaussianImageFilter.h
index 3f8f4b485b7..f8f64410c1c 100644
--- a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkSmoothingRecursiveYvvGaussianImageFilter.h
+++ b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkSmoothingRecursiveYvvGaussianImageFilter.h
@@ -129,7 +129,7 @@ class ITK_EXPORT SmoothingRecursiveYvvGaussianImageFilter : public InPlaceImageF
   SetNumberOfWorkUnits(ThreadIdType nb) override;
 
   bool
-  CanRunInPlace(void) const override;
+  CanRunInPlace() const override;
 
 #ifdef ITK_USE_CONCEPT_CHECKING
   /** Begin concept checking */
@@ -144,7 +144,7 @@ class ITK_EXPORT SmoothingRecursiveYvvGaussianImageFilter : public InPlaceImageF
 
   /** Generate Data */
   void
-  GenerateData(void) override;
+  GenerateData() override;
 
   /** SmoothingRecursiveYvvGaussianImageFilter needs all of the input to produce an
    * output. Therefore, SmoothingRecursiveYvvGaussianImageFilter needs to provide
diff --git a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkSmoothingRecursiveYvvGaussianImageFilter.hxx b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkSmoothingRecursiveYvvGaussianImageFilter.hxx
index d22bf156626..18023389aaf 100644
--- a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkSmoothingRecursiveYvvGaussianImageFilter.hxx
+++ b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkSmoothingRecursiveYvvGaussianImageFilter.hxx
@@ -109,7 +109,7 @@ SmoothingRecursiveYvvGaussianImageFilter<TInputImage, TOutputImage>::SetNumberOf
 
 template <typename TInputImage, typename TOutputImage>
 bool
-SmoothingRecursiveYvvGaussianImageFilter<TInputImage, TOutputImage>::CanRunInPlace(void) const
+SmoothingRecursiveYvvGaussianImageFilter<TInputImage, TOutputImage>::CanRunInPlace() const
 {
   // Note: There are two different ways this filter may try to run
   // in-place:
@@ -217,7 +217,7 @@ SmoothingRecursiveYvvGaussianImageFilter<TInputImage, TOutputImage>::EnlargeOutp
 // Compute filter for Gaussian kernel
 template <typename TInputImage, typename TOutputImage>
 void
-SmoothingRecursiveYvvGaussianImageFilter<TInputImage, TOutputImage>::GenerateData(void)
+SmoothingRecursiveYvvGaussianImageFilter<TInputImage, TOutputImage>::GenerateData()
 {
   itkDebugMacro(<< "SmoothingRecursiveYvvGaussianImageFilter generating data ");
 

From edec1e1efd394c51191b12eefa4397d580211fc8 Mon Sep 17 00:00:00 2001
From: Hans Johnson <hans-johnson@uiowa.edu>
Date: Mon, 17 Feb 2020 23:34:58 -0600
Subject: [PATCH 50/65] STYLE: Use auto for variable type matches the type of
 the initializer

expression

This check is responsible for using the auto type specifier for variable
declarations to improve code readability and maintainability.

The auto type specifier will only be introduced in situations where the
variable type matches the type of the initializer expression. In other words
auto should deduce the same type that was originally spelled in the source
---
 .../include/itkGPUSmoothingRecursiveYvvGaussianImageFilter.hxx  | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkGPUSmoothingRecursiveYvvGaussianImageFilter.hxx b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkGPUSmoothingRecursiveYvvGaussianImageFilter.hxx
index eb1d855d8e6..d80aaded37b 100644
--- a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkGPUSmoothingRecursiveYvvGaussianImageFilter.hxx
+++ b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkGPUSmoothingRecursiveYvvGaussianImageFilter.hxx
@@ -248,7 +248,7 @@ void
 GPUSmoothingRecursiveYvvGaussianImageFilter<TInputImage, TOutputImage>::EnlargeOutputRequestedRegion(
   DataObject * output)
 {
-  TOutputImage * out = dynamic_cast<TOutputImage *>(output);
+  auto * out = dynamic_cast<TOutputImage *>(output);
 
   if (out)
   {

From 3ab6178ae74c5bcdf304dd79de978545794cb99a Mon Sep 17 00:00:00 2001
From: Hans Johnson <hans-johnson@uiowa.edu>
Date: Wed, 19 Feb 2020 10:45:26 -0600
Subject: [PATCH 51/65] DOC: Update copyright assignment to NumFOCUS

The mission of NumFOCUS is to promote open
practices in research, data, and scientific
computing.

https://numfocus.org
---
 .../include/itkGPUSmoothingRecursiveYvvGaussianImageFilter.h    | 2 +-
 .../include/itkGPUSmoothingRecursiveYvvGaussianImageFilter.hxx  | 2 +-
 .../include/itkRecursiveLineYvvGaussianImageFilter.h            | 2 +-
 .../include/itkRecursiveLineYvvGaussianImageFilter.hxx          | 2 +-
 .../include/itkSmoothingRecursiveYvvGaussianImageFilter.h       | 2 +-
 .../include/itkSmoothingRecursiveYvvGaussianImageFilter.hxx     | 2 +-
 .../src/GPUSmoothingRecursiveYvvGaussianImageFilter.cl          | 2 +-
 .../test/itkCPURecursiveYvvGaussianImageFilterTest.cxx          | 2 +-
 .../test/itkGPURecursiveYvvGaussianImageFilterTest.cxx          | 2 +-
 .../test/itkYvvBenchmark.cxx                                    | 2 +-
 .../test/itkYvvGpuCpuSimilarityTest.cxx                         | 2 +-
 .../test/itkYvvWhiteImageTest.cxx                               | 2 +-
 .../SmoothingRecursiveYvvGaussianFilter/test/yvvFilter.hxx      | 2 +-
 13 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkGPUSmoothingRecursiveYvvGaussianImageFilter.h b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkGPUSmoothingRecursiveYvvGaussianImageFilter.h
index cd2c3a6c5f9..6781d9e9087 100644
--- a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkGPUSmoothingRecursiveYvvGaussianImageFilter.h
+++ b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkGPUSmoothingRecursiveYvvGaussianImageFilter.h
@@ -1,6 +1,6 @@
 /*=========================================================================
  *
- *  Copyright Insight Software Consortium
+ *  Copyright NumFOCUS
  *
  *  Licensed under the Apache License, Version 2.0 (the "License");
  *  you may not use this file except in compliance with the License.
diff --git a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkGPUSmoothingRecursiveYvvGaussianImageFilter.hxx b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkGPUSmoothingRecursiveYvvGaussianImageFilter.hxx
index d80aaded37b..7bbf068a46d 100644
--- a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkGPUSmoothingRecursiveYvvGaussianImageFilter.hxx
+++ b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkGPUSmoothingRecursiveYvvGaussianImageFilter.hxx
@@ -1,6 +1,6 @@
 /*=========================================================================
  *
- *  Copyright Insight Software Consortium
+ *  Copyright NumFOCUS
  *
  *  Licensed under the Apache License, Version 2.0 (the "License");
  *  you may not use this file except in compliance with the License.
diff --git a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkRecursiveLineYvvGaussianImageFilter.h b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkRecursiveLineYvvGaussianImageFilter.h
index 96543c68cc2..325f0dae5b8 100644
--- a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkRecursiveLineYvvGaussianImageFilter.h
+++ b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkRecursiveLineYvvGaussianImageFilter.h
@@ -1,6 +1,6 @@
 /*=========================================================================
  *
- *  Copyright Insight Software Consortium
+ *  Copyright NumFOCUS
  *
  *  Licensed under the Apache License, Version 2.0 (the "License");
  *  you may not use this file except in compliance with the License.
diff --git a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkRecursiveLineYvvGaussianImageFilter.hxx b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkRecursiveLineYvvGaussianImageFilter.hxx
index cb629e7d962..9c8525ec9e9 100644
--- a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkRecursiveLineYvvGaussianImageFilter.hxx
+++ b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkRecursiveLineYvvGaussianImageFilter.hxx
@@ -1,6 +1,6 @@
 /*=========================================================================
  *
- *  Copyright Insight Software Consortium
+ *  Copyright NumFOCUS
  *
  *  Licensed under the Apache License, Version 2.0 (the "License");
  *  you may not use this file except in compliance with the License.
diff --git a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkSmoothingRecursiveYvvGaussianImageFilter.h b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkSmoothingRecursiveYvvGaussianImageFilter.h
index f8f64410c1c..7d5d79886f2 100644
--- a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkSmoothingRecursiveYvvGaussianImageFilter.h
+++ b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkSmoothingRecursiveYvvGaussianImageFilter.h
@@ -1,6 +1,6 @@
 /*=========================================================================
  *
- *  Copyright Insight Software Consortium
+ *  Copyright NumFOCUS
  *
  *  Licensed under the Apache License, Version 2.0 (the "License");
  *  you may not use this file except in compliance with the License.
diff --git a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkSmoothingRecursiveYvvGaussianImageFilter.hxx b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkSmoothingRecursiveYvvGaussianImageFilter.hxx
index 18023389aaf..f44a71ca181 100644
--- a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkSmoothingRecursiveYvvGaussianImageFilter.hxx
+++ b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkSmoothingRecursiveYvvGaussianImageFilter.hxx
@@ -1,6 +1,6 @@
 /*=========================================================================
  *
- *  Copyright Insight Software Consortium
+ *  Copyright NumFOCUS
  *
  *  Licensed under the Apache License, Version 2.0 (the "License");
  *  you may not use this file except in compliance with the License.
diff --git a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/src/GPUSmoothingRecursiveYvvGaussianImageFilter.cl b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/src/GPUSmoothingRecursiveYvvGaussianImageFilter.cl
index 727d6ad7440..785c06e3b53 100644
--- a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/src/GPUSmoothingRecursiveYvvGaussianImageFilter.cl
+++ b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/src/GPUSmoothingRecursiveYvvGaussianImageFilter.cl
@@ -1,6 +1,6 @@
 /*=========================================================================
  *
- *  Copyright Insight Software Consortium
+ *  Copyright NumFOCUS
  *
  *  Licensed under the Apache License, Version 2.0 (the "License");
  *  you may not use this file except in compliance with the License.
diff --git a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/itkCPURecursiveYvvGaussianImageFilterTest.cxx b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/itkCPURecursiveYvvGaussianImageFilterTest.cxx
index dc7e5cc6380..911b99d4c16 100644
--- a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/itkCPURecursiveYvvGaussianImageFilterTest.cxx
+++ b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/itkCPURecursiveYvvGaussianImageFilterTest.cxx
@@ -1,6 +1,6 @@
 /*=========================================================================
  *
- *  Copyright Insight Software Consortium
+ *  Copyright NumFOCUS
  *
  *  Licensed under the Apache License, Version 2.0 (the "License");
  *  you may not use this file except in compliance with the License.
diff --git a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/itkGPURecursiveYvvGaussianImageFilterTest.cxx b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/itkGPURecursiveYvvGaussianImageFilterTest.cxx
index 6347781b5d2..e4371b391a6 100644
--- a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/itkGPURecursiveYvvGaussianImageFilterTest.cxx
+++ b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/itkGPURecursiveYvvGaussianImageFilterTest.cxx
@@ -1,6 +1,6 @@
 /*=========================================================================
  *
- *  Copyright Insight Software Consortium
+ *  Copyright NumFOCUS
  *
  *  Licensed under the Apache License, Version 2.0 (the "License");
  *  you may not use this file except in compliance with the License.
diff --git a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/itkYvvBenchmark.cxx b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/itkYvvBenchmark.cxx
index 8637a00f5b5..0d91f5de03a 100644
--- a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/itkYvvBenchmark.cxx
+++ b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/itkYvvBenchmark.cxx
@@ -1,6 +1,6 @@
 /*=========================================================================
  *
- *  Copyright Insight Software Consortium
+ *  Copyright NumFOCUS
  *
  *  Licensed under the Apache License, Version 2.0 (the "License");
  *  you may not use this file except in compliance with the License.
diff --git a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/itkYvvGpuCpuSimilarityTest.cxx b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/itkYvvGpuCpuSimilarityTest.cxx
index a592612d44b..35d68f8b273 100644
--- a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/itkYvvGpuCpuSimilarityTest.cxx
+++ b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/itkYvvGpuCpuSimilarityTest.cxx
@@ -1,6 +1,6 @@
 /*=========================================================================
  *
- *  Copyright Insight Software Consortium
+ *  Copyright NumFOCUS
  *
  *  Licensed under the Apache License, Version 2.0 (the "License");
  *  you may not use this file except in compliance with the License.
diff --git a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/itkYvvWhiteImageTest.cxx b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/itkYvvWhiteImageTest.cxx
index b53e2b48913..a300a561151 100644
--- a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/itkYvvWhiteImageTest.cxx
+++ b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/itkYvvWhiteImageTest.cxx
@@ -1,6 +1,6 @@
 /*=========================================================================
  *
- *  Copyright Insight Software Consortium
+ *  Copyright NumFOCUS
  *
  *  Licensed under the Apache License, Version 2.0 (the "License");
  *  you may not use this file except in compliance with the License.
diff --git a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/yvvFilter.hxx b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/yvvFilter.hxx
index 15edcf69265..51b4d523e76 100644
--- a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/yvvFilter.hxx
+++ b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/yvvFilter.hxx
@@ -1,6 +1,6 @@
 /*=========================================================================
  *
- *  Copyright Insight Software Consortium
+ *  Copyright NumFOCUS
  *
  *  Licensed under the Apache License, Version 2.0 (the "License");
  *  you may not use this file except in compliance with the License.

From 88aded7dc9baee1368bb249433881a5a860c7870 Mon Sep 17 00:00:00 2001
From: Hans Johnson <hans-johnson@uiowa.edu>
Date: Thu, 20 Feb 2020 12:57:54 -0600
Subject: [PATCH 52/65] STYLE: Improve variable name description.

---
 .../SmoothingRecursiveYvvGaussianFilter/test/CMakeLists.txt | 6 +++---
 .../test/itkYvvGpuCpuSimilarityTest.cxx                     | 2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/CMakeLists.txt b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/CMakeLists.txt
index 6024dc46ba4..9029e733674 100644
--- a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/CMakeLists.txt
+++ b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/CMakeLists.txt
@@ -16,7 +16,7 @@ if(ITK_USE_GPU)
   include_directories("${${itk-module}KernelDir}")
 
   set(
-    ${itk-module}Tests
+    ${itk-module}TestSRC
     itkCPURecursiveYvvGaussianImageFilterTest.cxx
     itkGPURecursiveYvvGaussianImageFilterTest.cxx
     itkYvvGpuCpuSimilarityTest.cxx
@@ -27,7 +27,7 @@ else()
   #No GPU, but CPU user will probably want double-precision.
   add_definitions(-DWITH_DOUBLE)
   set(
-    ${itk-module}Tests
+    ${itk-module}TestSRC
     itkCPURecursiveYvvGaussianImageFilterTest.cxx
     itkYvvBenchmark.cxx
     itkYvvWhiteImageTest.cxx
@@ -36,7 +36,7 @@ endif()
 
 #set(ITK_TEST_DRIVER itkTestDriver)
 
-createtestdriver(${itk-module} "${${itk-module}-Test_LIBRARIES}" "${${itk-module}Tests}")
+createtestdriver(${itk-module} "${${itk-module}-Test_LIBRARIES}" "${${itk-module}TestSRC}")
 
 #Common tests for CPU and/or GPU
 itk_add_test(
diff --git a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/itkYvvGpuCpuSimilarityTest.cxx b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/itkYvvGpuCpuSimilarityTest.cxx
index 35d68f8b273..cb64db9faad 100644
--- a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/itkYvvGpuCpuSimilarityTest.cxx
+++ b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/itkYvvGpuCpuSimilarityTest.cxx
@@ -113,7 +113,7 @@ runYvvGpuCpuSimilarityTest(const std::string & inFile, float mySigma)
 
     std::cout << "\nSize: " << src->GetLargestPossibleRegion().GetSize() << std::endl;
     std::cout << "CPU Recursive YVV Gaussian Filter took " << cputimer.GetMean() << " seconds with "
-              << CPUFilter->GetNumberOfThreads() << " threads." << std::endl;
+              << CPUFilter->GetNumberOfWorkUnits() << " threads." << std::endl;
 
     castFilterCPU->SetInput(CPUFilter->GetOutput());
     writerCPU->SetInput(castFilterCPU->GetOutput());

From ec3be42aa27c5baafb4cbdb214171912c2e4dfd0 Mon Sep 17 00:00:00 2001
From: Hans Johnson <hans-johnson@uiowa.edu>
Date: Sun, 1 Mar 2020 15:50:17 -0600
Subject: [PATCH 53/65] COMP: Match template style more closely.

---
 .../itk-module.cmake                          | 52 +++++++------------
 1 file changed, 19 insertions(+), 33 deletions(-)

diff --git a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/itk-module.cmake b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/itk-module.cmake
index 420f325fe19..6ce733d4f7b 100644
--- a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/itk-module.cmake
+++ b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/itk-module.cmake
@@ -1,8 +1,5 @@
 # the top-level README is used for describing this module, just
 # re-used it for documentation here
-get_filename_component(MY_CURRENT_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH)
-file(READ "${MY_CURRENT_DIR}/README.rst" DOCUMENTATION)
-
 # itk_module() defines the module dependencies in
 # SmoothingRecursiveYvvGaussianFilter
 # The testing module in SmoothingRecursiveYvvGaussianFilter depends on
@@ -13,34 +10,23 @@ file(READ "${MY_CURRENT_DIR}/README.rst" DOCUMENTATION)
 # define the dependencies of the include module and the tests
 set(ModuleName "SmoothingRecursiveYvvGaussianFilter")
 if(ITK_USE_GPU)
-    itk_module(${ModuleName}
-     DEPENDS
-        ITKCommon
-        ITKIOImageBase
-        ITKImageFilterBase
-        ITKSmoothing
-        ITKGPUSmoothing
-        ITKGPUCommon
-     TEST_DEPENDS
-        ITKTestKernel #to handle IO in src
-        ITKGPUCommon
-        ITKSmoothing
-     EXCLUDE_FROM_DEFAULT
-     DESCRIPTION
-         "${DOCUMENTATION}"
-    )
-else()
-    itk_module(${ModuleName}
-     DEPENDS
-        ITKCommon
-        ITKIOImageBase
-        ITKImageFilterBase
-        ITKSmoothing
-     TEST_DEPENDS
-        ITKTestKernel #to handle IO in src
-        ITKSmoothing
-     EXCLUDE_FROM_DEFAULT
-     DESCRIPTION
-         "${DOCUMENTATION}"
-    )
+  set(${ModuleName}_GPU_DEPENDANCIES "ITKGPUSmoothing")
+  set(${ModuleName}_GPU_COMMON "ITKGPUCommon")
 endif()
+itk_module(
+  ${ModuleName}
+  DEPENDS
+    ITKCommon
+    ITKIOImageBase
+    ITKImageFilterBase
+    ITKSmoothing
+    ${${ModuleName}_GPU_DEPENDANCIES}
+    ${${ModuleName}_GPU_COMMON}
+  TEST_DEPENDS
+    ITKTestKernel #to handle IO in src
+    ${${ModuleName}_GPU_COMMON}
+    ITKSmoothing
+  DESCRIPTION "Module ingested from upstream."
+  EXCLUDE_FROM_DEFAULT
+  # Header only library does not use ENABLE_SHARED
+)

From cd4e6811a9b8dda4641c32b17dc7a167823fa4f0 Mon Sep 17 00:00:00 2001
From: Mathew Seng <mathewseng@gmail.com>
Date: Fri, 20 Nov 2020 10:47:29 -0600
Subject: [PATCH 54/65] BUG: Replace throw to ITK_NOEXCEPT to fix compiler
 warnings

warning: dynamic exception specifications are deprecated in C++11 [-Wdeprecated]
---
 .../include/itkGPUSmoothingRecursiveYvvGaussianImageFilter.h   | 2 +-
 .../include/itkGPUSmoothingRecursiveYvvGaussianImageFilter.hxx | 3 +--
 .../include/itkSmoothingRecursiveYvvGaussianImageFilter.h      | 2 +-
 .../include/itkSmoothingRecursiveYvvGaussianImageFilter.hxx    | 3 +--
 4 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkGPUSmoothingRecursiveYvvGaussianImageFilter.h b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkGPUSmoothingRecursiveYvvGaussianImageFilter.h
index 6781d9e9087..500ce9d2a9d 100644
--- a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkGPUSmoothingRecursiveYvvGaussianImageFilter.h
+++ b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkGPUSmoothingRecursiveYvvGaussianImageFilter.h
@@ -159,7 +159,7 @@ class ITK_EXPORT GPUSmoothingRecursiveYvvGaussianImageFilter
    * the pipeline execution model.
    * \sa ImageToImageFilter::GenerateInputRequestedRegion() */
   void
-  GenerateInputRequestedRegion() throw(InvalidRequestedRegionError) override;
+  GenerateInputRequestedRegion() ITK_NOEXCEPT override;
 
   // Override since the filter produces the entire dataset
   void
diff --git a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkGPUSmoothingRecursiveYvvGaussianImageFilter.hxx b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkGPUSmoothingRecursiveYvvGaussianImageFilter.hxx
index 7bbf068a46d..454784cd94a 100644
--- a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkGPUSmoothingRecursiveYvvGaussianImageFilter.hxx
+++ b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkGPUSmoothingRecursiveYvvGaussianImageFilter.hxx
@@ -227,8 +227,7 @@ GPUSmoothingRecursiveYvvGaussianImageFilter<TInputImage, TOutputImage>::SetNorma
 
 template <typename TInputImage, typename TOutputImage>
 void
-GPUSmoothingRecursiveYvvGaussianImageFilter<TInputImage, TOutputImage>::GenerateInputRequestedRegion() throw(
-  InvalidRequestedRegionError)
+GPUSmoothingRecursiveYvvGaussianImageFilter<TInputImage, TOutputImage>::GenerateInputRequestedRegion() ITK_NOEXCEPT
 {
   // call the superclass' implementation of this method. this should
   // copy the output requested region to the input requested region
diff --git a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkSmoothingRecursiveYvvGaussianImageFilter.h b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkSmoothingRecursiveYvvGaussianImageFilter.h
index 7d5d79886f2..d54c9c7dd76 100644
--- a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkSmoothingRecursiveYvvGaussianImageFilter.h
+++ b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkSmoothingRecursiveYvvGaussianImageFilter.h
@@ -152,7 +152,7 @@ class ITK_EXPORT SmoothingRecursiveYvvGaussianImageFilter : public InPlaceImageF
    * the pipeline execution model.
    * \sa ImageToImageFilter::GenerateInputRequestedRegion() */
   void
-  GenerateInputRequestedRegion() throw(InvalidRequestedRegionError) override;
+  GenerateInputRequestedRegion() ITK_NOEXCEPT override;
 
   // Override since the filter produces the entire dataset
   void
diff --git a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkSmoothingRecursiveYvvGaussianImageFilter.hxx b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkSmoothingRecursiveYvvGaussianImageFilter.hxx
index f44a71ca181..5d10ff6022e 100644
--- a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkSmoothingRecursiveYvvGaussianImageFilter.hxx
+++ b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkSmoothingRecursiveYvvGaussianImageFilter.hxx
@@ -186,8 +186,7 @@ SmoothingRecursiveYvvGaussianImageFilter<TInputImage, TOutputImage>::SetNormaliz
 
 template <typename TInputImage, typename TOutputImage>
 void
-SmoothingRecursiveYvvGaussianImageFilter<TInputImage, TOutputImage>::GenerateInputRequestedRegion() throw(
-  InvalidRequestedRegionError)
+SmoothingRecursiveYvvGaussianImageFilter<TInputImage, TOutputImage>::GenerateInputRequestedRegion() ITK_NOEXCEPT
 {
   // call the superclass' implementation of this method. this should
   // copy the output requested region to the input requested region

From 0341c8124fcb55c4d976abd7ca420caa4f6ea407 Mon Sep 17 00:00:00 2001
From: Mathew Seng <mathewseng@gmail.com>
Date: Fri, 16 Oct 2020 10:35:08 -0500
Subject: [PATCH 55/65] STYLE: Rename ITK_DISALLOW_COPY_AND_ASSIGN to
 ITK_DISALLOW_COPY_AND_MOVE

Fixes changes made in #2053. ITK_DISALLOW_COPY_AND_ASSIGN will be used if ITK_FUTURE_LEGACY_REMOVE=OFF.
---
 .../include/itkGPUSmoothingRecursiveYvvGaussianImageFilter.h    | 2 +-
 .../include/itkRecursiveLineYvvGaussianImageFilter.h            | 2 +-
 .../include/itkSmoothingRecursiveYvvGaussianImageFilter.h       | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkGPUSmoothingRecursiveYvvGaussianImageFilter.h b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkGPUSmoothingRecursiveYvvGaussianImageFilter.h
index 500ce9d2a9d..0f66d97d98a 100644
--- a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkGPUSmoothingRecursiveYvvGaussianImageFilter.h
+++ b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkGPUSmoothingRecursiveYvvGaussianImageFilter.h
@@ -55,7 +55,7 @@ class ITK_EXPORT GPUSmoothingRecursiveYvvGaussianImageFilter
                                  SmoothingRecursiveYvvGaussianImageFilter<TInputImage, TOutputImage>>
 {
 public:
-  ITK_DISALLOW_COPY_AND_ASSIGN(GPUSmoothingRecursiveYvvGaussianImageFilter);
+  ITK_DISALLOW_COPY_AND_MOVE(GPUSmoothingRecursiveYvvGaussianImageFilter);
 
   /** Standard class type alias. */
   using Self = GPUSmoothingRecursiveYvvGaussianImageFilter;
diff --git a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkRecursiveLineYvvGaussianImageFilter.h b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkRecursiveLineYvvGaussianImageFilter.h
index 325f0dae5b8..43907f3b882 100644
--- a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkRecursiveLineYvvGaussianImageFilter.h
+++ b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkRecursiveLineYvvGaussianImageFilter.h
@@ -45,7 +45,7 @@ template <typename TInputImage, typename TOutputImage = TInputImage>
 class ITK_EXPORT RecursiveLineYvvGaussianImageFilter : public InPlaceImageFilter<TInputImage, TOutputImage>
 {
 public:
-  ITK_DISALLOW_COPY_AND_ASSIGN(RecursiveLineYvvGaussianImageFilter);
+  ITK_DISALLOW_COPY_AND_MOVE(RecursiveLineYvvGaussianImageFilter);
 
   /** Standard class type alias. */
   using Self = RecursiveLineYvvGaussianImageFilter;
diff --git a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkSmoothingRecursiveYvvGaussianImageFilter.h b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkSmoothingRecursiveYvvGaussianImageFilter.h
index d54c9c7dd76..1e1d76ca7e6 100644
--- a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkSmoothingRecursiveYvvGaussianImageFilter.h
+++ b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkSmoothingRecursiveYvvGaussianImageFilter.h
@@ -47,7 +47,7 @@ template <typename TInputImage, typename TOutputImage = TInputImage>
 class ITK_EXPORT SmoothingRecursiveYvvGaussianImageFilter : public InPlaceImageFilter<TInputImage, TOutputImage>
 {
 public:
-  ITK_DISALLOW_COPY_AND_ASSIGN(SmoothingRecursiveYvvGaussianImageFilter);
+  ITK_DISALLOW_COPY_AND_MOVE(SmoothingRecursiveYvvGaussianImageFilter);
 
   /** Standard class type alias. */
   using Self = SmoothingRecursiveYvvGaussianImageFilter;

From fa2318ae36f5489cd450876c46ce16626292ea57 Mon Sep 17 00:00:00 2001
From: Mathew Seng <mathewseng@gmail.com>
Date: Tue, 29 Dec 2020 12:10:57 -0600
Subject: [PATCH 56/65] COMP: Add missing ';' at end of macro

A ';' is required at the end of macros in a future version of ITK.
---
 .../include/itkRecursiveLineYvvGaussianImageFilter.hxx          | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkRecursiveLineYvvGaussianImageFilter.hxx b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkRecursiveLineYvvGaussianImageFilter.hxx
index 9c8525ec9e9..e41d38e7bce 100644
--- a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkRecursiveLineYvvGaussianImageFilter.hxx
+++ b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkRecursiveLineYvvGaussianImageFilter.hxx
@@ -249,7 +249,7 @@ RecursiveLineYvvGaussianImageFilter<TInputImage, TOutputImage>::EnlargeOutputReq
     // verify sane parameter
     if (this->m_Direction >= outputRegion.GetImageDimension())
     {
-      itkExceptionMacro("Direction selected for filtering is greater than ImageDimension")
+      itkExceptionMacro("Direction selected for filtering is greater than ImageDimension");
     }
 
     // expand output region to match largest in the "Direction" dimension

From 219c19b568f594b2dbcae3a9562913081527e41e Mon Sep 17 00:00:00 2001
From: Hans Johnson <hans-johnson@uiowa.edu>
Date: Fri, 17 Dec 2021 12:29:16 -0600
Subject: [PATCH 57/65] COMP: Remove inclusion of .hxx files as headers

The ability to include either .h or .hxx files as
header files required recursively reading the
.h files twice.  The added complexity is
unnecessary, costly, and can confuse static
analysis tools that monitor header guardes (due
to reaching the maximum depth of recursion
limits for nested #ifdefs in checking).
---
 .../include/itkRecursiveLineYvvGaussianImageFilter.hxx           | 1 -
 .../include/itkSmoothingRecursiveYvvGaussianImageFilter.hxx      | 1 -
 2 files changed, 2 deletions(-)

diff --git a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkRecursiveLineYvvGaussianImageFilter.hxx b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkRecursiveLineYvvGaussianImageFilter.hxx
index e41d38e7bce..7b27036baab 100644
--- a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkRecursiveLineYvvGaussianImageFilter.hxx
+++ b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkRecursiveLineYvvGaussianImageFilter.hxx
@@ -19,7 +19,6 @@
 #ifndef itkRecursiveLineYvvGaussianImageFilter_hxx
 #define itkRecursiveLineYvvGaussianImageFilter_hxx
 
-#include "itkRecursiveLineYvvGaussianImageFilter.h"
 #include "itkObjectFactory.h"
 #include "itkImageLinearIteratorWithIndex.h"
 #include "itkImageLinearConstIteratorWithIndex.h"
diff --git a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkSmoothingRecursiveYvvGaussianImageFilter.hxx b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkSmoothingRecursiveYvvGaussianImageFilter.hxx
index 5d10ff6022e..bf6bc361dfe 100644
--- a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkSmoothingRecursiveYvvGaussianImageFilter.hxx
+++ b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkSmoothingRecursiveYvvGaussianImageFilter.hxx
@@ -19,7 +19,6 @@
 #ifndef itkSmoothingRecursiveYvvGaussianImageFilter_hxx
 #define itkSmoothingRecursiveYvvGaussianImageFilter_hxx
 
-#include "itkSmoothingRecursiveYvvGaussianImageFilter.h"
 #include "itkImageRegionIteratorWithIndex.h"
 #include "itkProgressAccumulator.h"
 

From d88504395d15dc593be9124314bc3d4c692e4d1f Mon Sep 17 00:00:00 2001
From: Tom Birdsong <tom.birdsong@kitware.com>
Date: Tue, 31 May 2022 13:29:51 -0400
Subject: [PATCH 58/65] ENH: Bump ITK version and change http links to https

---
 .../include/itkGPUSmoothingRecursiveYvvGaussianImageFilter.h  | 4 ++--
 .../itkGPUSmoothingRecursiveYvvGaussianImageFilter.hxx        | 2 +-
 .../include/itkRecursiveLineYvvGaussianImageFilter.h          | 4 ++--
 .../include/itkRecursiveLineYvvGaussianImageFilter.hxx        | 2 +-
 .../include/itkSmoothingRecursiveYvvGaussianImageFilter.h     | 4 ++--
 .../include/itkSmoothingRecursiveYvvGaussianImageFilter.hxx   | 2 +-
 .../src/GPUSmoothingRecursiveYvvGaussianImageFilter.cl        | 2 +-
 .../test/itkCPURecursiveYvvGaussianImageFilterTest.cxx        | 2 +-
 .../test/itkGPURecursiveYvvGaussianImageFilterTest.cxx        | 2 +-
 .../test/itkYvvBenchmark.cxx                                  | 2 +-
 .../test/itkYvvGpuCpuSimilarityTest.cxx                       | 2 +-
 .../test/itkYvvWhiteImageTest.cxx                             | 2 +-
 .../SmoothingRecursiveYvvGaussianFilter/test/yvvFilter.hxx    | 2 +-
 13 files changed, 16 insertions(+), 16 deletions(-)

diff --git a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkGPUSmoothingRecursiveYvvGaussianImageFilter.h b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkGPUSmoothingRecursiveYvvGaussianImageFilter.h
index 0f66d97d98a..d9c22708cd0 100644
--- a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkGPUSmoothingRecursiveYvvGaussianImageFilter.h
+++ b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkGPUSmoothingRecursiveYvvGaussianImageFilter.h
@@ -6,7 +6,7 @@
  *  you may not use this file except in compliance with the License.
  *  You may obtain a copy of the License at
  *
- *         http://www.apache.org/licenses/LICENSE-2.0.txt
+ *         https://www.apache.org/licenses/LICENSE-2.0.txt
  *
  *  Unless required by applicable law or agreed to in writing, software
  *  distributed under the License is distributed on an "AS IS" BASIS,
@@ -41,7 +41,7 @@ namespace itk
  *  the GPU performs better for your particular hardware configuration.
  *
  *  More information in the Insight Journal publication:
- *  http://hdl.handle.net/10380/3425
+ *  https://hdl.handle.net/10380/3425
  *
  * \ingroup SmoothingRecursiveYvvGaussianFilter
  */
diff --git a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkGPUSmoothingRecursiveYvvGaussianImageFilter.hxx b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkGPUSmoothingRecursiveYvvGaussianImageFilter.hxx
index 454784cd94a..37044ab772e 100644
--- a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkGPUSmoothingRecursiveYvvGaussianImageFilter.hxx
+++ b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkGPUSmoothingRecursiveYvvGaussianImageFilter.hxx
@@ -6,7 +6,7 @@
  *  you may not use this file except in compliance with the License.
  *  You may obtain a copy of the License at
  *
- *         http://www.apache.org/licenses/LICENSE-2.0.txt
+ *         https://www.apache.org/licenses/LICENSE-2.0.txt
  *
  *  Unless required by applicable law or agreed to in writing, software
  *  distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkRecursiveLineYvvGaussianImageFilter.h b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkRecursiveLineYvvGaussianImageFilter.h
index 43907f3b882..4298c5ed2a5 100644
--- a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkRecursiveLineYvvGaussianImageFilter.h
+++ b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkRecursiveLineYvvGaussianImageFilter.h
@@ -6,7 +6,7 @@
  *  you may not use this file except in compliance with the License.
  *  You may obtain a copy of the License at
  *
- *         http://www.apache.org/licenses/LICENSE-2.0.txt
+ *         https://www.apache.org/licenses/LICENSE-2.0.txt
  *
  *  Unless required by applicable law or agreed to in writing, software
  *  distributed under the License is distributed on an "AS IS" BASIS,
@@ -36,7 +36,7 @@ namespace itk
  *  performs better for your particular hardware configuration.
  *
  *  More information in the Insight Journal publication:
- *  http://hdl.handle.net/10380/3425
+ *  https://hdl.handle.net/10380/3425
  *
  * \ingroup SmoothingRecursiveYvvGaussianFilter
  */
diff --git a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkRecursiveLineYvvGaussianImageFilter.hxx b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkRecursiveLineYvvGaussianImageFilter.hxx
index 7b27036baab..e535166cbcd 100644
--- a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkRecursiveLineYvvGaussianImageFilter.hxx
+++ b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkRecursiveLineYvvGaussianImageFilter.hxx
@@ -6,7 +6,7 @@
  *  you may not use this file except in compliance with the License.
  *  You may obtain a copy of the License at
  *
- *         http://www.apache.org/licenses/LICENSE-2.0.txt
+ *         https://www.apache.org/licenses/LICENSE-2.0.txt
  *
  *  Unless required by applicable law or agreed to in writing, software
  *  distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkSmoothingRecursiveYvvGaussianImageFilter.h b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkSmoothingRecursiveYvvGaussianImageFilter.h
index 1e1d76ca7e6..12ad0b66cd0 100644
--- a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkSmoothingRecursiveYvvGaussianImageFilter.h
+++ b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkSmoothingRecursiveYvvGaussianImageFilter.h
@@ -6,7 +6,7 @@
  *  you may not use this file except in compliance with the License.
  *  You may obtain a copy of the License at
  *
- *         http://www.apache.org/licenses/LICENSE-2.0.txt
+ *         https://www.apache.org/licenses/LICENSE-2.0.txt
  *
  *  Unless required by applicable law or agreed to in writing, software
  *  distributed under the License is distributed on an "AS IS" BASIS,
@@ -39,7 +39,7 @@ namespace itk
  *  performs better for your particular hardware configuration.
  *
  *  More information in the Insight Journal publication:
- *  http://hdl.handle.net/10380/3425
+ *  https://hdl.handle.net/10380/3425
  *
  * \ingroup SmoothingRecursiveYvvGaussianFilter
  */
diff --git a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkSmoothingRecursiveYvvGaussianImageFilter.hxx b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkSmoothingRecursiveYvvGaussianImageFilter.hxx
index bf6bc361dfe..261674fd98e 100644
--- a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkSmoothingRecursiveYvvGaussianImageFilter.hxx
+++ b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkSmoothingRecursiveYvvGaussianImageFilter.hxx
@@ -6,7 +6,7 @@
  *  you may not use this file except in compliance with the License.
  *  You may obtain a copy of the License at
  *
- *         http://www.apache.org/licenses/LICENSE-2.0.txt
+ *         https://www.apache.org/licenses/LICENSE-2.0.txt
  *
  *  Unless required by applicable law or agreed to in writing, software
  *  distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/src/GPUSmoothingRecursiveYvvGaussianImageFilter.cl b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/src/GPUSmoothingRecursiveYvvGaussianImageFilter.cl
index 785c06e3b53..12ffa074aba 100644
--- a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/src/GPUSmoothingRecursiveYvvGaussianImageFilter.cl
+++ b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/src/GPUSmoothingRecursiveYvvGaussianImageFilter.cl
@@ -6,7 +6,7 @@
  *  you may not use this file except in compliance with the License.
  *  You may obtain a copy of the License at
  *
- *         http://www.apache.org/licenses/LICENSE-2.0.txt
+ *         https://www.apache.org/licenses/LICENSE-2.0.txt
  *
  *  Unless required by applicable law or agreed to in writing, software
  *  distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/itkCPURecursiveYvvGaussianImageFilterTest.cxx b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/itkCPURecursiveYvvGaussianImageFilterTest.cxx
index 911b99d4c16..95d66a43990 100644
--- a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/itkCPURecursiveYvvGaussianImageFilterTest.cxx
+++ b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/itkCPURecursiveYvvGaussianImageFilterTest.cxx
@@ -6,7 +6,7 @@
  *  you may not use this file except in compliance with the License.
  *  You may obtain a copy of the License at
  *
- *         http://www.apache.org/licenses/LICENSE-2.0.txt
+ *         https://www.apache.org/licenses/LICENSE-2.0.txt
  *
  *  Unless required by applicable law or agreed to in writing, software
  *  distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/itkGPURecursiveYvvGaussianImageFilterTest.cxx b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/itkGPURecursiveYvvGaussianImageFilterTest.cxx
index e4371b391a6..4cedc54216b 100644
--- a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/itkGPURecursiveYvvGaussianImageFilterTest.cxx
+++ b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/itkGPURecursiveYvvGaussianImageFilterTest.cxx
@@ -6,7 +6,7 @@
  *  you may not use this file except in compliance with the License.
  *  You may obtain a copy of the License at
  *
- *         http://www.apache.org/licenses/LICENSE-2.0.txt
+ *         https://www.apache.org/licenses/LICENSE-2.0.txt
  *
  *  Unless required by applicable law or agreed to in writing, software
  *  distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/itkYvvBenchmark.cxx b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/itkYvvBenchmark.cxx
index 0d91f5de03a..9fbe4166fad 100644
--- a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/itkYvvBenchmark.cxx
+++ b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/itkYvvBenchmark.cxx
@@ -6,7 +6,7 @@
  *  you may not use this file except in compliance with the License.
  *  You may obtain a copy of the License at
  *
- *         http://www.apache.org/licenses/LICENSE-2.0.txt
+ *         https://www.apache.org/licenses/LICENSE-2.0.txt
  *
  *  Unless required by applicable law or agreed to in writing, software
  *  distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/itkYvvGpuCpuSimilarityTest.cxx b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/itkYvvGpuCpuSimilarityTest.cxx
index cb64db9faad..298f68f2fea 100644
--- a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/itkYvvGpuCpuSimilarityTest.cxx
+++ b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/itkYvvGpuCpuSimilarityTest.cxx
@@ -6,7 +6,7 @@
  *  you may not use this file except in compliance with the License.
  *  You may obtain a copy of the License at
  *
- *         http://www.apache.org/licenses/LICENSE-2.0.txt
+ *         https://www.apache.org/licenses/LICENSE-2.0.txt
  *
  *  Unless required by applicable law or agreed to in writing, software
  *  distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/itkYvvWhiteImageTest.cxx b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/itkYvvWhiteImageTest.cxx
index a300a561151..e0261f005f2 100644
--- a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/itkYvvWhiteImageTest.cxx
+++ b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/itkYvvWhiteImageTest.cxx
@@ -6,7 +6,7 @@
  *  you may not use this file except in compliance with the License.
  *  You may obtain a copy of the License at
  *
- *         http://www.apache.org/licenses/LICENSE-2.0.txt
+ *         https://www.apache.org/licenses/LICENSE-2.0.txt
  *
  *  Unless required by applicable law or agreed to in writing, software
  *  distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/yvvFilter.hxx b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/yvvFilter.hxx
index 51b4d523e76..d3498e494bc 100644
--- a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/yvvFilter.hxx
+++ b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/yvvFilter.hxx
@@ -6,7 +6,7 @@
  *  you may not use this file except in compliance with the License.
  *  You may obtain a copy of the License at
  *
- *         http://www.apache.org/licenses/LICENSE-2.0.txt
+ *         https://www.apache.org/licenses/LICENSE-2.0.txt
  *
  *  Unless required by applicable law or agreed to in writing, software
  *  distributed under the License is distributed on an "AS IS" BASIS,

From c3d6d51b7e87a98cd630d5eb926c75432e95f2f3 Mon Sep 17 00:00:00 2001
From: Bradley Lowekamp <blowekamp@mail.nih.gov>
Date: Tue, 27 Jan 2026 00:22:32 +0000
Subject: [PATCH 59/65] ENH: Modernize CMake to use itk_module_add_library

Replace add_library with itk_module_add_library macro for better
integration with ITK module system. This provides automatic dependency
linking, include directory setup, and consistent target naming.
---
 .../SmoothingRecursiveYvvGaussianFilter/src/CMakeLists.txt    | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/src/CMakeLists.txt b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/src/CMakeLists.txt
index da1bd2700f9..fbbcb9bc4c0 100644
--- a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/src/CMakeLists.txt
+++ b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/src/CMakeLists.txt
@@ -16,8 +16,6 @@ if(ITK_USE_GPU)
 
   write_gpu_kernels("${GPU_Kernels}" GPU_SRC)
 
-  add_library(${itk-module} ${GPU_SRC})
+  itk_module_add_library(${itk-module} ${GPU_SRC})
   target_link_libraries(${itk-module} ${INRIA_ITK_LIBRARIES} ${OPENCL_LIBRARIES})
-
-  itk_module_target(${itk-module})
 endif()

From c3f9fb3e6a11270a6206302b0a297c1af7ba7411 Mon Sep 17 00:00:00 2001
From: "Hans J. Johnson" <hans-johnson@uiowa.edu>
Date: Fri, 8 May 2026 21:08:06 -0500
Subject: [PATCH 60/65] DOC: Add SmoothingRecursiveYvvGaussianFilter README and
 in-tree CMakeLists.txt

The upstream top-level CMakeLists.txt carried bespoke find_package(OpenCL)
+ try_run detection that is unsuitable for an in-tree ITK module; replace
with the canonical three-line project() + itk_module_impl() form.  GPU
sources continue to build under ITK_USE_GPU via src/CMakeLists.txt.
---
 .../CMakeLists.txt                            |  3 ++
 .../README.md                                 | 29 +++++++++++++++++++
 2 files changed, 32 insertions(+)
 create mode 100644 Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/CMakeLists.txt
 create mode 100644 Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/README.md

diff --git a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/CMakeLists.txt b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/CMakeLists.txt
new file mode 100644
index 00000000000..a403dc68615
--- /dev/null
+++ b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/CMakeLists.txt
@@ -0,0 +1,3 @@
+project(SmoothingRecursiveYvvGaussianFilter)
+
+itk_module_impl()
diff --git a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/README.md b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/README.md
new file mode 100644
index 00000000000..a46431a06b8
--- /dev/null
+++ b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/README.md
@@ -0,0 +1,29 @@
+# SmoothingRecursiveYvvGaussianFilter
+
+In-tree ITK module providing the Vliet/Young/Verbeek recursive
+Gaussian smoothing approximation as a drop-in alternative to the
+canonical `itk::SmoothingRecursiveGaussianImageFilter`. The flagship
+classes are
+`itk::SmoothingRecursiveYvvGaussianImageFilter`,
+`itk::RecursiveLineYvvGaussianImageFilter`, and the
+`ITK_USE_GPU`-gated
+`itk::GPUSmoothingRecursiveYvvGaussianImageFilter`.
+
+## Origin
+
+Ingested from the standalone remote module
+[**InsightSoftwareConsortium/ITKSmoothingRecursiveYvvGaussianFilter**](https://github.com/InsightSoftwareConsortium/ITKSmoothingRecursiveYvvGaussianFilter)
+on 2026-05-08, following the v4 ingestion guidelines defined in
+InsightSoftwareConsortium/ITK#6204. The upstream repository will be
+archived read-only after this PR merges; it remains reachable at the
+URL above for historical reference (notably the `doc/` directory and
+the upstream's bespoke top-level OpenCL detection, which were
+intentionally not ingested — ITK's in-tree GPU support is provided
+by `ITKGPUCommon`).
+
+## References
+
+- Bouilhol G., Pop C., Sarrut D.
+  *Recursive Implementation of Vliet/Young/Verbeek Gaussian Smoothing.*
+  The Insight Journal. January-December. 2013.
+  <https://doi.org/10.54294/2pejyl>

From 3540d840f8e927efce751dd52a4623209e7c0a1b Mon Sep 17 00:00:00 2001
From: "Hans J. Johnson" <hans-johnson@uiowa.edu>
Date: Fri, 8 May 2026 21:08:06 -0500
Subject: [PATCH 61/65] COMP: Remove SmoothingRecursiveYvvGaussianFilter
 .remote.cmake (in-tree)

---
 ...ingRecursiveYvvGaussianFilter.remote.cmake | 52 -------------------
 1 file changed, 52 deletions(-)
 delete mode 100644 Modules/Remote/SmoothingRecursiveYvvGaussianFilter.remote.cmake

diff --git a/Modules/Remote/SmoothingRecursiveYvvGaussianFilter.remote.cmake b/Modules/Remote/SmoothingRecursiveYvvGaussianFilter.remote.cmake
deleted file mode 100644
index cc4ccccc0d6..00000000000
--- a/Modules/Remote/SmoothingRecursiveYvvGaussianFilter.remote.cmake
+++ /dev/null
@@ -1,52 +0,0 @@
-#-- # Grading Level Criteria Report
-#-- EVALUATION DATE: 2020-03-01
-#-- EVALUATORS: [<<NO EVALUATOR>>,<<NO EVALUATOR>>]
-#--
-#-- ## Compliance level 5 star (AKA ITK main modules, or remote modules that could become core modules)
-#--   - [ ] Widespread community dependance
-#--   - [ ] Above 90% code coverage
-#--   - [ ] CI dashboards and testing monitored rigorously
-#--   - [ ] Key API features are exposed in wrapping interface
-#--   - [ ] All requirements of Levels 4,3,2,1
-#--
-#-- ## Compliance Level 4 star (Very high-quality code, perhaps small community dependance)
-#--   - [ ] Meets all ITK code style standards
-#--   - [ ] No external requirements beyond those needed by ITK proper
-#--   - [ ] Builds and passes tests on all supported platforms within 1 month of each core tagged release
-#--            - [ ] Windows Shared Library Build with Visual Studio
-#--            - [ ] Mac with clang compiller
-#--            - [ ] Linux with gcc compiler
-#--   - [ ] Active developer community dedicated to maintaining code-base
-#--   - [ ] 75% code coverage demonstrated for testing suite
-#--   - [ ] Continuous integration testing performed
-#--   - [ ] All requirements of Levels 3,2,1
-#--
-#-- ## Compliance Level 3 star (Quality beta code)
-#--   - [ ] API | executable interface is considered mostly stable and feature complete
-#--   - [ ] 10% C0-code coverage demonstrated for testing suite
-#--   - [ ] Some tests exist and pass on at least some platform
-#--   - [X] All requirements of Levels 2,1
-#--
-#-- ## Compliance Level 2 star (Alpha code feature API development or niche community/execution environment dependance )
-#--   - [X] Compiles for at least 1 niche set of execution envirionments, and perhaps others
-#--         (may depend on specific external tools like a java environment, or specific external libraries to work )
-#--   - [X] All requirements of Levels 1
-#--
-#-- ## Compliance Level 1 star (Pre-alpha features under development and code of unknown quality)
-#--   - [X] Code complies on at least 1 platform
-#--
-#-- ## Compliance Level 0 star ( Code/Feature of known poor-quality or deprecated status )
-#--   - [ ] Code reviewed and explicitly identified as not recommended for use
-#--
-#-- ### Please document here any justification for the criteria above
-#       Code style enforced by clang-format on 2020-02-19, and clang-tidy modernizations completed
-
-#Contact: I. Vidal-Migallon <irina.vidal-migallon@inria.fr>
-itk_fetch_module(
-  SmoothingRecursiveYvvGaussianFilter
-  "GPU and CPU Young & Van Vliet Recursive Gaussian Smoothing Filter: https://doi.org/10.54294/cpyaig"
-  MODULE_COMPLIANCE_LEVEL 2
-  #UPSTREAM_REPO GIT_REPOSITORY https://github.com/Inria-Asclepios/SmoothingRecursiveYvvGaussianFilter
-  GIT_REPOSITORY https://github.com/InsightSoftwareConsortium/ITKSmoothingRecursiveYvvGaussianFilter.git
-  GIT_TAG 8cfb58e73158d6ab779d2171b624c73929c0b35d
-  )

From 0246315ccd42775d9990825c764105ee88006076 Mon Sep 17 00:00:00 2001
From: "Hans J. Johnson" <hans-johnson@uiowa.edu>
Date: Fri, 8 May 2026 21:08:39 -0500
Subject: [PATCH 62/65] ENH: Enable Module_SmoothingRecursiveYvvGaussianFilter
 in configure-ci

---
 pyproject.toml | 1 +
 1 file changed, 1 insertion(+)

diff --git a/pyproject.toml b/pyproject.toml
index a6f86c46f2f..c89878a7915 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -65,6 +65,7 @@ cmd = '''cmake \
   -DModule_MGHIO:BOOL=ON \
   -DModule_PolarTransform:BOOL=ON \
   -DModule_PrincipalComponentsAnalysis:BOOL=ON \
+  -DModule_SmoothingRecursiveYvvGaussianFilter:BOOL=ON \
   -DModule_SplitComponents:BOOL=ON \
   -DModule_IOMeshMZ3:BOOL=ON \
   -DModule_IOFDF:BOOL=ON \

From dd5c985447fdd818f9b135f89107915c2e85fce5 Mon Sep 17 00:00:00 2001
From: "Hans J. Johnson" <hans-johnson@uiowa.edu>
Date: Fri, 8 May 2026 21:11:56 -0500
Subject: [PATCH 63/65] STYLE: gersemi-format
 SmoothingRecursiveYvvGaussianFilter src/CMakeLists.txt

---
 .../SmoothingRecursiveYvvGaussianFilter/src/CMakeLists.txt  | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/src/CMakeLists.txt b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/src/CMakeLists.txt
index fbbcb9bc4c0..5cf2e86293d 100644
--- a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/src/CMakeLists.txt
+++ b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/src/CMakeLists.txt
@@ -17,5 +17,9 @@ if(ITK_USE_GPU)
   write_gpu_kernels("${GPU_Kernels}" GPU_SRC)
 
   itk_module_add_library(${itk-module} ${GPU_SRC})
-  target_link_libraries(${itk-module} ${INRIA_ITK_LIBRARIES} ${OPENCL_LIBRARIES})
+  target_link_libraries(
+    ${itk-module}
+    ${INRIA_ITK_LIBRARIES}
+    ${OPENCL_LIBRARIES}
+  )
 endif()

From 2bdf16851583240195c111798cf69b71de687577 Mon Sep 17 00:00:00 2001
From: "Hans J. Johnson" <hans-johnson@uiowa.edu>
Date: Tue, 12 May 2026 14:23:08 -0500
Subject: [PATCH 64/65] BUG: Recompute Yvv GPU coefficients against actual
 input spacing

SetSigmaArray() reads spacing from GetOutput()->GetSpacing() at
user-config time, where the output DataObject still carries the
default unit spacing (1.0 in every dimension). The CPU sibling
RecursiveLineYvvGaussianImageFilter recomputes the b-coefficients
and M-matrix in BeforeThreadedGenerateData() using the actual
input spacing.

Add the equivalent recomputation at the entry of GPUGenerateData()
so non-unit-spacing images (e.g. CT with 0.5 mm voxels) produce
correct Gaussian kernels on the GPU path.
---
 .../itkGPUSmoothingRecursiveYvvGaussianImageFilter.hxx | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkGPUSmoothingRecursiveYvvGaussianImageFilter.hxx b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkGPUSmoothingRecursiveYvvGaussianImageFilter.hxx
index 37044ab772e..9f60bebb1a2 100644
--- a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkGPUSmoothingRecursiveYvvGaussianImageFilter.hxx
+++ b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/include/itkGPUSmoothingRecursiveYvvGaussianImageFilter.hxx
@@ -292,6 +292,16 @@ GPUSmoothingRecursiveYvvGaussianImageFilter<TInputImage, TOutputImage>::GPUGener
     this->BuildKernel();
   }
 
+  // Recompute the b-coefficients and M-matrix against the actual input spacing.
+  // SetSigmaArray() reads GetOutput()->GetSpacing() before Update(), where the
+  // output DataObject still carries the default unit spacing; the CPU sibling
+  // recomputes per-call in BeforeThreadedGenerateData (see #6243).
+  const typename InputImageType::SpacingType & inputSpacing = this->GetInput()->GetSpacing();
+  if (inputSpacing[0] != 0)
+  {
+    this->SetUp(inputSpacing[0]);
+  }
+
   constexpr unsigned int X = 0;
   constexpr unsigned int Y = 1;
   constexpr unsigned int Z = 2;

From c2940bf7d1098b7d13274d048344186d90b82c4f Mon Sep 17 00:00:00 2001
From: "Hans J. Johnson" <hans-johnson@uiowa.edu>
Date: Tue, 12 May 2026 19:46:07 -0500
Subject: [PATCH 65/65] =?UTF-8?q?BUG:=20Drop=20itkYvvBenchmark3D=20?=
 =?UTF-8?q?=E2=80=94=20input=20fixture=20256x256x64.tif=20not=20available?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Upstream benchmark referenced a 4 MB Input/256x256x64.tif blob that was
removed during ingest; no published ITKTestingData CID exists. 3D filter
coverage is retained by itkYvvWhiteImageTest3D and
itkGPURecursiveYvvGaussianImageFilterTest.
---
 .../test/CMakeLists.txt                               | 11 -----------
 1 file changed, 11 deletions(-)

diff --git a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/CMakeLists.txt b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/CMakeLists.txt
index 9029e733674..209d5e26ad4 100644
--- a/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/CMakeLists.txt
+++ b/Modules/Filtering/SmoothingRecursiveYvvGaussianFilter/test/CMakeLists.txt
@@ -61,17 +61,6 @@ itk_add_test(
     4
 )
 
-itk_add_test(
-  NAME itkYvvBenchmark3D
-  COMMAND
-    ${itk-module}TestDriver
-    itkYvvBenchmark
-    DATA{Input/256x256x64.tif}
-    3
-    12.0
-    2
-)
-
 itk_add_test(
   NAME itkYvvWhiteImageTest2D
   COMMAND
