Main Page   Groups   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Concepts

itkHoughTransform2DLinesImageFilter.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Insight Segmentation & Registration Toolkit
00004   Module:    $RCSfile: itkHoughTransform2DLinesImageFilter.h,v $
00005   Language:  C++
00006   Date:      $Date: 2005/05/02 22:56:56 $
00007   Version:   $Revision: 1.7 $
00008 
00009   Copyright (c) Insight Software Consortium. All rights reserved.
00010   See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details.
00011 
00012      This software is distributed WITHOUT ANY WARRANTY; without even 
00013      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
00014      PURPOSE.  See the above copyright notices for more information.
00015 
00016 =========================================================================*/
00017 #ifndef __itkHoughTransform2DLinesImageFilter_h
00018 #define __itkHoughTransform2DLinesImageFilter_h
00019 
00020 #ifdef _MSC_VER
00021 #pragma warning ( disable : 4786 )
00022 #endif
00023 
00024 #include "itkImageToImageFilter.h"
00025 #include "itkImage.h"
00026 #include "itkLineSpatialObject.h"
00027 
00028 namespace itk
00029 {
00030 
00060 template<typename TInputPixelType, typename TOutputPixelType>
00061 class ITK_EXPORT HoughTransform2DLinesImageFilter :
00062     public ImageToImageFilter< Image<TInputPixelType,2>, Image<TOutputPixelType,2> >
00063 {
00064 public:
00065    
00067   typedef HoughTransform2DLinesImageFilter Self;
00068 
00070   typedef Image<TInputPixelType,2> InputImageType;
00071   typedef typename InputImageType::Pointer InputImagePointer;
00072   typedef typename InputImageType::ConstPointer InputImageConstPointer;
00073   
00075   typedef Image<TOutputPixelType,2> OutputImageType;
00076   typedef typename OutputImageType::Pointer OutputImagePointer;
00077 
00079   typedef SmartPointer<Self>        Pointer;
00080   typedef SmartPointer<const Self>  ConstPointer;
00081 
00083   typedef LineSpatialObject<2>         LineType;
00084   typedef typename LineType::Pointer   LinePointer;
00085   typedef std::list<LinePointer>       LinesListType;
00086   typedef LineType::LinePointType      LinePointType;
00087 
00089   typedef ImageToImageFilter<InputImageType, OutputImageType>  Superclass;
00090 
00092   typedef typename InputImageType::IndexType IndexType;
00093 
00095   typedef typename InputImageType::PixelType PixelType;
00096 
00098   typedef typename InputImageType::RegionType OutputImageRegionType;
00099 
00101   itkTypeMacro( HoughTransform2DLinesImageFilter, ImageToImageFilter );
00102 
00104   itkNewMacro(Self);  
00105 
00107   void GenerateData();
00108 
00111   itkSetMacro(Threshold,float);
00112 
00114   itkGetMacro(Threshold,float);
00115 
00119   itkSetMacro(AngleResolution,float);
00120 
00122   itkGetMacro(AngleResolution,float);
00123 
00125   void Simplify(void);
00126 
00128   itkGetObjectMacro(SimplifyAccumulator,OutputImageType);
00129 
00131   LinesListType & GetLines(unsigned int n=0);
00132 
00134   itkSetMacro(NumberOfLines,unsigned int);
00135   itkGetMacro(NumberOfLines,unsigned int);
00136 
00139   itkSetMacro(DiscRadius,float);
00140   itkGetMacro(DiscRadius,float);
00141 
00143   itkSetMacro(Variance,float);
00144   itkGetMacro(Variance,float);
00145 
00146 protected:
00147 
00148   HoughTransform2DLinesImageFilter();
00149   virtual ~HoughTransform2DLinesImageFilter() {};
00150 
00151   HoughTransform2DLinesImageFilter(const Self&) {}
00152   void operator=(const Self&) {}
00153 
00154   void PrintSelf(std::ostream& os, Indent indent) const;
00155 
00159   void GenerateInputRequestedRegion();
00160 
00167   void GenerateOutputInformation();
00168 
00170   void EnlargeOutputRequestedRegion(DataObject *output);
00171   
00172 private:
00173 
00174   float m_AngleResolution;
00175   float m_Threshold;
00176   OutputImagePointer m_SimplifyAccumulator;
00177   LinesListType m_LinesList;
00178   unsigned int  m_NumberOfLines;
00179   float         m_DiscRadius;
00180   float         m_Variance;
00181   unsigned long m_OldModifiedTime;
00182   unsigned long m_OldNumberOfLines;
00183 };
00184 
00185 } // end namespace itk
00186 
00187 #ifndef ITK_MANUAL_INSTANTIATION
00188 #include "itkHoughTransform2DLinesImageFilter.txx"
00189 #endif
00190 
00191 #endif

Generated at Wed May 24 23:17:58 2006 for ITK by doxygen 1.3.5 written by Dimitri van Heesch, © 1997-2000