RTK  1.4.0
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:
49 
51  itkNewMacro(Self)
52 
53 
55 
57  itkStaticConstMacro(nChannels, unsigned int, TDiagonal::PixelType::Dimension);
58 
60  typedef typename TDiagonal::PixelType::ValueType dataType;
61 
63  void SetInputDiagonal(const TDiagonal* gradient);
64  void SetInputMatrix(const TMatrix* hessian);
66 
67 protected:
68  AddMatrixAndDiagonalImageFilter();
69  ~AddMatrixAndDiagonalImageFilter() {}
70 
71  void GenerateInputRequestedRegion() ITK_OVERRIDE;
72 
74 #if ITK_VERSION_MAJOR<5
75  void ThreadedGenerateData(const typename TDiagonal::RegionType& outputRegionForThread, itk::ThreadIdType threadId) ITK_OVERRIDE;
76 #else
77  void DynamicThreadedGenerateData(const typename TDiagonal::RegionType& outputRegionForThread) ITK_OVERRIDE;
78 #endif
79 
80 
82  typename TDiagonal::ConstPointer GetInputDiagonal();
83  typename TMatrix::ConstPointer GetInputMatrix();
85 
86 private:
87  AddMatrixAndDiagonalImageFilter(const Self &); //purposely not implemented
88  void operator=(const Self &); //purposely not implemented
89 
90 };
91 } //namespace RTK
92 
93 
94 #ifndef ITK_MANUAL_INSTANTIATION
95 #include "rtkAddMatrixAndDiagonalImageFilter.hxx"
96 #endif
97 
98 #endif
typename Superclass::PixelType PixelType
TMatrix::ConstPointer GetInputMatrix()
TDiagonal::ConstPointer GetInputDiagonal()
void ThreadedGenerateData(const typename TDiagonal::RegionType &outputRegionForThread, itk::ThreadIdType threadId) override
itk::ImageToImageFilter< TMatrix, TMatrix > Superclass
void GenerateInputRequestedRegion() override
void SetInputMatrix(const TMatrix *hessian)
unsigned int ThreadIdType
For each vector-valued pixel, adds a vector to the diagonal of a matrix.
void SetInputDiagonal(const TDiagonal *gradient)