ITK  5.2.0
Insight Toolkit
itkHoughTransform2DCirclesImageFilter.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright NumFOCUS
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_MOVE(HoughTransform2DCirclesImageFilter);
66 
72 
77 
81 
85 
88 
91 
94 
98  using CirclesListType = std::list<CirclePointer>;
99 
100  using CirclesListSizeType = typename CirclesListType::size_type;
101 
104 
106  itkNewMacro(Self);
107 
109  void
110  VerifyPreconditions() ITKv5_CONST override;
111 
113  void
114  GenerateData() override;
115 
117  void
118  SetRadius(double radius);
119 
121  itkSetMacro(MinimumRadius, double);
122  itkGetConstMacro(MinimumRadius, double);
124 
126  itkSetMacro(MaximumRadius, double);
127  itkGetConstMacro(MaximumRadius, double);
129 
132  itkSetMacro(Threshold, double);
133 
135  itkGetConstMacro(Threshold, double);
136 
139  itkSetMacro(GradientNormThreshold, double);
140  itkGetConstMacro(GradientNormThreshold, double);
142 
144  itkGetModifiableObjectMacro(RadiusImage, RadiusImageType);
145 
147  itkSetMacro(SigmaGradient, double);
148 
150  itkGetConstMacro(SigmaGradient, double);
151 
157  GetCircles();
158 
160  itkSetMacro(NumberOfCircles, CirclesListSizeType);
161  itkGetConstMacro(NumberOfCircles, CirclesListSizeType);
163 
166  itkSetMacro(DiscRadiusRatio, double);
167  itkGetConstMacro(DiscRadiusRatio, double);
169 
171  itkSetMacro(Variance, double);
172  itkGetConstMacro(Variance, double);
174 
176  itkSetMacro(SweepAngle, double);
177  itkGetConstMacro(SweepAngle, double);
179 
182  itkSetMacro(UseImageSpacing, bool);
183  itkGetConstMacro(UseImageSpacing, bool);
185 
186 
187 #ifdef ITK_USE_CONCEPT_CHECKING
188  // Begin concept checking
189  itkConceptMacro(IntConvertibleToOutputCheck, (Concept::Convertible<int, TOutputPixelType>));
193  // End concept checking
194 #endif
195 
196 protected:
198  ~HoughTransform2DCirclesImageFilter() override = default;
199 
200  void
201  PrintSelf(std::ostream & os, Indent indent) const override;
202 
206  void
207  GenerateInputRequestedRegion() override;
208 
213  void
214  EnlargeOutputRequestedRegion(DataObject * itkNotUsed(output)) override;
215 
216 private:
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
itk::HoughTransform2DCirclesImageFilter::InputImagePointer
typename InputImageType::Pointer InputImagePointer
Definition: itkHoughTransform2DCirclesImageFilter.h:75
itk::ModifiedTimeType
SizeValueType ModifiedTimeType
Definition: itkIntTypes.h:102
itk::HoughTransform2DCirclesImageFilter::CirclePointer
typename CircleType::Pointer CirclePointer
Definition: itkHoughTransform2DCirclesImageFilter.h:97
itk::HoughTransform2DCirclesImageFilter::InputImageConstPointer
typename InputImageType::ConstPointer InputImageConstPointer
Definition: itkHoughTransform2DCirclesImageFilter.h:76
itk::Concept::GreaterThanComparable
Definition: itkConceptChecking.h:284
itkEllipseSpatialObject.h
itk::HoughTransform2DCirclesImageFilter::OutputImagePointer
typename OutputImageType::Pointer OutputImagePointer
Definition: itkHoughTransform2DCirclesImageFilter.h:80
itk::SmartPointer< Self >
itk::Indent
Control indentation during Print() invocation.
Definition: itkIndent.h:49
itk::EllipseSpatialObject
Definition: itkEllipseSpatialObject.h:38
itk::GTest::TypedefsAndConstructors::Dimension2::IndexType
ImageBaseType::IndexType IndexType
Definition: itkGTestTypedefsAndConstructors.h:50
itk::ImageToImageFilter
Base class for filters that take an image as input and produce an image as output.
Definition: itkImageToImageFilter.h:108
itk::LightObject
Light weight base class for most itk classes.
Definition: itkLightObject.h:59
itk::HoughTransform2DCirclesImageFilter::OutputImageRegionType
typename InputImageType::RegionType OutputImageRegionType
Definition: itkHoughTransform2DCirclesImageFilter.h:93
itk::HoughTransform2DCirclesImageFilter::m_RadiusImage
RadiusImagePointer m_RadiusImage
Definition: itkHoughTransform2DCirclesImageFilter.h:224
itk::HoughTransform2DCirclesImageFilter::m_CirclesList
CirclesListType m_CirclesList
Definition: itkHoughTransform2DCirclesImageFilter.h:225
itk::GTest::TypedefsAndConstructors::Dimension2::RegionType
ImageBaseType::RegionType RegionType
Definition: itkGTestTypedefsAndConstructors.h:54
itk::HoughTransform2DCirclesImageFilter::IndexType
typename InputImageType::IndexType IndexType
Definition: itkHoughTransform2DCirclesImageFilter.h:87
itk::HoughTransform2DCirclesImageFilter::RadiusImagePointer
typename RadiusImageType::Pointer RadiusImagePointer
Definition: itkHoughTransform2DCirclesImageFilter.h:84
itk::HoughTransform2DCirclesImageFilter::PixelType
typename InputImageType::PixelType PixelType
Definition: itkHoughTransform2DCirclesImageFilter.h:90
itkImageToImageFilter.h
itk::Concept::DivisionOperators
Definition: itkConceptChecking.h:473
itk::Image::PixelType
TPixel PixelType
Definition: itkImage.h:106
itk::HoughTransform2DCirclesImageFilter::CirclesListSizeType
typename CirclesListType::size_type CirclesListSizeType
Definition: itkHoughTransform2DCirclesImageFilter.h:100
itk::Concept::AdditiveOperators
Definition: itkConceptChecking.h:358
itkConceptMacro
#define itkConceptMacro(name, concept)
Definition: itkConceptChecking.h:65
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkAnnulusOperator.h:24
itk::Concept::Convertible
Definition: itkConceptChecking.h:216
itk::Image
Templated n-dimensional image class.
Definition: itkImage.h:86
itk::HoughTransform2DCirclesImageFilter
Performs the Hough Transform to find circles in a 2D image.
Definition: itkHoughTransform2DCirclesImageFilter.h:61
itk::HoughTransform2DCirclesImageFilter::CirclesListType
std::list< CirclePointer > CirclesListType
Definition: itkHoughTransform2DCirclesImageFilter.h:98
itk::DataObject
Base class for all data objects in ITK.
Definition: itkDataObject.h:293