Orfeo Toolbox  3.16
itkShapeOpeningLabelMapFilter.txx
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Insight Segmentation & Registration Toolkit
4  Module: $RCSfile: itkShapeOpeningLabelMapFilter.txx,v $
5  Language: C++
6  Date: $Date: 2009-08-04 21:32:07 $
7  Version: $Revision: 1.3 $
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 #ifndef __itkShapeOpeningLabelMapFilter_txx
18 #define __itkShapeOpeningLabelMapFilter_txx
19 
21 
22 
23 namespace itk {
24 
25 template <class TImage>
28 {
29  m_Lambda = NumericTraits< double >::Zero;
30  m_ReverseOrdering = false;
31  m_Attribute = LabelObjectType::SIZE;
32 
33  // create the output image for the removed objects
34  this->SetNumberOfRequiredOutputs(2);
35  this->SetNthOutput( 1, static_cast<TImage*>( this->MakeOutput(1).GetPointer() ) );
36 }
37 
38 
39 template <class TImage>
40 void
43 {
44  switch( m_Attribute )
45  {
46  case LabelObjectType::LABEL:
47  {
48  typedef typename Functor::LabelLabelObjectAccessor< LabelObjectType > AccessorType;
49  AccessorType accessor;
50  this->TemplatedGenerateData( accessor );
51  break;
52  }
53  case LabelObjectType::SIZE:
54  {
55  typedef typename Functor::SizeLabelObjectAccessor< LabelObjectType > AccessorType;
56  AccessorType accessor;
57  this->TemplatedGenerateData( accessor );
58  break;
59  }
60  case LabelObjectType::PHYSICAL_SIZE:
61  {
63  AccessorType accessor;
64  this->TemplatedGenerateData( accessor );
65  break;
66  }
67  case LabelObjectType::SIZE_REGION_RATIO:
68  {
70  AccessorType accessor;
71  this->TemplatedGenerateData( accessor );
72  break;
73  }
74  case LabelObjectType::REGION_ELONGATION:
75  {
77  AccessorType accessor;
78  this->TemplatedGenerateData( accessor );
79  break;
80  }
81  case LabelObjectType::SIZE_ON_BORDER:
82  {
84  AccessorType accessor;
85  this->TemplatedGenerateData( accessor );
86  break;
87  }
88  case LabelObjectType::PHYSICAL_SIZE_ON_BORDER:
89  {
91  AccessorType accessor;
92  this->TemplatedGenerateData( accessor );
93  break;
94  }
95  case LabelObjectType::FERET_DIAMETER:
96  {
98  AccessorType accessor;
99  this->TemplatedGenerateData( accessor );
100  break;
101  }
102  case LabelObjectType::BINARY_ELONGATION:
103  {
105  AccessorType accessor;
106  this->TemplatedGenerateData( accessor );
107  break;
108  }
109  case LabelObjectType::PERIMETER:
110  {
111  typedef typename Functor::PerimeterLabelObjectAccessor< LabelObjectType > AccessorType;
112  AccessorType accessor;
113  this->TemplatedGenerateData( accessor );
114  break;
115  }
116  case LabelObjectType::ROUNDNESS:
117  {
118  typedef typename Functor::RoundnessLabelObjectAccessor< LabelObjectType > AccessorType;
119  AccessorType accessor;
120  this->TemplatedGenerateData( accessor );
121  break;
122  }
123  case LabelObjectType::EQUIVALENT_RADIUS:
124  {
126  AccessorType accessor;
127  this->TemplatedGenerateData( accessor );
128  break;
129  }
130  case LabelObjectType::EQUIVALENT_PERIMETER:
131  {
133  AccessorType accessor;
134  this->TemplatedGenerateData( accessor );
135  break;
136  }
137  case LabelObjectType::BINARY_FLATNESS:
138  {
140  AccessorType accessor;
141  this->TemplatedGenerateData( accessor );
142  break;
143  }
144  default:
145  itkExceptionMacro(<< "Unknown attribute type");
146  break;
147  }
148 }
149 
150 template <class TImage>
151 void
153 ::PrintSelf(std::ostream &os, Indent indent) const
154 {
155  Superclass::PrintSelf(os, indent);
156 
157  os << indent << "ReverseOrdering: " << m_ReverseOrdering << std::endl;
158  os << indent << "Lambda: " << m_Lambda << std::endl;
159  os << indent << "Attribute: " << LabelObjectType::GetNameFromAttribute( m_Attribute ) << " (" << m_Attribute << ")" << std::endl;
160 }
161 
162 }// end namespace itk
163 #endif

Generated at Sun Feb 3 2013 00:06:12 for Orfeo Toolbox with doxygen 1.8.1.1