ITK  4.13.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:
59  TInputImage, TOutputImage, TOperatorValueType > Superclass;
60 
63 
65  itkNewMacro(Self);
66 
69 
72  typedef typename TOutputImage::PixelType OutputPixelType;
73  typedef typename TOutputImage::InternalPixelType OutputInternalPixelType;
74  typedef typename TInputImage::PixelType InputPixelType;
75  typedef typename TInputImage::InternalPixelType InputInternalPixelType;
76  typedef typename TMaskImage::PixelType MaskPixelType;
77  typedef typename TMaskImage::InternalPixelType MaskInternalPixelType;
78 
81  itkStaticConstMacro(ImageDimension, unsigned int,
82  TOutputImage::ImageDimension);
83  itkStaticConstMacro(InputImageDimension, unsigned int,
84  TInputImage::ImageDimension);
85  itkStaticConstMacro(MaskImageDimension, unsigned int,
86  TMaskImage::ImageDimension);
88 
90  typedef TInputImage InputImageType;
91  typedef TMaskImage MaskImageType;
92  typedef TOutputImage OutputImageType;
93  typedef typename InputImageType::Pointer InputImagePointer;
94  typedef typename MaskImageType::Pointer MaskImagePointer;
95 
99 
101  typedef typename Superclass::OutputImageRegionType OutputImageRegionType;
102  typedef typename Superclass::OperatorValueType OperatorValueType;
103 
105  typedef typename Superclass::OutputNeighborhoodType OutputNeighborhoodType;
106 
110  void SetMaskImage(const TMaskImage *mask);
111 
115  const TMaskImage * 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,
141  itkConceptMacro( SameDimensionCheck1,
143  itkConceptMacro( SameDimensionCheck2,
145  itkConceptMacro( InputConvertibleToOutputCheck,
147  itkConceptMacro( OperatorConvertibleToOutputCheck,
149  itkConceptMacro( OutputOStreamWritable,
151  // End concept checking
152 #endif
153 
154 protected:
156  m_UseDefaultValue(true) {}
157  virtual ~MaskNeighborhoodOperatorImageFilter() ITK_OVERRIDE {}
158  void PrintSelf(std::ostream & os, Indent indent) const ITK_OVERRIDE;
159 
165  void GenerateInputRequestedRegion() ITK_OVERRIDE;
166 
178  void ThreadedGenerateData(const OutputImageRegionType & outputRegionForThread,
179  ThreadIdType threadId) ITK_OVERRIDE;
180 
181 private:
182  ITK_DISALLOW_COPY_AND_ASSIGN(MaskNeighborhoodOperatorImageFilter);
183 
184  OutputPixelType m_DefaultValue;
185  bool m_UseDefaultValue;
186 };
187 } // end namespace itk
188 
189 #ifndef ITK_MANUAL_INSTANTIATION
190 #include "itkMaskNeighborhoodOperatorImageFilter.hxx"
191 #endif
192 
193 #endif
Applies a single NeighborhoodOperator to an image, processing only those pixels that are under a mask...
Base class for all process objects that output image data.
ImageBoundaryCondition< OutputImageType > * ImageBoundaryConditionPointerType
NeighborhoodOperatorImageFilter< TInputImage, TOutputImage, TOperatorValueType > Superclass
unsigned int ThreadIdType
Definition: itkIntTypes.h:159
Control indentation during Print() invocation.
Definition: itkIndent.h:49
Define additional traits for native types such as int or float.
Applies a single NeighborhoodOperator to an image region.
#define itkConceptMacro(name, concept)