ITK  4.6.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 >
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 
103 
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) {}
158  void PrintSelf(std::ostream & os, Indent indent) const;
159 
166 
178  void ThreadedGenerateData(const OutputImageRegionType & outputRegionForThread,
179  ThreadIdType threadId);
180 
181 private:
182  MaskNeighborhoodOperatorImageFilter(const Self &); //purposely not implemented
183  void operator=(const Self &); //purposely not implemented
184 
187 };
188 } // end namespace itk
189 
190 #ifndef ITK_MANUAL_INSTANTIATION
191 #include "itkMaskNeighborhoodOperatorImageFilter.hxx"
192 #endif
193 
194 #endif
void ThreadedGenerateData(const OutputImageRegionType &outputRegionForThread, ThreadIdType threadId)
Applies a single NeighborhoodOperator to an image, processing only those pixels that are under a mask...
void PrintSelf(std::ostream &os, Indent indent) const
Base class for all process objects that output image data.
ImageBoundaryCondition< OutputImageType > * ImageBoundaryConditionPointerType
void SetMaskImage(const TMaskImage *mask)
Neighborhood< OperatorValueType, itkGetStaticConstMacro(ImageDimension) > OutputNeighborhoodType
NeighborhoodOperatorImageFilter< TInputImage, TOutputImage, TOperatorValueType > Superclass
Superclass::OutputImageRegionType OutputImageRegionType
Control indentation during Print() invocation.
Definition: itkIndent.h:49
const TMaskImage * GetMaskImage() const
Define additional traits for native types such as int or float.
Applies a single NeighborhoodOperator to an image region.
#define itkConceptMacro(name, concept)
unsigned int ThreadIdType
Definition: itkIntTypes.h:159