ITK  4.6.0
Insight Segmentation and Registration Toolkit
itkLabelMapFilter.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 /*=========================================================================
19  *
20  * Portions of this file are subject to the VTK Toolkit Version 3 copyright.
21  *
22  * Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
23  *
24  * For complete copyright, license and disclaimer of warranty information
25  * please refer to the NOTICE file at the top of the ITK source tree.
26  *
27  *=========================================================================*/
28 #ifndef __itkLabelMapFilter_h
29 #define __itkLabelMapFilter_h
30 
31 #include "itkImageToImageFilter.h"
32 #include "itkFastMutexLock.h"
33 
34 namespace itk
35 {
56 template< typename TInputImage, typename TOutputImage >
58  public
59  ImageToImageFilter< TInputImage, TOutputImage >
60 {
61 public:
67 
69  itkTypeMacro(LabelMapFilter, ImageToImageFilter);
70 
72  itkNewMacro(Self);
73 
80  typedef typename InputImageType::LabelObjectType LabelObjectType;
81 
82  typedef TOutputImage OutputImageType;
83  typedef typename OutputImageType::Pointer OutputImagePointer;
84  typedef typename OutputImageType::ConstPointer OutputImageConstPointer;
85  typedef typename OutputImageType::RegionType OutputImageRegionType;
86  typedef typename OutputImageType::PixelType OutputImagePixelType;
87 
89  itkStaticConstMacro(InputImageDimension, unsigned int, TInputImage::ImageDimension);
90  itkStaticConstMacro(OutputImageDimension, unsigned int, TOutputImage::ImageDimension);
92 
97 
99  void EnlargeOutputRequestedRegion( DataObject * itkNotUsed(output) );
100 
101 protected:
102  LabelMapFilter();
103  ~LabelMapFilter();
104 
105  virtual void BeforeThreadedGenerateData();
106 
107  virtual void AfterThreadedGenerateData();
108 
109  virtual void ThreadedGenerateData(const OutputImageRegionType & outputRegionForThread, ThreadIdType threadId);
110 
111  virtual void ThreadedProcessLabelObject(LabelObjectType *labelObject);
112 
118  {
119  return static_cast< InputImageType * >( const_cast< DataObject * >( this->ProcessObject::GetInput(0) ) );
120  }
121 
123 
124 private:
125  LabelMapFilter(const Self &); //purposely not implemented
126  void operator=(const Self &); //purposely not implemented
127 
128  typename InputImageType::Iterator m_LabelObjectIterator;
131 };
132 } // end namespace itk
133 
134 #ifndef ITK_MANUAL_INSTANTIATION
135 #include "itkLabelMapFilter.hxx"
136 #endif
137 
138 #endif
SmartPointer< Self > Pointer
SmartPointer< const Self > ConstPointer
Superclass::InputImageRegionType InputImageRegionType
Light weight base class for most itk classes.
InputImageType::ConstPointer InputImageConstPointer
InputImageType::Pointer InputImagePointer
OutputImageType::RegionType OutputImageRegionType
OutputImageType::PixelType OutputImagePixelType
Superclass::InputImagePixelType InputImagePixelType
unsigned long SizeValueType
Definition: itkIntTypes.h:143
ImageToImageFilter< TInputImage, TOutputImage > Superclass
virtual InputImageType * GetLabelMap()
Superclass::InputImageConstPointer InputImageConstPointer
InputImageType::RegionType InputImageRegionType
static const unsigned int InputImageDimension
Base class for filters that take an image as input and overwrite that image as the output...
DataObject * GetInput(const DataObjectIdentifierType &key)
virtual void AfterThreadedGenerateData()
virtual void ThreadedProcessLabelObject(LabelObjectType *labelObject)
Superclass::InputImageType InputImageType
void EnlargeOutputRequestedRegion(DataObject *)
InputImageType::Iterator m_LabelObjectIterator
InputImageType::PixelType InputImagePixelType
OutputImageType::ConstPointer OutputImageConstPointer
Superclass::InputImagePointer InputImagePointer
InputImageType::LabelObjectType LabelObjectType
Base class for filters that take an image as input and produce an image as output.
OutputImageType::RegionType OutputImageRegionType
OutputImageType::Pointer OutputImagePointer
TOutputImage OutputImageType
FastMutexLock::Pointer m_LabelObjectContainerLock
void operator=(const Self &)
Base class for all data objects in ITK.
void GenerateInputRequestedRegion()
virtual void ThreadedGenerateData(const OutputImageRegionType &outputRegionForThread, ThreadIdType threadId)
unsigned int ThreadIdType
Definition: itkIntTypes.h:159
static const unsigned int OutputImageDimension
SizeValueType m_NumberOfLabelObjectsProcessed
virtual void BeforeThreadedGenerateData()