ITK  4.4.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< class TInputImage, class TMaskImage, class TOutputImage, class TOperatorValueType =
51  typename TOutputImage::PixelType >
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 
139  itkConceptMacro( OutputEqualityComparableCheck,
141  itkConceptMacro( SameDimensionCheck1,
143  itkConceptMacro( SameDimensionCheck2,
145  itkConceptMacro( InputConvertibleToOutputCheck,
147  itkConceptMacro( OperatorConvertibleToOutputCheck,
149  itkConceptMacro( OutputOStreamWritable,
151 
153 #endif
154 
155 protected:
157  m_UseDefaultValue(true) {}
159  void PrintSelf(std::ostream & os, Indent indent) const;
160 
166  void GenerateInputRequestedRegion()
167  throw ( InvalidRequestedRegionError );
168 
180  void ThreadedGenerateData(const OutputImageRegionType & outputRegionForThread,
181  ThreadIdType threadId);
182 
183 private:
184  MaskNeighborhoodOperatorImageFilter(const Self &); //purposely not implemented
185  void operator=(const Self &); //purposely not implemented
186 
187  OutputPixelType m_DefaultValue;
188  bool m_UseDefaultValue;
189 };
190 } // end namespace itk
191 
192 #ifndef ITK_MANUAL_INSTANTIATION
193 #include "itkMaskNeighborhoodOperatorImageFilter.hxx"
194 #endif
195 
196 #endif
197