ITK  4.9.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 
96  void GenerateInputRequestedRegion() ITK_OVERRIDE;
97 
99  void EnlargeOutputRequestedRegion( DataObject * itkNotUsed(output) ) ITK_OVERRIDE;
100 
101 protected:
102  LabelMapFilter();
103  ~LabelMapFilter();
104 
105  virtual void BeforeThreadedGenerateData() ITK_OVERRIDE;
106 
107  virtual void AfterThreadedGenerateData() ITK_OVERRIDE;
108 
109  virtual void ThreadedGenerateData(const OutputImageRegionType & outputRegionForThread, ThreadIdType threadId) ITK_OVERRIDE;
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 &) ITK_DELETE_FUNCTION;
126  void operator=(const Self &) ITK_DELETE_FUNCTION;
127 
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
void GenerateInputRequestedRegion() override
virtual void AfterThreadedGenerateData() override
Superclass::InputImageRegionType InputImageRegionType
Light weight base class for most itk classes.
InputImageType::ConstPointer InputImageConstPointer
void EnlargeOutputRequestedRegion(DataObject *) override
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...
unsigned int ThreadIdType
Definition: itkIntTypes.h:159
DataObject * GetInput(const DataObjectIdentifierType &key)
Return an input.
virtual void ThreadedProcessLabelObject(LabelObjectType *labelObject)
Superclass::InputImageType InputImageType
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
virtual void BeforeThreadedGenerateData() override
virtual void ThreadedGenerateData(const OutputImageRegionType &outputRegionForThread, ThreadIdType threadId) override
OutputImageType::Pointer OutputImagePointer
TOutputImage OutputImageType
FastMutexLock::Pointer m_LabelObjectContainerLock
Base class for all data objects in ITK.
static const unsigned int OutputImageDimension
SizeValueType m_NumberOfLabelObjectsProcessed