ITK  5.2.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  * 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 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 TOuputPixel>
51 {
52 public:
54  ~SumAccumulator() = default;
55 
56  inline void
58  {
60  }
61 
62  inline void
63  operator()(const TInputPixel & input)
64  {
65  m_Sum = m_Sum + input;
66  }
67 
68  inline TOuputPixel
70  {
71  return m_Sum;
72  }
73 
74  TOuputPixel 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 
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
TOuputPixel GetValue()
Definition: itkSumProjectionImageFilter.h:69
itkProjectionImageFilter.h
itk::Concept::HasNumericTraits
Definition: itkConceptChecking.h:712
itk::Functor::SumAccumulator::~SumAccumulator
~SumAccumulator()=default
itkConceptChecking.h
itk::Functor::SumAccumulator::Initialize
void Initialize()
Definition: itkSumProjectionImageFilter.h:57
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::m_Sum
TOuputPixel m_Sum
Definition: itkSumProjectionImageFilter.h:74
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::NumericTraits::ZeroValue
static T ZeroValue()
Definition: itkNumericTraits.h:148
itk::Concept::AdditiveOperators
Definition: itkConceptChecking.h:356
itk::Functor::SumAccumulator::operator()
void operator()(const TInputPixel &input)
Definition: itkSumProjectionImageFilter.h:63
itkConceptMacro
#define itkConceptMacro(name, concept)
Definition: itkConceptChecking.h:64
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:138
itk::SumProjectionImageFilter::~SumProjectionImageFilter
~SumProjectionImageFilter() override=default
itk::Functor::SumAccumulator::SumAccumulator
SumAccumulator(SizeValueType)
Definition: itkSumProjectionImageFilter.h:53
itk::SizeValueType
unsigned long SizeValueType
Definition: itkIntTypes.h:83
itk::ImageSource::OutputImageType
TOutputImage OutputImageType
Definition: itkImageSource.h:90