ITK  5.0.0
Insight Segmentation and Registration Toolkit
itkHoughTransform2DCirclesImageFilter.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 itkHoughTransform2DCirclesImageFilter_h
19 #define itkHoughTransform2DCirclesImageFilter_h
20 
21 
22 #include "itkImageToImageFilter.h"
24 
25 namespace itk
26 {
60 template< typename TInputPixelType, typename TOutputPixelType, typename TRadiusPixelType >
61 class ITK_TEMPLATE_EXPORT HoughTransform2DCirclesImageFilter:
62  public ImageToImageFilter< Image< TInputPixelType, 2 >, Image< TOutputPixelType, 2 > >
63 {
64 public:
65  ITK_DISALLOW_COPY_AND_ASSIGN(HoughTransform2DCirclesImageFilter);
66 
73 
78 
82 
86 
89 
92 
95 
99  using CirclesListType = std::list< CirclePointer >;
100 
101  using CirclesListSizeType = typename CirclesListType::size_type;
102 
105 
107  itkNewMacro(Self);
108 
110  void VerifyPreconditions() ITKv5_CONST override;
111 
113  void GenerateData() override;
114 
116  void SetRadius(double radius);
117 
119  itkSetMacro(MinimumRadius, double);
120  itkGetConstMacro(MinimumRadius, double);
122 
124  itkSetMacro(MaximumRadius, double);
125  itkGetConstMacro(MaximumRadius, double);
127 
130  itkSetMacro(Threshold, double);
131 
133  itkGetConstMacro(Threshold, double);
134 
137  itkSetMacro(GradientNormThreshold, double);
138  itkGetConstMacro(GradientNormThreshold, double);
140 
142  itkGetModifiableObjectMacro(RadiusImage, RadiusImageType);
143 
145  itkSetMacro(SigmaGradient, double);
146 
148  itkGetConstMacro(SigmaGradient, double);
149 
154  CirclesListType & GetCircles();
155 
157  itkSetMacro(NumberOfCircles, CirclesListSizeType);
158  itkGetConstMacro(NumberOfCircles, CirclesListSizeType);
160 
163  itkSetMacro(DiscRadiusRatio, double);
164  itkGetConstMacro(DiscRadiusRatio, double);
166 
168  itkSetMacro(Variance, double);
169  itkGetConstMacro(Variance, double);
171 
173  itkSetMacro(SweepAngle, double);
174  itkGetConstMacro(SweepAngle, double);
176 
179  itkSetMacro(UseImageSpacing, bool);
180  itkGetConstMacro(UseImageSpacing, bool);
182 
183 
184 #ifdef ITK_USE_CONCEPT_CHECKING
185  // Begin concept checking
186  itkConceptMacro( IntConvertibleToOutputCheck,
188  itkConceptMacro( InputGreaterThanDoubleCheck,
190  itkConceptMacro( OutputPlusIntCheck,
192  itkConceptMacro( OutputDividedByIntCheck,
194  // End concept checking
195 #endif
196 
197 protected:
198 
200  ~HoughTransform2DCirclesImageFilter() override = default;
201 
202  void PrintSelf(std::ostream & os, Indent indent) const override;
203 
207  void GenerateInputRequestedRegion() override;
208 
213  void EnlargeOutputRequestedRegion( DataObject *itkNotUsed(output) ) override;
214 
215 private:
216 
217  double m_SweepAngle{ 0.0 };
218  double m_MinimumRadius{ 0.0 };
219  double m_MaximumRadius{ 10.0 };
220  double m_Threshold{ 0.0 };
221  double m_GradientNormThreshold{ 1.0 };
222  double m_SigmaGradient{ 1.0 };
223 
226  CirclesListSizeType m_NumberOfCircles{ 1 };
227  double m_DiscRadiusRatio{ 1 };
228  double m_Variance{ 10 };
229  bool m_UseImageSpacing{ true };
230  ModifiedTimeType m_OldModifiedTime{ 0 };
231 };
232 } // end namespace itk
233 
234 #ifndef ITK_MANUAL_INSTANTIATION
235 #include "itkHoughTransform2DCirclesImageFilter.hxx"
236 #endif
237 
238 #endif
TPixel PixelType
Definition: itkImage.h:95
Light weight base class for most itk classes.
typename InputImageType::ConstPointer InputImageConstPointer
unsigned long ModifiedTimeType
Definition: itkIntTypes.h:104
Performs the Hough Transform to find circles 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