ITK  5.0.0
Insight Segmentation and Registration Toolkit
itkMaskNeighborhoodOperatorImageFilter.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 itkMaskNeighborhoodOperatorImageFilter_h
19 #define itkMaskNeighborhoodOperatorImageFilter_h
20 
22 
23 namespace itk
24 {
50 template< typename TInputImage, typename TMaskImage, typename TOutputImage, typename TOperatorValueType =
51  typename TOutputImage::PixelType >
52 class ITK_TEMPLATE_EXPORT MaskNeighborhoodOperatorImageFilter:
53  public NeighborhoodOperatorImageFilter< TInputImage, TOutputImage, TOperatorValueType >
54 {
55 public:
56  ITK_DISALLOW_COPY_AND_ASSIGN(MaskNeighborhoodOperatorImageFilter);
57 
61  TInputImage, TOutputImage, TOperatorValueType >;
62 
65 
67  itkNewMacro(Self);
68 
71 
74  using OutputPixelType = typename TOutputImage::PixelType;
75  using OutputInternalPixelType = typename TOutputImage::InternalPixelType;
76  using InputPixelType = typename TInputImage::PixelType;
77  using InputInternalPixelType = typename TInputImage::InternalPixelType;
78  using MaskPixelType = typename TMaskImage::PixelType;
79  using MaskInternalPixelType = typename TMaskImage::InternalPixelType;
80 
83  static constexpr unsigned int ImageDimension = TOutputImage::ImageDimension;
84  static constexpr unsigned int InputImageDimension = TInputImage::ImageDimension;
85  static constexpr unsigned int MaskImageDimension = TMaskImage::ImageDimension;
86 
88  using InputImageType = TInputImage;
89  using MaskImageType = TMaskImage;
90  using OutputImageType = TOutputImage;
91  using InputImagePointer = typename InputImageType::Pointer;
92  using MaskImagePointer = typename MaskImageType::Pointer;
93 
96 
98  using OutputImageRegionType = typename Superclass::OutputImageRegionType;
99  using OperatorValueType = typename Superclass::OperatorValueType;
100 
102  using OutputNeighborhoodType = typename Superclass::OutputNeighborhoodType;
103 
107  void SetMaskImage(const TMaskImage *mask);
108 
112  const TMaskImage * GetMaskImage() const;
113 
117  itkSetMacro(DefaultValue, OutputPixelType);
118 
121  itkGetConstMacro(DefaultValue, OutputPixelType);
122 
126  itkSetMacro(UseDefaultValue, bool);
127 
129  itkGetConstReferenceMacro(UseDefaultValue, bool);
130 
132  itkBooleanMacro(UseDefaultValue);
133 
134 #ifdef ITK_USE_CONCEPT_CHECKING
135  // Begin concept checking
136  itkConceptMacro( OutputEqualityComparableCheck,
138  itkConceptMacro( SameDimensionCheck1,
140  itkConceptMacro( SameDimensionCheck2,
142  itkConceptMacro( InputConvertibleToOutputCheck,
144  itkConceptMacro( OperatorConvertibleToOutputCheck,
146  itkConceptMacro( OutputOStreamWritable,
148  // End concept checking
149 #endif
150 
151 protected:
153  {}
154  ~MaskNeighborhoodOperatorImageFilter() override = default;
155  void PrintSelf(std::ostream & os, Indent indent) const override;
156 
162  void GenerateInputRequestedRegion() override;
163 
175  void DynamicThreadedGenerateData(const OutputImageRegionType & outputRegionForThread) override;
176 
177 
178 private:
180  bool m_UseDefaultValue{true};
181 };
182 } // end namespace itk
183 
184 #ifndef ITK_MANUAL_INSTANTIATION
185 #include "itkMaskNeighborhoodOperatorImageFilter.hxx"
186 #endif
187 
188 #endif
Define numeric traits for std::vector.
typename TMaskImage::InternalPixelType MaskInternalPixelType
Applies a single NeighborhoodOperator to an image, processing only those pixels that are under a mask...
typename TInputImage::InternalPixelType InputInternalPixelType
The base class for all process objects (source, filters, mappers) in the Insight data processing pipe...
Base class for all process objects that output image data.
typename TOutputImage::InternalPixelType OutputInternalPixelType
typename Superclass::OperatorValueType OperatorValueType
typename InputImageType::Pointer InputImagePointer
typename OutputImageType::RegionType OutputImageRegionType
TOutputImage OutputImageType
Control indentation during Print() invocation.
Definition: itkIndent.h:49
typename Superclass::OutputNeighborhoodType OutputNeighborhoodType
Applies a single NeighborhoodOperator to an image region.
#define itkConceptMacro(name, concept)