RTK  2.5.0
Reconstruction Toolkit
rtkNesterovUpdateImageFilter.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 rtkNesterovUpdateImageFilter_h
20 #define rtkNesterovUpdateImageFilter_h
21 
22 #include "itkInPlaceImageFilter.h"
23 
24 namespace rtk
25 {
26 
41 template <typename TImage>
42 class ITK_TEMPLATE_EXPORT NesterovUpdateImageFilter : public itk::InPlaceImageFilter<TImage, TImage>
43 {
44 public:
45  ITK_DISALLOW_COPY_AND_MOVE(NesterovUpdateImageFilter);
46 
51 
53  using OutputImageRegionType = typename Superclass::OutputImageType::RegionType;
54 
56  itkNewMacro(Self);
57 
59 #ifdef itkOverrideGetNameOfClassMacro
60  itkOverrideGetNameOfClassMacro(NesterovUpdateImageFilter);
61 #else
63 #endif
64 
65 
67  itkGetMacro(NumberOfIterations, int);
68  itkSetMacro(NumberOfIterations, int);
70 
71 protected:
73  ~NesterovUpdateImageFilter() override;
74 
76  void
77  BeforeThreadedGenerateData() override;
78  void
79  DynamicThreadedGenerateData(const OutputImageRegionType & outputRegionForThread) override;
80  void
81  AfterThreadedGenerateData() override;
83 
84  void
85  GenerateInputRequestedRegion() override;
86 
90  typename TImage::PixelType::ValueType m_TCoeff;
91  typename TImage::PixelType::ValueType m_TCoeffNext;
92  typename TImage::PixelType::ValueType m_Sum;
93  typename TImage::PixelType::ValueType m_Ratio;
94 
95  // Internal images
96  typename TImage::Pointer m_Vk;
97  typename TImage::Pointer m_Alphak;
98 };
99 } // namespace rtk
100 
101 
102 #ifndef ITK_MANUAL_INSTANTIATION
103 # include "rtkNesterovUpdateImageFilter.hxx"
104 #endif
105 
106 #endif
TImage::PixelType::ValueType m_TCoeffNext
TImage::PixelType::ValueType m_TCoeff
Applies Nesterov&#39;s momentum technique.
#define itkSetMacro(name, type)
typename OutputImageType::RegionType OutputImageRegionType
TImage::PixelType::ValueType m_Ratio