RTK  2.0.1
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  * http://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 NesterovUpdateImageFilter : public itk::InPlaceImageFilter< TImage, TImage>
43 {
44 public:
45  ITK_DISALLOW_COPY_AND_ASSIGN(NesterovUpdateImageFilter);
46 
51 
53  using OutputImageRegionType = typename Superclass::OutputImageType::RegionType;
54 
56  itkNewMacro(Self)
57 
58 
60 
62  itkGetMacro(NumberOfIterations, int)
63  itkSetMacro(NumberOfIterations, int)
64 
65 protected:
66  NesterovUpdateImageFilter();
67  ~NesterovUpdateImageFilter() override;
68 
70  void BeforeThreadedGenerateData() override;
71 #if ITK_VERSION_MAJOR<5
72  void ThreadedGenerateData(const OutputImageRegionType& outputRegionForThread, itk::ThreadIdType itkNotUsed(threadId)) override;
73 #else
74  void DynamicThreadedGenerateData(const OutputImageRegionType& outputRegionForThread) override;
75 #endif
76  void AfterThreadedGenerateData() override;
78 
79  void GenerateInputRequestedRegion() override;
80 
84  typename TImage::PixelType::ValueType m_tCoeff;
85  typename TImage::PixelType::ValueType m_tCoeffNext;
86  typename TImage::PixelType::ValueType m_Sum;
87  typename TImage::PixelType::ValueType m_Ratio;
88 
89  // Internal images
90  typename TImage::Pointer m_Vk;
91  typename TImage::Pointer m_Alphak;
92 
93 };
94 } //namespace RTK
95 
96 
97 #ifndef ITK_MANUAL_INSTANTIATION
98 #include "rtkNesterovUpdateImageFilter.hxx"
99 #endif
100 
101 #endif
Applies Nesterov&#39;s momentum technique.
void AfterThreadedGenerateData() override
TImage::PixelType::ValueType m_tCoeff
void BeforeThreadedGenerateData() override
void GenerateInputRequestedRegion() override
unsigned int ThreadIdType
typename Superclass::OutputImageType::RegionType OutputImageRegionType
TImage::PixelType::ValueType m_tCoeffNext
void ThreadedGenerateData(const OutputImageRegionType &outputRegionForThread, itk::ThreadIdType) override
TImage::PixelType::ValueType m_Ratio
#define itkSetMacro(name, type)