ITK  5.2.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  * 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 itkNeighborhoodOperatorImageFilter_h
19 #define itkNeighborhoodOperatorImageFilter_h
20 
21 #include "itkImageToImageFilter.h"
23 #include "itkImage.h"
25 
26 namespace itk
27 {
50 template <typename TInputImage, typename TOutputImage, typename TOperatorValueType = typename TOutputImage::PixelType>
51 class ITK_TEMPLATE_EXPORT NeighborhoodOperatorImageFilter : public ImageToImageFilter<TInputImage, TOutputImage>
52 {
53 public:
54  ITK_DISALLOW_COPY_AND_ASSIGN(NeighborhoodOperatorImageFilter);
55 
61 
63  itkNewMacro(Self);
64 
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;
87  using InputImagePointer = typename InputImageType::Pointer;
88 
91 
94 
96  using OutputImageRegionType = typename Superclass::OutputImageRegionType;
97 
100 
104  void
106  {
107  m_Operator = p;
108  this->Modified();
109  }
111 
113  const OutputNeighborhoodType &
114  GetOperator() const
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
145  GenerateInputRequestedRegion() override;
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 
157 protected:
159  {
160  m_BoundsCondition = static_cast<ImageBoundaryConditionPointerType>(&m_DefaultBoundaryCondition);
161  this->DynamicMultiThreadingOn();
162  this->ThreaderUpdateProgressOff();
163  }
164  ~NeighborhoodOperatorImageFilter() override = default;
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 
187 private:
190 
194 
197 };
198 } // end namespace itk
199 
200 #ifndef ITK_MANUAL_INSTANTIATION
201 # include "itkNeighborhoodOperatorImageFilter.hxx"
202 #endif
203 
204 #endif
itk::NeighborhoodOperatorImageFilter::InputPixelValueType
typename NumericTraits< InputPixelType >::ValueType InputPixelValueType
Definition: itkNeighborhoodOperatorImageFilter.h:76
itk::NeighborhoodOperatorImageFilter::m_BoundsCondition
ImageBoundaryConditionPointerType m_BoundsCondition
Definition: itkNeighborhoodOperatorImageFilter.h:193
itkNeighborhoodOperator.h
itk::Neighborhood< OperatorValueType, Self::ImageDimension >
itkImage.h
itk::SmartPointer< Self >
itk::Indent
Control indentation during Print() invocation.
Definition: itkIndent.h:49
itk::NeighborhoodOperatorImageFilter::ComputingPixelType
typename NumericTraits< OutputPixelType >::RealType ComputingPixelType
Definition: itkNeighborhoodOperatorImageFilter.h:77
itk::NeighborhoodOperatorImageFilter::OperatorValueType
TOperatorValueType OperatorValueType
Definition: itkNeighborhoodOperatorImageFilter.h:74
itk::Concept::SameDimension
Definition: itkConceptChecking.h:692
itk::ImageBoundaryCondition< InputImageType >
itk::NeighborhoodOperatorImageFilter::OutputPixelType
typename TOutputImage::PixelType OutputPixelType
Definition: itkNeighborhoodOperatorImageFilter.h:70
itk::ImageToImageFilter
Base class for filters that take an image as input and produce an image as output.
Definition: itkImageToImageFilter.h:108
itk::ImageSource
Base class for all process objects that output image data.
Definition: itkImageSource.h:67
itk::NeighborhoodOperatorImageFilter::NeighborhoodOperatorImageFilter
NeighborhoodOperatorImageFilter()
Definition: itkNeighborhoodOperatorImageFilter.h:158
itk::ImageToImageFilter::InputImagePointer
typename InputImageType::Pointer InputImagePointer
Definition: itkImageToImageFilter.h:130
itk::NeighborhoodOperatorImageFilter::GetOperator
const OutputNeighborhoodType & GetOperator() const
Definition: itkNeighborhoodOperatorImageFilter.h:114
itk::NeighborhoodOperatorImageFilter::m_DefaultBoundaryCondition
DefaultBoundaryCondition m_DefaultBoundaryCondition
Definition: itkNeighborhoodOperatorImageFilter.h:196
itk::NeighborhoodOperatorImageFilter::OverrideBoundaryCondition
void OverrideBoundaryCondition(const ImageBoundaryConditionPointerType i)
Definition: itkNeighborhoodOperatorImageFilter.h:125
itk::ImageToImageFilter::InputImageType
TInputImage InputImageType
Definition: itkImageToImageFilter.h:129
itkImageToImageFilter.h
itk::NeighborhoodOperatorImageFilter::PrintSelf
void PrintSelf(std::ostream &os, Indent indent) const override
Definition: itkNeighborhoodOperatorImageFilter.h:182
itk::Concept::MultiplyOperator
Definition: itkConceptChecking.h:417
itk::NumericTraits
Define additional traits for native types such as int or float.
Definition: itkNumericTraits.h:58
itk::ImageSource::OutputImageRegionType
typename OutputImageType::RegionType OutputImageRegionType
Definition: itkImageSource.h:92
itk::Concept::AdditiveOperators
Definition: itkConceptChecking.h:356
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::NeighborhoodOperatorImageFilter::SetOperator
void SetOperator(const OutputNeighborhoodType &p)
Definition: itkNeighborhoodOperatorImageFilter.h:105
itk::NeighborhoodOperatorImageFilter::InputPixelType
typename TInputImage::PixelType InputPixelType
Definition: itkNeighborhoodOperatorImageFilter.h:72
itk::NeighborhoodOperatorImageFilter::OutputInternalPixelType
typename TOutputImage::InternalPixelType OutputInternalPixelType
Definition: itkNeighborhoodOperatorImageFilter.h:71
itk::ProcessObject
The base class for all process objects (source, filters, mappers) in the Insight data processing pipe...
Definition: itkProcessObject.h:138
itk::Concept::Convertible
Definition: itkConceptChecking.h:214
itk::NeighborhoodOperatorImageFilter::GetBoundaryCondition
ImageBoundaryConditionPointerType GetBoundaryCondition()
Definition: itkNeighborhoodOperatorImageFilter.h:132
itk::ZeroFluxNeumannBoundaryCondition< InputImageType >
itk::NeighborhoodOperatorImageFilter
Applies a single NeighborhoodOperator to an image region.
Definition: itkNeighborhoodOperatorImageFilter.h:51
itkZeroFluxNeumannBoundaryCondition.h
itk::NeighborhoodOperatorImageFilter::m_Operator
OutputNeighborhoodType m_Operator
Definition: itkNeighborhoodOperatorImageFilter.h:189
itk::NeighborhoodOperatorImageFilter::InputInternalPixelType
typename TInputImage::InternalPixelType InputInternalPixelType
Definition: itkNeighborhoodOperatorImageFilter.h:73
itk::ImageSource::OutputImageType
TOutputImage OutputImageType
Definition: itkImageSource.h:90