RTK  2.0.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  * 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 
50 
52  typedef typename Superclass::OutputImageType::RegionType OutputImageRegionType;
53 
55  itkNewMacro(Self)
56 
57 
59 
61  itkGetMacro(NumberOfIterations, int)
62  itkSetMacro(NumberOfIterations, int)
63 
64 protected:
65  NesterovUpdateImageFilter();
66  virtual ~NesterovUpdateImageFilter() ITK_OVERRIDE;
67 
69  void BeforeThreadedGenerateData() ITK_OVERRIDE;
70 #if ITK_VERSION_MAJOR<5
71  void ThreadedGenerateData(const OutputImageRegionType& outputRegionForThread, itk::ThreadIdType itkNotUsed(threadId)) ITK_OVERRIDE;
72 #else
73  void DynamicThreadedGenerateData(const OutputImageRegionType& outputRegionForThread) ITK_OVERRIDE;
74 #endif
75  void AfterThreadedGenerateData() ITK_OVERRIDE;
77 
78  void GenerateInputRequestedRegion() ITK_OVERRIDE;
79 
83  typename TImage::PixelType::ValueType m_tCoeff;
84  typename TImage::PixelType::ValueType m_tCoeffNext;
85  typename TImage::PixelType::ValueType m_Sum;
86  typename TImage::PixelType::ValueType m_Ratio;
87 
88  // Internal images
89  typename TImage::Pointer m_Vk;
90  typename TImage::Pointer m_Alphak;
91 
92 private:
93  NesterovUpdateImageFilter(const Self &); //purposely not implemented
94  void operator=(const Self &); //purposely not implemented
95 };
96 } //namespace RTK
97 
98 
99 #ifndef ITK_MANUAL_INSTANTIATION
100 #include "rtkNesterovUpdateImageFilter.hxx"
101 #endif
102 
103 #endif
Applies Nesterov&#39;s momentum technique.
Superclass::OutputImageType::RegionType OutputImageRegionType
void AfterThreadedGenerateData() override
TImage::PixelType::ValueType m_tCoeff
void BeforeThreadedGenerateData() override
void GenerateInputRequestedRegion() override
unsigned int ThreadIdType
itk::InPlaceImageFilter< TImage, TImage > Superclass
TImage::PixelType::ValueType m_tCoeffNext
void ThreadedGenerateData(const OutputImageRegionType &outputRegionForThread, itk::ThreadIdType) override
TImage::PixelType::ValueType m_Ratio
#define itkSetMacro(name, type)