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  itkOverrideGetNameOfClassMacro(SumOfSquaresImageFilter);
56 
58  itkGetMacro(SumOfSquares, OutputInternalPixelType);
59 
60 protected:
62  ~SumOfSquaresImageFilter() override = default;
63 
64  void
65  BeforeThreadedGenerateData();
66  void
67  ThreadedGenerateData(const OutputImageRegionType & outputRegionForThread, itk::ThreadIdType threadId) override;
68  void
69  AfterThreadedGenerateData();
70 
72  std::vector<OutputInternalPixelType> m_VectorOfPartialSSs;
73 };
74 
75 } // end namespace rtk
76 
77 #ifndef ITK_MANUAL_INSTANTIATION
78 # include "rtkSumOfSquaresImageFilter.hxx"
79 #endif
80 
81 #endif
OutputInternalPixelType m_SumOfSquares
typename TOutputImage::PixelType OutputPixelType
unsigned int ThreadIdType
typename TOutputImage::RegionType OutputImageRegionType
std::vector< OutputInternalPixelType > m_VectorOfPartialSSs
typename TOutputImage::InternalPixelType OutputInternalPixelType