ITK  5.4.0
Insight Toolkit
itkSumProjectionImageFilter.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright NumFOCUS
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 #ifndef itkSumProjectionImageFilter_h
19 #define itkSumProjectionImageFilter_h
20 
22 #include "itkConceptChecking.h"
23 
24 namespace itk
25 {
47 namespace Functor
48 {
49 template <typename TInputPixel, typename TOutputPixel>
51 {
52 public:
54  ~SumAccumulator() = default;
55 
56  inline void
58  {
59  m_Sum = TOutputPixel{};
60  }
61 
62  inline void
63  operator()(const TInputPixel & input)
64  {
65  m_Sum = m_Sum + input;
66  }
67 
68  inline TOutputPixel
70  {
71  return m_Sum;
72  }
73 
74  TOutputPixel m_Sum;
75 };
76 } // namespace Functor
77 
78 template <typename TInputImage, typename TOutputImage>
80  : public ProjectionImageFilter<
81  TInputImage,
82  TOutputImage,
83  Functor::SumAccumulator<typename TInputImage::PixelType, typename TOutputImage::PixelType>>
84 {
85 public:
86  ITK_DISALLOW_COPY_AND_MOVE(SumProjectionImageFilter);
87 
89  using Superclass =
90  ProjectionImageFilter<TInputImage,
91  TOutputImage,
93 
94  using InputImageType = TInputImage;
95  using InputPixelType = typename InputImageType::PixelType;
96 
97  using OutputImageType = TOutputImage;
98  using OutputPixelType = typename OutputImageType::PixelType;
99 
102 
104  itkOverrideGetNameOfClassMacro(SumProjectionImageFilter);
105 
107  itkNewMacro(Self);
108 
109 #ifdef ITK_USE_CONCEPT_CHECKING
110  // Begin concept checking
111  itkConceptMacro(InputPixelToOutputPixelTypeGreaterAdditiveOperatorCheck,
113  itkConceptMacro(InputHasNumericTraitsCheck, (Concept::HasNumericTraits<InputPixelType>));
114  // End concept checking
115 #endif
116 
117 protected:
118  SumProjectionImageFilter() = default;
119  ~SumProjectionImageFilter() override = default;
120 }; // end SumProjectionImageFilter
121 } // end namespace itk
122 
123 #endif
itk::Functor::SumAccumulator::GetValue
TOutputPixel GetValue()
Definition: itkSumProjectionImageFilter.h:69
itkProjectionImageFilter.h
itk::Concept::HasNumericTraits
Definition: itkConceptChecking.h:714
itk::Functor::SumAccumulator::SumAccumulator
SumAccumulator(SizeValueType)
Definition: itkSumProjectionImageFilter.h:53
itk::Functor::SumAccumulator::m_Sum
TOutputPixel m_Sum
Definition: itkSumProjectionImageFilter.h:74
itkConceptChecking.h
itk::Functor::SumAccumulator::~SumAccumulator
~SumAccumulator()=default
itk::SmartPointer< Self >
itk::SumProjectionImageFilter
Sum projection.
Definition: itkSumProjectionImageFilter.h:79
itk::ProjectionImageFilter
Implements an accumulation of an image along a selected direction.
Definition: itkProjectionImageFilter.h:57
itk::ImageSource
Base class for all process objects that output image data.
Definition: itkImageSource.h:67
itk::Functor::SumAccumulator::Initialize
void Initialize()
Definition: itkSumProjectionImageFilter.h:57
itk::SumProjectionImageFilter::OutputPixelType
typename OutputImageType::PixelType OutputPixelType
Definition: itkSumProjectionImageFilter.h:98
itk::Functor::SumAccumulator
Definition: itkSumProjectionImageFilter.h:50
itk::SumProjectionImageFilter::InputPixelType
typename InputImageType::PixelType InputPixelType
Definition: itkSumProjectionImageFilter.h:95
itk::ImageToImageFilter::InputImageType
TInputImage InputImageType
Definition: itkImageToImageFilter.h:129
itk::Concept::AdditiveOperators
Definition: itkConceptChecking.h:358
itkConceptMacro
#define itkConceptMacro(name, concept)
Definition: itkConceptChecking.h:65
itk::Functor::SumAccumulator::operator()
void operator()(const TInputPixel &input)
Definition: itkSumProjectionImageFilter.h:63
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkAnnulusOperator.h:24
itk::SumProjectionImageFilter::SumProjectionImageFilter
SumProjectionImageFilter()=default
itk::ProcessObject
The base class for all process objects (source, filters, mappers) in the Insight data processing pipe...
Definition: itkProcessObject.h:139
itk::SumProjectionImageFilter::~SumProjectionImageFilter
~SumProjectionImageFilter() override=default
itk::SizeValueType
unsigned long SizeValueType
Definition: itkIntTypes.h:83
itk::ImageSource::OutputImageType
TOutputImage OutputImageType
Definition: itkImageSource.h:90