Orfeo Toolbox  3.16
itkLabelOverlayImageFilter.txx
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Insight Segmentation & Registration Toolkit
4  Module: $RCSfile: itkLabelOverlayImageFilter.txx,v $
5  Language: C++
6  Date: $Date: 2009-07-07 12:27:33 $
7  Version: $Revision: 1.9 $
8 
9  Copyright (c) Insight Software Consortium. All rights reserved.
10  See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details.
11 
12  This software is distributed WITHOUT ANY WARRANTY; without even
13  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
14  PURPOSE. See the above copyright notices for more information.
15 
16 =========================================================================*/
17 
18 #ifndef __itkLabelOverlayImageFilter_txx
19 #define __itkLabelOverlayImageFilter_txx
20 
22 
23 namespace itk
24 {
25 
29 template <class TInputImage, class TLabelImage, class TOutputImage>
32 {
33  m_Opacity = 0.5;
34  m_BackgroundValue = NumericTraits<LabelPixelType>::Zero;
35 }
36 
40 template <class TInputImage, class TLabelImage, class TOutputImage>
41 void
44 {
45  this->GetFunctor().SetOpacity(m_Opacity);
46  this->GetFunctor().SetBackgroundValue(m_BackgroundValue);
47 }
48 
52 template <class TInputImage, class TLabelImage, class TOutputImage>
53 void
55 ::SetLabelImage( const TLabelImage *input)
56 {
57  this->SetInput2( input );
58 }
59 
63 template <class TInputImage, class TLabelImage, class TOutputImage>
64 const
66  TInputImage, TLabelImage, TOutputImage>::LabelImageType *
69 {
70  return static_cast<LabelImageType*>(
71  const_cast<DataObject *>(this->ProcessObject::GetInput(1)));
72 }
73 
77 template <class TInputImage, class TLabelImage, class TOutputImage>
78 unsigned int
81 {
82  return this->GetFunctor().GetNumberOfColors();
83 }
84 
88 template <class TInputImage, class TLabelImage, class TOutputImage>
89 void
92 {
93  this->GetFunctor().ResetColors();
94 }
95 
96 
100 template <class TInputImage, class TLabelImage, class TOutputImage>
101 void
104 {
105  this->GetFunctor().AddColor( r, g, b );
106 }
107 
108 
112 template <class TInputImage, class TLabelImage, class TOutputImage>
113 void
115 ::PrintSelf(std::ostream& os, Indent indent) const
116 {
117  Superclass::PrintSelf(os,indent);
118 
119  os << indent << "Opacity: "
120  << static_cast<typename NumericTraits<double>::PrintType>(m_Opacity)
121  << std::endl
122  << indent << "BackgroundValue: "
123  << static_cast<
124  typename NumericTraits<LabelPixelType>::PrintType>(m_BackgroundValue)
125  << std::endl;
126 }
127 
128 
129 } // end namespace itk
130 
131 #endif

Generated at Sat May 18 2013 23:50:34 for Orfeo Toolbox with doxygen 1.8.3.1