ITK  5.4.0
Insight Toolkit
itkNeighborhoodOperatorImageFilter.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 itkNeighborhoodOperatorImageFilter_h
19#define itkNeighborhoodOperatorImageFilter_h
20
23#include "itkImage.h"
25
26namespace itk
27{
50template <typename TInputImage, typename TOutputImage, typename TOperatorValueType = typename TOutputImage::PixelType>
51class ITK_TEMPLATE_EXPORT NeighborhoodOperatorImageFilter : public ImageToImageFilter<TInputImage, TOutputImage>
52{
53public:
54 ITK_DISALLOW_COPY_AND_MOVE(NeighborhoodOperatorImageFilter);
55
61
63 itkNewMacro(Self);
64
66 itkOverrideGetNameOfClassMacro(NeighborhoodOperatorImageFilter);
67
70 using OutputPixelType = typename TOutputImage::PixelType;
71 using OutputInternalPixelType = typename TOutputImage::InternalPixelType;
72 using InputPixelType = typename TInputImage::PixelType;
73 using InputInternalPixelType = typename TInputImage::InternalPixelType;
74 using OperatorValueType = TOperatorValueType;
75
78
81 static constexpr unsigned int ImageDimension = TOutputImage::ImageDimension;
82 static constexpr unsigned int InputImageDimension = TInputImage::ImageDimension;
83
85 using InputImageType = TInputImage;
86 using OutputImageType = TOutputImage;
88
91
94
96 using typename Superclass::OutputImageRegionType;
97
100
104 void
106 {
107 m_Operator = p;
108 this->Modified();
109 }
113 const OutputNeighborhoodType &
115 {
116 return m_Operator;
117 }
118
124 void
126 {
127 m_BoundsCondition = i;
128 }
129
131 ImageBoundaryConditionPointerType
133 {
134 return m_BoundsCondition;
135 }
136
144 void
146
147#ifdef ITK_USE_CONCEPT_CHECKING
148 // Begin concept checking
152 itkConceptMacro(OperatorMultiplyOperatorCheck, (Concept::MultiplyOperator<OperatorValueType>));
153 itkConceptMacro(OperatorAdditiveOperatorsCheck, (Concept::AdditiveOperators<OperatorValueType>));
154 // End concept checking
155#endif
156
157protected:
159 {
160 m_BoundsCondition = static_cast<ImageBoundaryConditionPointerType>(&m_DefaultBoundaryCondition);
161 this->DynamicMultiThreadingOn();
162 this->ThreaderUpdateProgressOff();
163 }
165
177 void
178 DynamicThreadedGenerateData(const OutputImageRegionType & outputRegionForThread) override;
179
180
181 void
182 PrintSelf(std::ostream & os, Indent indent) const override
183 {
184 Superclass::PrintSelf(os, indent);
185 }
186
187private:
190
194
196 DefaultBoundaryCondition m_DefaultBoundaryCondition{};
197};
198} // end namespace itk
199
200#ifndef ITK_MANUAL_INSTANTIATION
201# include "itkNeighborhoodOperatorImageFilter.hxx"
202#endif
203
204#endif
Base class for all process objects that output image data.
typename OutputImageType::RegionType OutputImageRegionType
TOutputImage OutputImageType
Base class for filters that take an image as input and produce an image as output.
typename InputImageType::Pointer InputImagePointer
Control indentation during Print() invocation.
Definition: itkIndent.h:50
Applies a single NeighborhoodOperator to an image region.
ImageBoundaryConditionPointerType GetBoundaryCondition()
void PrintSelf(std::ostream &os, Indent indent) const override
~NeighborhoodOperatorImageFilter() override=default
typename TInputImage::InternalPixelType InputInternalPixelType
typename NumericTraits< InputPixelType >::ValueType InputPixelValueType
void GenerateInputRequestedRegion() override
typename TOutputImage::InternalPixelType OutputInternalPixelType
void OverrideBoundaryCondition(const ImageBoundaryConditionPointerType i)
void DynamicThreadedGenerateData(const OutputImageRegionType &outputRegionForThread) override
void SetOperator(const OutputNeighborhoodType &p)
typename NumericTraits< OutputPixelType >::RealType ComputingPixelType
const OutputNeighborhoodType & GetOperator() const
Define additional traits for native types such as int or float.
The base class for all process objects (source, filters, mappers) in the Insight data processing pipe...
SmartPointer< Self > Pointer
#define itkConceptMacro(name, concept)
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....