ITK  5.0.0
Insight Segmentation and Registration Toolkit
itkNeighborhoodOperatorImageFilter.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright Insight Software 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 #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:
52  public ImageToImageFilter< TInputImage, TOutputImage >
53 {
54 public:
55  ITK_DISALLOW_COPY_AND_ASSIGN(NeighborhoodOperatorImageFilter);
56 
62 
64  itkNewMacro(Self);
65 
68 
71  using OutputPixelType = typename TOutputImage::PixelType;
72  using OutputInternalPixelType = typename TOutputImage::InternalPixelType;
73  using InputPixelType = typename TInputImage::PixelType;
74  using InputInternalPixelType = typename TInputImage::InternalPixelType;
75  using OperatorValueType = TOperatorValueType;
76 
79 
82  static constexpr unsigned int ImageDimension = TOutputImage::ImageDimension;
83  static constexpr unsigned int InputImageDimension = TInputImage::ImageDimension;
84 
86  using InputImageType = TInputImage;
87  using OutputImageType = TOutputImage;
88  using InputImagePointer = typename InputImageType::Pointer;
89 
92 
95 
97  using OutputImageRegionType = typename Superclass::OutputImageRegionType;
98 
101  Self::ImageDimension >;
102 
107  {
108  m_Operator = p;
109  this->Modified();
110  }
112 
115  { return m_Operator; }
116 
123  { m_BoundsCondition = i; }
124 
127  { return m_BoundsCondition; }
128 
136  void GenerateInputRequestedRegion() override;
137 
138 #ifdef ITK_USE_CONCEPT_CHECKING
139  // Begin concept checking
140  itkConceptMacro( SameDimensionCheck,
142  itkConceptMacro( OperatorConvertibleToOutputCheck,
144  itkConceptMacro( InputConvertibleToOperatorCheck,
146  itkConceptMacro( OperatorMultiplyOperatorCheck,
148  itkConceptMacro( OperatorAdditiveOperatorsCheck,
150  // End concept checking
151 #endif
152 
153 protected:
155  {
156  m_BoundsCondition = static_cast< ImageBoundaryConditionPointerType >( &m_DefaultBoundaryCondition );
157  this->DynamicMultiThreadingOn();
158  }
159  ~NeighborhoodOperatorImageFilter() override = default;
160 
172  void DynamicThreadedGenerateData(const OutputImageRegionType & outputRegionForThread) override;
173 
174 
175  void PrintSelf(std::ostream & os, Indent indent) const override
176  { Superclass::PrintSelf(os, indent); }
177 
178 private:
181 
185 
188 };
189 } // end namespace itk
190 
191 #ifndef ITK_MANUAL_INSTANTIATION
192 #include "itkNeighborhoodOperatorImageFilter.hxx"
193 #endif
194 
195 #endif
ImageBoundaryConditionPointerType GetBoundaryCondition()
typename NumericTraits< OutputPixelType >::RealType ComputingPixelType
Define numeric traits for std::vector.
The base class for all process objects (source, filters, mappers) in the Insight data processing pipe...
void PrintSelf(std::ostream &os, Indent indent) const override
Base class for all process objects that output image data.
typename InputImageType::Pointer InputImagePointer
const OutputNeighborhoodType & GetOperator() const
typename OutputImageType::RegionType OutputImageRegionType
TOutputImage OutputImageType
typename NumericTraits< InputPixelType >::ValueType InputPixelValueType
void SetOperator(const OutputNeighborhoodType &p)
typename TInputImage::InternalPixelType InputInternalPixelType
Base class for filters that take an image as input and produce an image as output.
Control indentation during Print() invocation.
Definition: itkIndent.h:49
Applies a single NeighborhoodOperator to an image region.
#define itkConceptMacro(name, concept)
void OverrideBoundaryCondition(const ImageBoundaryConditionPointerType i)
typename TOutputImage::InternalPixelType OutputInternalPixelType