ITK  4.6.0
Insight Segmentation and Registration Toolkit
itkLabelVotingImageFilter.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 __itkLabelVotingImageFilter_h
19 #define __itkLabelVotingImageFilter_h
20 
21 #include "itkImageToImageFilter.h"
22 
23 namespace itk
24 {
74 template< typename TInputImage, typename TOutputImage = TInputImage >
76  public ImageToImageFilter< TInputImage, TOutputImage >
77 {
78 public:
84 
86  itkNewMacro(Self);
87 
90 
93  typedef typename TOutputImage::PixelType OutputPixelType;
94  typedef typename TInputImage::PixelType InputPixelType;
95 
98  itkStaticConstMacro(InputImageDimension, unsigned int,
99  TInputImage::ImageDimension);
100  itkStaticConstMacro(ImageDimension, unsigned int,
101  TOutputImage::ImageDimension);
103 
105  typedef TInputImage InputImageType;
106  typedef TOutputImage OutputImageType;
107  typedef typename InputImageType::ConstPointer InputImagePointer;
108  typedef typename OutputImageType::Pointer OutputImagePointer;
109 
110  typedef unsigned long LabelCountType;
111 
114 
118  {
119  this->m_LabelForUndecidedPixels = l;
120  this->m_HasLabelForUndecidedPixels = true;
121  this->Modified();
122  }
124 
132  {
133  return this->m_LabelForUndecidedPixels;
134  }
135 
139  {
140  if ( this->m_HasLabelForUndecidedPixels )
141  {
142  this->m_HasLabelForUndecidedPixels = false;
143  this->Modified();
144  }
145  }
147 
148 #ifdef ITK_USE_CONCEPT_CHECKING
149  // Begin concept checking
150  itkConceptMacro( InputConvertibleToOutputCheck,
152  itkConceptMacro( IntConvertibleToInputCheck,
154  itkConceptMacro( SameDimensionCheck,
156  itkConceptMacro( InputUnsignedIntCheck,
158  itkConceptMacro( IntConvertibleToOutputPixelType,
160  itkConceptMacro( InputPlusIntCheck,
162  itkConceptMacro( InputIncrementDecrementOperatorsCheck,
164  itkConceptMacro( OutputOStreamWritableCheck,
166  // End concept checking
167 #endif
168 
169 protected:
172 
176 
178  (const OutputImageRegionType & outputRegionForThread, ThreadIdType threadId);
179 
180  void PrintSelf(std::ostream &, Indent) const;
181 
184 
185 private:
186  LabelVotingImageFilter(const Self &); //purposely not implemented
187  void operator=(const Self &); //purposely not implemented
188 
192 };
193 } // end namespace itk
194 
195 #ifndef ITK_MANUAL_INSTANTIATION
196 #include "itkLabelVotingImageFilter.hxx"
197 #endif
198 
199 #endif
InputImageType::ConstPointer InputImagePointer
InputPixelType ComputeMaximumInputValue()
This filter performs pixelwise voting among an arbitrary number of input images, where each of them r...
OutputPixelType GetLabelForUndecidedPixels() const
Superclass::OutputImageRegionType OutputImageRegionType
void operator=(const Self &)
void SetLabelForUndecidedPixels(const OutputPixelType l)
Base class for all process objects that output image data.
SmartPointer< const Self > ConstPointer
OutputImageType::Pointer OutputImagePointer
static const unsigned int ImageDimension
void ThreadedGenerateData(const OutputImageRegionType &outputRegionForThread, ThreadIdType threadId)
virtual void Modified() const
TOutputImage::PixelType OutputPixelType
Base class for filters that take an image as input and produce an image as output.
ImageToImageFilter< TInputImage, TOutputImage > Superclass
Control indentation during Print() invocation.
Definition: itkIndent.h:49
TInputImage::PixelType InputPixelType
Superclass::OutputImageRegionType OutputImageRegionType
static const unsigned int InputImageDimension
#define itkConceptMacro(name, concept)
void PrintSelf(std::ostream &, Indent) const
unsigned int ThreadIdType
Definition: itkIntTypes.h:159