RTK  2.6.0
Reconstruction Toolkit
rtkSumOfSquaresImageFilter.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  * https://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 rtkSumOfSquaresImageFilter_h
20 #define rtkSumOfSquaresImageFilter_h
21 
22 #include <itkInPlaceImageFilter.h>
23 
33 namespace rtk
34 {
35 
36 template <class TOutputImage>
37 class ITK_TEMPLATE_EXPORT SumOfSquaresImageFilter : public itk::InPlaceImageFilter<TOutputImage>
38 {
39 public:
40  ITK_DISALLOW_COPY_AND_MOVE(SumOfSquaresImageFilter);
41 
47  using OutputPixelType = typename TOutputImage::PixelType;
48  using OutputImageRegionType = typename TOutputImage::RegionType;
49  using OutputInternalPixelType = typename TOutputImage::InternalPixelType;
50 
52  itkNewMacro(Self);
53 
55 #ifdef itkOverrideGetNameOfClassMacro
56  itkOverrideGetNameOfClassMacro(SumOfSquaresImageFilter);
57 #else
59 #endif
60 
61 
63  itkGetMacro(SumOfSquares, OutputInternalPixelType);
64 
65 protected:
67  ~SumOfSquaresImageFilter() override = default;
68 
69  void
70  BeforeThreadedGenerateData();
71  void
72  ThreadedGenerateData(const OutputImageRegionType & outputRegionForThread, itk::ThreadIdType threadId) override;
73  void
74  AfterThreadedGenerateData();
75 
77  std::vector<OutputInternalPixelType> m_VectorOfPartialSSs;
78 };
79 
80 } // end namespace rtk
81 
82 #ifndef ITK_MANUAL_INSTANTIATION
83 # include "rtkSumOfSquaresImageFilter.hxx"
84 #endif
85 
86 #endif
OutputInternalPixelType m_SumOfSquares
typename TOutputImage::PixelType OutputPixelType
typename OutputImageType::RegionType OutputImageRegionType
std::vector< OutputInternalPixelType > m_VectorOfPartialSSs
typename TOutputImage::InternalPixelType OutputInternalPixelType
unsigned int ThreadIdType