RTK  1.4.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 
66  void ResetIterations();
67 
68 protected:
69  NesterovUpdateImageFilter();
70  virtual ~NesterovUpdateImageFilter() ITK_OVERRIDE;
71 
73  void BeforeThreadedGenerateData() ITK_OVERRIDE;
74 #if ITK_VERSION_MAJOR<5
75  void ThreadedGenerateData(const OutputImageRegionType& outputRegionForThread, itk::ThreadIdType itkNotUsed(threadId)) ITK_OVERRIDE;
76 #else
77  void DynamicThreadedGenerateData(const OutputImageRegionType& outputRegionForThread) ITK_OVERRIDE;
78 #endif
79  void AfterThreadedGenerateData() ITK_OVERRIDE;
81 
82  void GenerateInputRequestedRegion() ITK_OVERRIDE;
83 
87  std::vector<typename TImage::PixelType::ValueType> m_tCoeffs;
88  std::vector<typename TImage::PixelType::ValueType> m_Sums;
89  std::vector<typename TImage::PixelType::ValueType> m_Ratios;
90 
91  // Internal images
92  typename TImage::Pointer m_Vk;
93  typename TImage::Pointer m_Zk;
94 
95 private:
96  NesterovUpdateImageFilter(const Self &); //purposely not implemented
97  void operator=(const Self &); //purposely not implemented
98 };
99 } //namespace RTK
100 
101 
102 #ifndef ITK_MANUAL_INSTANTIATION
103 #include "rtkNesterovUpdateImageFilter.hxx"
104 #endif
105 
106 #endif
typename Superclass::PixelType PixelType
Applies Nesterov&#39;s momentum technique.
Superclass::OutputImageType::RegionType OutputImageRegionType
void AfterThreadedGenerateData() override
STL namespace.
void BeforeThreadedGenerateData() override
void GenerateInputRequestedRegion() override
std::vector< typename TImage::PixelType::ValueType > m_Sums
std::vector< typename TImage::PixelType::ValueType > m_Ratios
unsigned int ThreadIdType
itk::InPlaceImageFilter< TImage, TImage > Superclass
void ThreadedGenerateData(const OutputImageRegionType &outputRegionForThread, itk::ThreadIdType) override
std::vector< typename TImage::PixelType::ValueType > m_tCoeffs
#define itkSetMacro(name, type)