ITK  4.2.0
Insight Segmentation and Registration Toolkit
itkNeighborhoodOperatorImageFilter.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 __itkNeighborhoodOperatorImageFilter_h
19 #define __itkNeighborhoodOperatorImageFilter_h
20 
21 #include "itkImageToImageFilter.h"
23 #include "itkImage.h"
25 
26 namespace itk
27 {
50 template< class TInputImage, class TOutputImage, class TOperatorValueType = typename TOutputImage::PixelType >
52  public ImageToImageFilter< TInputImage, TOutputImage >
53 {
54 public:
60 
62  itkNewMacro(Self);
63 
66 
69  typedef typename TOutputImage::PixelType OutputPixelType;
70  typedef typename TOutputImage::InternalPixelType OutputInternalPixelType;
71  typedef typename TInputImage::PixelType InputPixelType;
72  typedef typename TInputImage::InternalPixelType InputInternalPixelType;
73  typedef TOperatorValueType OperatorValueType;
74 
77 
80  itkStaticConstMacro(ImageDimension, unsigned int,
81  TOutputImage::ImageDimension);
82  itkStaticConstMacro(InputImageDimension, unsigned int,
83  TInputImage::ImageDimension);
85 
87  typedef TInputImage InputImageType;
88  typedef TOutputImage OutputImageType;
89  typedef typename InputImageType::Pointer InputImagePointer;
90 
94 
97 
99  typedef typename Superclass::OutputImageRegionType OutputImageRegionType;
100 
103  itkGetStaticConstMacro(ImageDimension) > OutputNeighborhoodType;
104 
108  void SetOperator(const OutputNeighborhoodType & p)
109  {
110  m_Operator = p;
111  this->Modified();
112  }
114 
116  const OutputNeighborhoodType & GetOperator() const
117  { return m_Operator; }
118 
124  void OverrideBoundaryCondition(const ImageBoundaryConditionPointerType i)
125  { m_BoundsCondition = i; }
126 
128  ImageBoundaryConditionPointerType GetBoundaryCondition()
129  { return m_BoundsCondition; }
130 
138  virtual void GenerateInputRequestedRegion()
139  throw ( InvalidRequestedRegionError );
140 
141 #ifdef ITK_USE_CONCEPT_CHECKING
142 
143  itkConceptMacro( SameDimensionCheck,
145  itkConceptMacro( OperatorConvertibleToOutputCheck,
147  itkConceptMacro( InputConvertibleToOperatorCheck,
149  itkConceptMacro( OperatorMultiplyOperatorCheck,
151  itkConceptMacro( OperatorAdditiveOperatorsCheck,
153 
155 #endif
156 protected:
158  { m_BoundsCondition = static_cast< ImageBoundaryConditionPointerType >( &m_DefaultBoundaryCondition ); }
161 
173  void ThreadedGenerateData(const OutputImageRegionType & outputRegionForThread,
174  ThreadIdType threadId);
175 
176  void PrintSelf(std::ostream & os, Indent indent) const
177  { Superclass::PrintSelf(os, indent); }
178 private:
179  NeighborhoodOperatorImageFilter(const Self &); //purposely not implemented
180  void operator=(const Self &); //purposely not implemented
181 
184 
188 
191 };
192 } // end namespace itk
193 
194 #ifndef ITK_MANUAL_INSTANTIATION
195 #include "itkNeighborhoodOperatorImageFilter.hxx"
196 #endif
197 
198 #endif
199