NifTK  16.4.1 - 0798f20
CMIC's Translational Medical Imaging Platform
itkUCLLabelVotingImageFilter.h
Go to the documentation of this file.
1 /*=============================================================================
2 
3  NifTK: A software platform for medical image computing.
4 
5  Copyright (c) University College London (UCL). All rights reserved.
6 
7  This software is distributed WITHOUT ANY WARRANTY; without even
8  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
9  PURPOSE.
10 
11  See LICENSE.txt in the top level directory for details.
12 
13 =============================================================================*/
14 
15 #ifndef itkUCLLabelVotingImageFilter_h
16 #define itkUCLLabelVotingImageFilter_h
17 
18 #include <itkImage.h>
19 #include <itkImageToImageFilter.h>
20 
21 namespace itk
22 {
23 
28 template <typename TInputImage, typename TOutputImage>
29 class ITK_EXPORT UCLLabelVotingImageFilter :
30  public ImageToImageFilter< TInputImage, TOutputImage >
31 {
32 public:
35  typedef ImageToImageFilter< TInputImage, TOutputImage > Superclass;
36  typedef SmartPointer<Self> Pointer;
37  typedef SmartPointer<const Self> ConstPointer;
38 
40  itkNewMacro(Self);
41 
43  itkTypeMacro(UCLLabelVotingImageFilter, ImageToImageFilter);
44 
49 
52  itkStaticConstMacro(InputImageDimension, unsigned int,
53  TInputImage::ImageDimension );
54  itkStaticConstMacro(ImageDimension, unsigned int,
55  TOutputImage::ImageDimension);
56 
58  typedef TInputImage InputImageType;
59  typedef TOutputImage OutputImageType;
60  typedef typename InputImageType::ConstPointer InputImagePointer;
61  typedef typename OutputImageType::Pointer OutputImagePointer;
62 
64  typedef typename Superclass::OutputImageRegionType OutputImageRegionType;
65 
69  virtual void SetLabelForUndecidedPixels( const OutputPixelType l )
70  {
71  this->m_LabelForUndecidedPixels = l;
72  this->m_HasLabelForUndecidedPixels = true;
73  this->Modified();
74  }
75 
82  virtual OutputPixelType GetLabelForUndecidedPixels() const
83  {
84  return this->m_LabelForUndecidedPixels;
85  }
86 
90  {
91  if ( this->m_HasLabelForUndecidedPixels )
92  {
93  this->m_HasLabelForUndecidedPixels = false;
94  this->Modified();
95  }
96  }
97 
98 protected:
102  UCLLabelVotingImageFilter() { this->m_HasLabelForUndecidedPixels = false; srand(time(NULL)); }
110  virtual InputPixelType ComputeMaximumInputValue();
114  virtual void BeforeThreadedGenerateData();
118  virtual void ThreadedGenerateData(const OutputImageRegionType &outputRegionForThread, ThreadIdType threadId);
119 
120 protected:
124  OutputPixelType m_LabelForUndecidedPixels;
132  InputPixelType m_TotalLabelCount;
133 
134 private:
135  UCLLabelVotingImageFilter(const Self&); //purposely not implemented
136  void operator=(const Self&); //purposely not implemented
137 
138 };
139 
140 
141 }
142 
143 #ifndef ITK_MANUAL_INSTANTIATION
144 #include "itkUCLLabelVotingImageFilter.txx"
145 #endif
146 
147 
148 #endif
149 
150 
151 
InputImageType::ConstPointer InputImagePointer
Definition: itkUCLLabelVotingImageFilter.h:60
InputPixelType m_TotalLabelCount
Definition: itkUCLLabelVotingImageFilter.h:132
virtual ~UCLLabelVotingImageFilter()
Definition: itkUCLLabelVotingImageFilter.h:106
UCLLabelVotingImageFilter()
Definition: itkUCLLabelVotingImageFilter.h:102
Definition: niftkITKAffineResampleImage.cxx:74
GLdouble l
Definition: glew.h:7885
Superclass::OutputImageRegionType OutputImageRegionType
Definition: itkUCLLabelVotingImageFilter.h:64
SmartPointer< const Self > ConstPointer
Definition: itkUCLLabelVotingImageFilter.h:37
ImageToImageFilter< TInputImage, TOutputImage > Superclass
Definition: itkUCLLabelVotingImageFilter.h:35
virtual void UnsetLabelForUndecidedPixels()
Definition: itkUCLLabelVotingImageFilter.h:89
float PixelType
Definition: niftkBreastDCEandADC.cxx:88
OutputPixelType m_LabelForUndecidedPixels
Definition: itkUCLLabelVotingImageFilter.h:124
TOutputImage::PixelType OutputPixelType
Definition: itkUCLLabelVotingImageFilter.h:43
OutputImageType::Pointer OutputImagePointer
Definition: itkUCLLabelVotingImageFilter.h:61
bool m_HasLabelForUndecidedPixels
Definition: itkUCLLabelVotingImageFilter.h:128
TInputImage::PixelType InputPixelType
Definition: itkUCLLabelVotingImageFilter.h:48
virtual OutputPixelType GetLabelForUndecidedPixels() const
Definition: itkUCLLabelVotingImageFilter.h:82
virtual void SetLabelForUndecidedPixels(const OutputPixelType l)
Definition: itkUCLLabelVotingImageFilter.h:69
TOutputImage OutputImageType
Definition: itkUCLLabelVotingImageFilter.h:59
SmartPointer< Self > Pointer
Definition: itkUCLLabelVotingImageFilter.h:36
TInputImage InputImageType
Definition: itkUCLLabelVotingImageFilter.h:58
Definition: itkUCLLabelVotingImageFilter.h:29
UCLLabelVotingImageFilter Self
Definition: itkUCLLabelVotingImageFilter.h:34