RTK  2.7.0
Reconstruction Toolkit
rtkLaplacianImageFilter.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright RTK Consortium
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * https://www.apache.org/licenses/LICENSE-2.0.txt
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17  *=========================================================================*/
18 
19 #ifndef rtkLaplacianImageFilter_h
20 #define rtkLaplacianImageFilter_h
21 
24 #include "itkMultiplyImageFilter.h"
25 
26 #ifdef RTK_USE_CUDA
27 # include <itkCudaImage.h>
28 #endif
29 
30 namespace rtk
31 {
32 
45 template <typename TOutputImage>
46 class ITK_TEMPLATE_EXPORT LaplacianImageFilter : public itk::ImageToImageFilter<TOutputImage, TOutputImage>
47 {
48 public:
49  ITK_DISALLOW_COPY_AND_MOVE(LaplacianImageFilter);
50 
55  using OutputImagePointer = typename TOutputImage::Pointer;
58 
59 #ifdef RTK_USE_CUDA
60  typedef
61  typename std::conditional<std::is_same<TOutputImage, CPUImageType>::value,
63  itk::CudaImage<VectorPixelType, TOutputImage::ImageDimension>>::type GradientImageType;
64 #else
66 #endif
68  typename TOutputImage::ValueType,
69  typename TOutputImage::ValueType,
73 
75  itkNewMacro(Self);
76 
78  itkOverrideGetNameOfClassMacro(LaplacianImageFilter);
79 
80  void
81  SetWeights(const TOutputImage * weights);
82  typename TOutputImage::ConstPointer
83  GetWeights();
84 
85 protected:
87  ~LaplacianImageFilter() override = default;
88 
90  void
91  GenerateData() override;
92 
94  void
95  GenerateOutputInformation() override;
96 
100 };
101 } // namespace rtk
102 
103 
104 #ifndef ITK_MANUAL_INSTANTIATION
105 # include "rtkLaplacianImageFilter.hxx"
106 #endif
107 
108 #endif
MultiplyImageFilterType::Pointer m_Multiply
Computes the gradient of an image using forward difference.
typename TOutputImage::Pointer OutputImagePointer
DivergenceFilterType::Pointer m_Divergence
std::conditional< std::is_same< TOutputImage, CPUImageType >::value, itk::Image< VectorPixelType, TOutputImage::ImageDimension >, itk::CudaImage< VectorPixelType, TOutputImage::ImageDimension > >::type GradientImageType
Computes the backward differences divergence (adjoint of the forward differences gradient) of the inp...
GradientFilterType::Pointer m_Gradient