RTK  2.0.1
Reconstruction Toolkit
rtkAddMatrixAndDiagonalImageFilter.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 rtkAddMatrixAndDiagonalImageFilter_h
19 #define rtkAddMatrixAndDiagonalImageFilter_h
20 
21 #include "itkImageToImageFilter.h"
22 #include "rtkMacro.h"
23 
24 namespace rtk
25 {
40 template< class TDiagonal,
43 {
44 public:
45  ITK_DISALLOW_COPY_AND_ASSIGN(AddMatrixAndDiagonalImageFilter);
46 
51 
53  itkNewMacro(Self)
54 
55 
57 
59  static constexpr unsigned int nChannels = TDiagonal::PixelType::Dimension;
60 
62  using dataType = typename TDiagonal::PixelType::ValueType;
63 
65  void SetInputDiagonal(const TDiagonal* gradient);
66  void SetInputMatrix(const TMatrix* hessian);
68 
69 protected:
70  AddMatrixAndDiagonalImageFilter();
71  ~AddMatrixAndDiagonalImageFilter() override = default;
72 
73  void GenerateInputRequestedRegion() override;
74 
76 #if ITK_VERSION_MAJOR<5
77  void ThreadedGenerateData(const typename TDiagonal::RegionType& outputRegionForThread, itk::ThreadIdType threadId) override;
78 #else
79  void DynamicThreadedGenerateData(const typename TDiagonal::RegionType& outputRegionForThread) override;
80 #endif
81 
82 
84  typename TDiagonal::ConstPointer GetInputDiagonal();
85  typename TMatrix::ConstPointer GetInputMatrix();
87 
88 };
89 } //namespace RTK
90 
91 
92 #ifndef ITK_MANUAL_INSTANTIATION
93 #include "rtkAddMatrixAndDiagonalImageFilter.hxx"
94 #endif
95 
96 #endif
typename TDiagonal::PixelType::ValueType dataType
TMatrix::ConstPointer GetInputMatrix()
TDiagonal::ConstPointer GetInputDiagonal()
void ThreadedGenerateData(const typename TDiagonal::RegionType &outputRegionForThread, itk::ThreadIdType threadId) override
virtual void DynamicThreadedGenerateData(const OutputImageRegionType &outputRegionForThread)
void GenerateInputRequestedRegion() override
void SetInputMatrix(const TMatrix *hessian)
For each vector-valued pixel, adds a vector to the diagonal of a matrix.
unsigned int ThreadIdType
void SetInputDiagonal(const TDiagonal *gradient)