ITK  4.13.0
Insight Segmentation and Registration Toolkit
itkHoughTransform2DLinesImageFilter.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 itkHoughTransform2DLinesImageFilter_h
19 #define itkHoughTransform2DLinesImageFilter_h
20 
21 
22 #include "itkImageToImageFilter.h"
23 #include "itkLineSpatialObject.h"
24 
25 namespace itk
26 {
63 template< typename TInputPixelType, typename TOutputPixelType >
64 class ITK_TEMPLATE_EXPORT HoughTransform2DLinesImageFilter:
65  public ImageToImageFilter< Image< TInputPixelType, 2 >, Image< TOutputPixelType, 2 > >
66 {
67 public:
68 
71 
76 
80 
84 
87  typedef typename LineType::Pointer LinePointer;
88  typedef std::list< LinePointer > LinesListType;
90 
91  typedef typename LinesListType::size_type LinesListSizeType;
92 
95 
98 
101 
104 
107 
109  itkNewMacro(Self);
110 
112  void GenerateData() ITK_OVERRIDE;
113 
116  itkSetMacro(Threshold, float);
117 
119  itkGetConstMacro(Threshold, float);
120 
124  itkSetMacro(AngleResolution, float);
125 
127  itkGetConstMacro(AngleResolution, float);
128 
130  void Simplify();
131 
133  itkGetModifiableObjectMacro(SimplifyAccumulator, OutputImageType);
134 
136  LinesListType & GetLines();
137 
140  itkLegacyMacro(LinesListType & GetLines(unsigned int n));
141 
143  itkSetMacro(NumberOfLines, LinesListSizeType);
144  itkGetConstMacro(NumberOfLines, LinesListSizeType);
146 
149  itkSetMacro(DiscRadius, float);
150  itkGetConstMacro(DiscRadius, float);
152 
154  itkSetMacro(Variance, float);
155  itkGetConstMacro(Variance, float);
157 
158 #ifdef ITK_USE_CONCEPT_CHECKING
159  // Begin concept checking
160  itkConceptMacro( IntConvertibleToOutputCheck,
162  itkConceptMacro( InputGreaterThanFloatCheck,
164  itkConceptMacro( OutputPlusIntCheck,
166  // End concept checking
167 #endif
168 
169 protected:
170 
172  virtual ~HoughTransform2DLinesImageFilter() ITK_OVERRIDE {}
173 
174  void PrintSelf(std::ostream & os, Indent indent) const ITK_OVERRIDE;
175 
179  void GenerateInputRequestedRegion() ITK_OVERRIDE;
180 
187  void GenerateOutputInformation() ITK_OVERRIDE;
188 
190  void EnlargeOutputRequestedRegion(DataObject *output) ITK_OVERRIDE;
191 
192 private:
193 
194  HoughTransform2DLinesImageFilter(const Self &);
195  void operator=(const Self &);
196 
197  float m_AngleResolution;
198  float m_Threshold;
199  OutputImagePointer m_SimplifyAccumulator;
200  LinesListType m_LinesList;
201  LinesListSizeType m_NumberOfLines;
202  float m_DiscRadius;
203  float m_Variance;
204  ModifiedTimeType m_OldModifiedTime;
205 };
206 } // end namespace itk
207 
208 #ifndef ITK_MANUAL_INSTANTIATION
209 #include "itkHoughTransform2DLinesImageFilter.hxx"
210 #endif
211 
212 #endif
Superclass::RegionType RegionType
Definition: itkImage.h:137
Light weight base class for most itk classes.
unsigned long ModifiedTimeType
Definition: itkIntTypes.h:164
TPixel PixelType
Definition: itkImage.h:89
Point used for a line definition.
Representation of a Line based on the spatial object classes.
ImageToImageFilter< InputImageType, OutputImageType > Superclass
Performs the Hough Transform to find 2D straight lines in a 2D image.
Base class for filters that take an image as input and produce an image as output.
Control indentation during Print() invocation.
Definition: itkIndent.h:49
#define itkConceptMacro(name, concept)
Base class for all data objects in ITK.
Templated n-dimensional image class.
Definition: itkImage.h:75