ITK  4.6.0
Insight Segmentation and Registration Toolkit
itkConnectedComponentFunctorImageFilter.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 __itkConnectedComponentFunctorImageFilter_h
19 #define __itkConnectedComponentFunctorImageFilter_h
20 
22 
23 namespace itk
24 {
53 template< typename TInputImage, typename TOutputImage, typename TFunctor, typename TMaskImage = TInputImage >
55  public ConnectedComponentImageFilter< TInputImage, TOutputImage, TMaskImage >
56 {
57 public:
63 
68 
73  typedef typename TOutputImage::PixelType OutputPixelType;
74  typedef typename TOutputImage::InternalPixelType OutputInternalPixelType;
75  typedef typename TInputImage::PixelType InputPixelType;
76  typedef typename TInputImage::InternalPixelType InputInternalPixelType;
77  typedef typename TMaskImage::PixelType MaskPixelType;
78  itkStaticConstMacro(ImageDimension, unsigned int,
79  TOutputImage::ImageDimension);
80  itkStaticConstMacro(InputImageDimension, unsigned int,
81  TInputImage::ImageDimension);
83 
87  typedef TFunctor FunctorType;
88  typedef TInputImage InputImageType;
89  typedef TMaskImage MaskImageType;
90  typedef TOutputImage OutputImageType;
91 
92  typedef typename TInputImage::IndexType IndexType;
93  typedef typename TInputImage::SizeType SizeType;
94  typedef typename TOutputImage::RegionType RegionType;
95  typedef std::list< IndexType > ListType;
96 
97  typedef typename MaskImageType::Pointer MaskImagePointer;
98 
104 
109 
113  itkNewMacro(Self);
114 
120  const FunctorType & GetFunctor() const { return m_Functor; }
122 
129  void SetFunctor(const FunctorType & functor)
130  {
131  m_Functor = functor;
132  this->Modified();
133  }
135 
136 #ifdef ITK_USE_CONCEPT_CHECKING
137  // Begin concept checking
138  itkConceptMacro( SameDimensionCheck,
140  itkConceptMacro( InputEqualityComparableCheck,
142  itkConceptMacro( OutputEqualityComparableCheck,
144  itkConceptMacro( OutputConvertibleToUnsignedIntCheck,
146  itkConceptMacro( OutputConvertibleToUnsignedLongCheck,
148  itkConceptMacro( OutputConvertibleToLongCheck,
150  itkConceptMacro( UnsignedLongConvertibleToOutputCheck,
152  itkConceptMacro( OutputIncrementDecrementOperatorsCheck,
154  // End concept checking
155 #endif
156 
157 protected:
161 
163 
167  void GenerateData();
168 };
169 } // end namespace itk
170 
171 #ifndef ITK_MANUAL_INSTANTIATION
172 #include "itkConnectedComponentFunctorImageFilter.hxx"
173 #endif
174 
175 #endif
A generic connected components filter that labels the objects in an artibitrary image.
Base class for all process objects that output image data.
ConnectedComponentImageFilter< TInputImage, TOutputImage, TMaskImage > Superclass
virtual void Modified() const
Base class for filters that take an image as input and produce an image as output.
#define itkConceptMacro(name, concept)
Label the objects in a binary image.