ITK  6.0.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 * 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 itkMaskNeighborhoodOperatorImageFilter_h
19#define itkMaskNeighborhoodOperatorImageFilter_h
20
22
23namespace itk
24{
50template <typename TInputImage,
51 typename TMaskImage,
52 typename TOutputImage,
53 typename TOperatorValueType = typename TOutputImage::PixelType>
54class ITK_TEMPLATE_EXPORT MaskNeighborhoodOperatorImageFilter
55 : public NeighborhoodOperatorImageFilter<TInputImage, TOutputImage, TOperatorValueType>
56{
57public:
58 ITK_DISALLOW_COPY_AND_MOVE(MaskNeighborhoodOperatorImageFilter);
59
66
68 itkNewMacro(Self);
69
71 itkOverrideGetNameOfClassMacro(MaskNeighborhoodOperatorImageFilter);
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;
94
97
99 using typename Superclass::OutputImageRegionType;
100 using typename Superclass::OperatorValueType;
101
103 using 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
148protected:
150 : m_DefaultValue(OutputPixelType{})
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
179private:
180 OutputPixelType m_DefaultValue{};
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
Base class for all process objects that output image data.
typename OutputImageType::RegionType OutputImageRegionType
TOutputImage OutputImageType
typename InputImageType::Pointer InputImagePointer
Control indentation during Print() invocation.
Definition: itkIndent.h:50
Applies a single NeighborhoodOperator to an image, processing only those pixels that are under a mask...
typename TMaskImage::InternalPixelType MaskInternalPixelType
typename TInputImage::InternalPixelType InputInternalPixelType
typename TOutputImage::InternalPixelType OutputInternalPixelType
Applies a single NeighborhoodOperator to an image region.
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....