ITK  5.0.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  ITK_DISALLOW_COPY_AND_ASSIGN(HoughTransform2DLinesImageFilter);
69 
72 
77 
81 
85 
88  using LinePointer = typename LineType::Pointer;
89  using LinesListType = std::list< LinePointer >;
91 
92  using LinesListSizeType = typename LinesListType::size_type;
93 
96 
99 
102 
105 
108 
110  itkNewMacro( Self );
111 
113  void GenerateData() override;
114 
117  itkSetMacro( Threshold, double );
118  itkGetConstMacro( Threshold, double );
120 
124  itkSetMacro( AngleResolution, double );
125  itkGetConstMacro( AngleResolution, double );
127 
131  void Simplify();
132 
134  itkGetModifiableObjectMacro( SimplifyAccumulator, OutputImageType );
135 
137  LinesListType & GetLines();
138 
140  itkSetMacro( NumberOfLines, LinesListSizeType );
141  itkGetConstMacro( NumberOfLines, LinesListSizeType );
143 
146  itkSetMacro( DiscRadius, double );
147  itkGetConstMacro( DiscRadius, double );
149 
151  itkSetMacro( Variance, double );
152  itkGetConstMacro( Variance, double );
154 
155 #ifdef ITK_USE_CONCEPT_CHECKING
156  // Begin concept checking
157  itkConceptMacro( IntConvertibleToOutputCheck,
159  itkConceptMacro( InputGreaterThanFloatCheck,
161  itkConceptMacro( OutputPlusIntCheck,
163  // End concept checking
164 #endif
165 
166 protected:
167 
169  ~HoughTransform2DLinesImageFilter() override = default;
170 
171  void PrintSelf(std::ostream & os, Indent indent) const override;
172 
176  void GenerateInputRequestedRegion() override;
177 
184  void GenerateOutputInformation() override;
185 
187  void EnlargeOutputRequestedRegion( DataObject *output ) override;
188 
189 private:
190 
191  double m_AngleResolution{ 500 };
192  double m_Threshold{ 0 };
193 
196  LinesListSizeType m_NumberOfLines{ 1 };
197  double m_DiscRadius{ 10 };
198  double m_Variance{ 5 };
199  ModifiedTimeType m_OldModifiedTime{ 0 };
200 };
201 } // end namespace itk
202 
203 #ifndef ITK_MANUAL_INSTANTIATION
204 #include "itkHoughTransform2DLinesImageFilter.hxx"
205 #endif
206 
207 #endif
typename InputImageType::ConstPointer InputImageConstPointer
TPixel PixelType
Definition: itkImage.h:95
Light weight base class for most itk classes.
Point used for a line definition.
unsigned long ModifiedTimeType
Definition: itkIntTypes.h:104
Representation of a Line based on the spatial object classes.
typename InputImageType::RegionType OutputImageRegionType
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