RTK  1.4.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  * 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 
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_EXPORT SumOfSquaresImageFilter :
38  public itk::InPlaceImageFilter<TOutputImage>
39 {
40 public:
46  typedef typename TOutputImage::PixelType OutputPixelType;
47  typedef typename TOutputImage::RegionType OutputImageRegionType;
48  typedef typename TOutputImage::InternalPixelType OutputInternalPixelType;
49 
51  itkNewMacro(Self);
52 
55 
57  itkGetMacro(SumOfSquares, OutputInternalPixelType);
58 
59 protected:
61  ~SumOfSquaresImageFilter() ITK_OVERRIDE {}
62 
63  void BeforeThreadedGenerateData();
64  void ThreadedGenerateData( const OutputImageRegionType& outputRegionForThread, itk::ThreadIdType threadId ) ITK_OVERRIDE;
65  void AfterThreadedGenerateData();
66 
67  OutputInternalPixelType m_SumOfSquares;
68  std::vector<OutputInternalPixelType> m_VectorOfPartialSSs;
69 
70 private:
71  SumOfSquaresImageFilter(const Self&); //purposely not implemented
72  void operator=(const Self&); //purposely not implemented
73 };
74 
75 } // end namespace rtk
76 
77 #ifndef ITK_MANUAL_INSTANTIATION
78 #include "rtkSumOfSquaresImageFilter.hxx"
79 #endif
80 
81 #endif
OutputInternalPixelType m_SumOfSquares
TOutputImage::InternalPixelType OutputInternalPixelType
TOutputImage::PixelType OutputPixelType
TOutputImage::RegionType OutputImageRegionType
itk::InPlaceImageFilter< TOutputImage > Superclass
unsigned int ThreadIdType
std::vector< OutputInternalPixelType > m_VectorOfPartialSSs
itk::SmartPointer< const Self > ConstPointer