RTK  1.4.0
Reconstruction Toolkit
rtkGetNewtonUpdateImageFilter.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 #ifndef rtkGetNewtonUpdateImageFilter_h
19 #define rtkGetNewtonUpdateImageFilter_h
20 
21 #include "itkImageToImageFilter.h"
22 #include "rtkMacro.h"
23 
24 namespace rtk
25 {
41 template< class TGradient,
43 class GetNewtonUpdateImageFilter : public itk::ImageToImageFilter<TGradient, TGradient>
44 {
45 public:
50 
52  itkNewMacro(Self)
53 
54 
56 
58  itkStaticConstMacro(nChannels, unsigned int, TGradient::PixelType::Dimension);
59 
61  typedef typename TGradient::PixelType::ValueType dataType;
62 
64  void SetInputGradient(const TGradient* gradient);
65  void SetInputHessian(const THessian* hessian);
67 
68 protected:
69  GetNewtonUpdateImageFilter();
70  ~GetNewtonUpdateImageFilter() {}
71 
72  void GenerateInputRequestedRegion() ITK_OVERRIDE;
73 
75 #if ITK_VERSION_MAJOR<5
76  void ThreadedGenerateData(const typename TGradient::RegionType& outputRegionForThread, itk::ThreadIdType itkNotUsed(threadId)) ITK_OVERRIDE;
77 #else
78  void DynamicThreadedGenerateData(const typename TGradient::RegionType& outputRegionForThread) ITK_OVERRIDE;
79 #endif
80 
81 
83  typename TGradient::ConstPointer GetInputGradient();
84  typename THessian::ConstPointer GetInputHessian();
86 
87 private:
88  GetNewtonUpdateImageFilter(const Self &); //purposely not implemented
89  void operator=(const Self &); //purposely not implemented
90 
91 };
92 } //namespace RTK
93 
94 
95 #ifndef ITK_MANUAL_INSTANTIATION
96 #include "rtkGetNewtonUpdateImageFilter.hxx"
97 #endif
98 
99 #endif
typename Superclass::PixelType PixelType
void SetInputGradient(const TGradient *gradient)
THessian::ConstPointer GetInputHessian()
void GenerateInputRequestedRegion() override
Computes update from gradient and Hessian in Newton&#39;s method.
void ThreadedGenerateData(const typename TGradient::RegionType &outputRegionForThread, itk::ThreadIdType) override
TGradient::PixelType::ValueType dataType
TGradient::ConstPointer GetInputGradient()
unsigned int ThreadIdType
itk::ImageToImageFilter< TGradient, TGradient > Superclass
void operator=(const Self &)
void SetInputHessian(const THessian *hessian)