ITK  5.2.0
Insight Toolkit
itkMaskNeighborhoodOperatorImageFilter.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 itkMaskNeighborhoodOperatorImageFilter_h
19 #define itkMaskNeighborhoodOperatorImageFilter_h
20 
22 
23 namespace itk
24 {
50 template <typename TInputImage,
51  typename TMaskImage,
52  typename TOutputImage,
53  typename TOperatorValueType = typename TOutputImage::PixelType>
54 class ITK_TEMPLATE_EXPORT MaskNeighborhoodOperatorImageFilter
55  : public NeighborhoodOperatorImageFilter<TInputImage, TOutputImage, TOperatorValueType>
56 {
57 public:
58  ITK_DISALLOW_COPY_AND_MOVE(MaskNeighborhoodOperatorImageFilter);
59 
63 
66 
68  itkNewMacro(Self);
69 
72 
75  using OutputPixelType = typename TOutputImage::PixelType;
76  using OutputInternalPixelType = typename TOutputImage::InternalPixelType;
77  using InputPixelType = typename TInputImage::PixelType;
78  using InputInternalPixelType = typename TInputImage::InternalPixelType;
79  using MaskPixelType = typename TMaskImage::PixelType;
80  using MaskInternalPixelType = typename TMaskImage::InternalPixelType;
81 
84  static constexpr unsigned int ImageDimension = TOutputImage::ImageDimension;
85  static constexpr unsigned int InputImageDimension = TInputImage::ImageDimension;
86  static constexpr unsigned int MaskImageDimension = TMaskImage::ImageDimension;
87 
89  using InputImageType = TInputImage;
90  using MaskImageType = TMaskImage;
91  using OutputImageType = TOutputImage;
92  using InputImagePointer = typename InputImageType::Pointer;
93  using MaskImagePointer = typename MaskImageType::Pointer;
94 
97 
99  using OutputImageRegionType = typename Superclass::OutputImageRegionType;
100  using OperatorValueType = typename Superclass::OperatorValueType;
101 
103  using OutputNeighborhoodType = typename Superclass::OutputNeighborhoodType;
104 
108  void
109  SetMaskImage(const TMaskImage * mask);
110 
114  const TMaskImage *
115  GetMaskImage() const;
116 
120  itkSetMacro(DefaultValue, OutputPixelType);
121 
124  itkGetConstMacro(DefaultValue, OutputPixelType);
125 
129  itkSetMacro(UseDefaultValue, bool);
130 
132  itkGetConstReferenceMacro(UseDefaultValue, bool);
133 
135  itkBooleanMacro(UseDefaultValue);
136 
137 #ifdef ITK_USE_CONCEPT_CHECKING
138  // Begin concept checking
139  itkConceptMacro(OutputEqualityComparableCheck, (Concept::EqualityComparable<OutputPixelType>));
145  // End concept checking
146 #endif
147 
148 protected:
150  : m_DefaultValue(NumericTraits<OutputPixelType>::ZeroValue())
151  {}
152  ~MaskNeighborhoodOperatorImageFilter() override = default;
153  void
154  PrintSelf(std::ostream & os, Indent indent) const override;
155 
161  void
162  GenerateInputRequestedRegion() override;
163 
175  void
176  DynamicThreadedGenerateData(const OutputImageRegionType & outputRegionForThread) override;
177 
178 
179 private:
181  bool m_UseDefaultValue{ true };
182 };
183 } // end namespace itk
184 
185 #ifndef ITK_MANUAL_INSTANTIATION
186 # include "itkMaskNeighborhoodOperatorImageFilter.hxx"
187 #endif
188 
189 #endif
itk::MaskNeighborhoodOperatorImageFilter::InputPixelType
typename TInputImage::PixelType InputPixelType
Definition: itkMaskNeighborhoodOperatorImageFilter.h:77
itk::MaskNeighborhoodOperatorImageFilter::MaskImageType
TMaskImage MaskImageType
Definition: itkMaskNeighborhoodOperatorImageFilter.h:90
itk::MaskNeighborhoodOperatorImageFilter::OutputPixelType
typename TOutputImage::PixelType OutputPixelType
Definition: itkMaskNeighborhoodOperatorImageFilter.h:75
itk::Concept::OStreamWritable
Definition: itkConceptChecking.h:636
itk::MaskNeighborhoodOperatorImageFilter::MaskImagePointer
typename MaskImageType::Pointer MaskImagePointer
Definition: itkMaskNeighborhoodOperatorImageFilter.h:93
itk::SmartPointer< Self >
itk::Indent
Control indentation during Print() invocation.
Definition: itkIndent.h:49
itk::Concept::SameDimension
Definition: itkConceptChecking.h:694
itk::ImageBoundaryCondition< OutputImageType >
itk::ImageSource
Base class for all process objects that output image data.
Definition: itkImageSource.h:67
itk::MaskNeighborhoodOperatorImageFilter
Applies a single NeighborhoodOperator to an image, processing only those pixels that are under a mask...
Definition: itkMaskNeighborhoodOperatorImageFilter.h:54
itk::ImageToImageFilter::InputImagePointer
typename InputImageType::Pointer InputImagePointer
Definition: itkImageToImageFilter.h:130
itk::MaskNeighborhoodOperatorImageFilter::m_DefaultValue
OutputPixelType m_DefaultValue
Definition: itkMaskNeighborhoodOperatorImageFilter.h:180
itk::ImageToImageFilter::InputImageType
TInputImage InputImageType
Definition: itkImageToImageFilter.h:129
itkNeighborhoodOperatorImageFilter.h
itk::MaskNeighborhoodOperatorImageFilter::MaskPixelType
typename TMaskImage::PixelType MaskPixelType
Definition: itkMaskNeighborhoodOperatorImageFilter.h:79
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
itkConceptMacro
#define itkConceptMacro(name, concept)
Definition: itkConceptChecking.h:65
itk::MaskNeighborhoodOperatorImageFilter::OutputNeighborhoodType
typename Superclass::OutputNeighborhoodType OutputNeighborhoodType
Definition: itkMaskNeighborhoodOperatorImageFilter.h:103
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkAnnulusOperator.h:24
itk::MaskNeighborhoodOperatorImageFilter::MaskNeighborhoodOperatorImageFilter
MaskNeighborhoodOperatorImageFilter()
Definition: itkMaskNeighborhoodOperatorImageFilter.h:149
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:216
itk::MaskNeighborhoodOperatorImageFilter::InputInternalPixelType
typename TInputImage::InternalPixelType InputInternalPixelType
Definition: itkMaskNeighborhoodOperatorImageFilter.h:78
itk::NeighborhoodOperatorImageFilter
Applies a single NeighborhoodOperator to an image region.
Definition: itkNeighborhoodOperatorImageFilter.h:51
itk::MaskNeighborhoodOperatorImageFilter::OperatorValueType
typename Superclass::OperatorValueType OperatorValueType
Definition: itkMaskNeighborhoodOperatorImageFilter.h:100
itk::MaskNeighborhoodOperatorImageFilter::MaskInternalPixelType
typename TMaskImage::InternalPixelType MaskInternalPixelType
Definition: itkMaskNeighborhoodOperatorImageFilter.h:80
itk::Concept::EqualityComparable
Definition: itkConceptChecking.h:306
itk::MaskNeighborhoodOperatorImageFilter::OutputInternalPixelType
typename TOutputImage::InternalPixelType OutputInternalPixelType
Definition: itkMaskNeighborhoodOperatorImageFilter.h:76
itk::ImageSource::OutputImageType
TOutputImage OutputImageType
Definition: itkImageSource.h:90