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

itkImageToCooccurrenceListAdaptor.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Insight Segmentation & Registration Toolkit
00004   Module:    $RCSfile: itkImageToCooccurrenceListAdaptor.h,v $
00005   Language:  C++
00006   Date:      $Date: 2008/01/16 19:08:02 $
00007   Version:   $Revision: 1.6 $
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 
00018 #ifndef __itkImageToCooccurrenceListAdaptor_h
00019 #define __itkImageToCooccurrenceListAdaptor_h
00020 
00021 #include <typeinfo>
00022 
00023 #include "itkImage.h"
00024 #include "itkPixelTraits.h"
00025 #include "itkImageToListAdaptor.h"
00026 #include "itkSmartPointer.h"
00027 #include "itkImageRegionIterator.h"
00028 #include "itkShapedNeighborhoodIterator.h"
00029 #include "itkNeighborhoodIterator.h"
00030 #include "itkNeighborhoodAlgorithm.h"
00031 #include "itkConstantBoundaryCondition.h"
00032 #include "itkListSample.h"
00033 #include "itkFixedArray.h"
00034 #include "itkMacro.h"
00035 
00036 #include <vector>
00037 #include <algorithm>
00038 #include <iostream>
00039 
00040 namespace itk{ 
00041 namespace Statistics{
00042 
00053 template < class TImage >
00054 class ITK_EXPORT ImageToCooccurrenceListAdaptor
00055   : public ImageToListAdaptor< 
00056   TImage, 
00057   FixedArray< typename TImage::PixelType, 2 > >
00058 {
00059 public:
00060   typedef TImage ImageType;
00061 
00062   typedef FixedArray< typename TImage::PixelType, 2 > MeasurementVectorType ;
00063 
00064   typedef itk::Statistics::ListSample< MeasurementVectorType > SampleType ;
00065   typedef typename SampleType::MeasurementVectorSizeType MeasurementVectorSizeType;
00066 
00068   typedef ImageToCooccurrenceListAdaptor Self;
00069   typedef ImageToListAdaptor< TImage, MeasurementVectorType > Superclass;
00070   typedef SmartPointer< Self > Pointer;
00071   typedef SmartPointer<const Self> ConstPointer;
00072 
00074   typedef itk::ShapedNeighborhoodIterator< 
00075                   TImage , 
00076                   ConstantBoundaryCondition<TImage> 
00077                                        > ShapedNeighborhoodIteratorType;
00078 
00080   typedef typename ShapedNeighborhoodIteratorType::OffsetType OffsetType;
00081   typedef std::vector<OffsetType> OffsetTable;
00082 
00083   void UseNeighbor(const OffsetType & offset);
00084 
00086   void Compute();
00087 
00089   itkTypeMacro(ImageToCooccurrenceListAdaptor, ListSampleBase);
00090 
00092   itkNewMacro(Self);
00093 
00095   itkStaticConstMacro(MeasurementVectorSize, unsigned int, 2);
00096 
00097   virtual void SetMeasurementVectorSize( const MeasurementVectorSizeType )
00098     {
00099     // Measurement vector size for this class is fixed as the pixel's 
00100     // dimension. This method should have no effect
00101     itkWarningMacro( << "This method does nothing! The MeasurementVectorSize is " 
00102         << MeasurementVectorSize );
00103     }
00104 
00105  unsigned int GetMeasurementVectorSize() const
00106    {
00107    return Superclass::MeasurementVectorSize;
00108    } 
00109   
00110 
00113   typedef typename Superclass::PixelType          PixelType ;
00114   typedef typename Superclass::FrequencyType      FrequencyType ;
00115   typedef typename Superclass::MeasurementType    MeasurementType ;
00116   typedef typename Superclass::InstanceIdentifier InstanceIdentifier ;
00117   typedef MeasurementVectorType                   ValueType ;
00118 
00120   itkStaticConstMacro(ImageDimension, unsigned int,
00121                       TImage::ImageDimension);
00122 
00123 
00124 protected:
00125   ImageToCooccurrenceListAdaptor();
00126   virtual ~ImageToCooccurrenceListAdaptor() {}
00127   void PrintSelf(std::ostream& os, Indent indent) const;  
00128 
00129 private:
00130   ImageToCooccurrenceListAdaptor(const Self&) ; //purposely not implemented
00131   void operator=(const Self&) ; //purposely not implemented
00132   OffsetTable m_OffsetTable;
00133   typename SampleType::Pointer sample;
00134 } ; // end of class ScalarImageToListAdaptor
00135 
00136 } // end of namespace Statistics
00137 } // end of namespace itk
00138 
00139 #ifndef ITK_MANUAL_INSTANTIATION
00140 #include "itkImageToCooccurrenceListAdaptor.txx"
00141 #endif
00142 
00143 #endif
00144 

Generated at Tue Jul 29 20:47:39 2008 for ITK by doxygen 1.5.1 written by Dimitri van Heesch, © 1997-2000