00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef __itkNeighborhoodSampler_h
00018 #define __itkNeighborhoodSampler_h
00019
00020 #include "itkMacro.h"
00021 #include "itkObject.h"
00022 #include "itkSample.h"
00023 #include "itkSubsample.h"
00024 #include "itkFixedArray.h"
00025 #include "itkSampleAlgorithmBase.h"
00026
00027 namespace itk{
00028 namespace Statistics{
00029
00040 template < class TSample >
00041 class ITK_EXPORT NeighborhoodSampler : public SampleAlgorithmBase< TSample >
00042 {
00043 public:
00045 typedef NeighborhoodSampler Self ;
00046 typedef SampleAlgorithmBase< TSample > Superclass ;
00047 typedef SmartPointer< Self > Pointer ;
00048 typedef SmartPointer< const Self > ConstPointer ;
00049
00051 itkTypeMacro(NeighborhoodSampler, SampleAlgorithmBase);
00052
00054 itkNewMacro(Self) ;
00055
00057 typedef TSample SampleType ;
00058
00060 itkStaticConstMacro(MeasurementVectorSize, unsigned int,
00061 TSample::MeasurementVectorSize) ;
00062 typedef typename TSample::MeasurementVectorType MeasurementVectorType ;
00063 typedef typename TSample::MeasurementType MeasurementType ;
00064 typedef typename TSample::FrequencyType FrequencyType ;
00065 typedef typename TSample::InstanceIdentifier InstanceIdentifier ;
00066
00068 typedef typename Superclass::InputSampleType InputSampleType ;
00069
00071 typedef Subsample< TSample > SubsampleType ;
00072
00074 typedef double RadiusType ;
00075
00077 typedef FixedArray< double, itkGetStaticConstMacro(MeasurementVectorSize) > CenterType ;
00078
00080 void SetCenter(CenterType* center)
00081 {
00082 if ( m_Center != center )
00083 {
00084 m_Center = center ;
00085 this->Modified() ;
00086 }
00087 }
00088
00090 CenterType* GetCenter()
00091 { return m_Center ; }
00092
00094 void SetRadius(RadiusType* radius)
00095 {
00096 if ( m_Radius != radius )
00097 {
00098 m_Radius = radius ;
00099 this->Modified() ;
00100 }
00101 }
00102
00104 RadiusType* GetRadius()
00105 { return m_Radius ; }
00106
00108 typedef SubsampleType OutputType ;
00109
00111 typedef typename SubsampleType::Pointer OutputPointer ;
00112
00114 OutputPointer GetOutput() ;
00115
00116 protected:
00117 NeighborhoodSampler() ;
00118 virtual ~NeighborhoodSampler() {}
00119 virtual void PrintSelf(std::ostream& os, Indent indent) const ;
00120
00121 void GenerateData() ;
00122
00123 private:
00124 NeighborhoodSampler(const Self&) ;
00125 void operator=(const Self&) ;
00126
00127 CenterType* m_Center ;
00128 RadiusType* m_Radius ;
00129 typename SubsampleType::Pointer m_Subsample ;
00130 } ;
00131
00132 }
00133 }
00134
00135 #ifndef ITK_MANUAL_INSTANTIATION
00136 #include "itkNeighborhoodSampler.txx"
00137 #endif
00138
00139 #endif