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: 2005/07/28 14:34:29 $
00007   Version:   $Revision: 1.5 $
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::FrequencyType FrequencyType ;
00114   typedef typename Superclass::MeasurementType MeasurementType ;
00115   typedef typename Superclass::InstanceIdentifier InstanceIdentifier ;
00116   typedef MeasurementVectorType ValueType ;
00117 
00119   itkStaticConstMacro(ImageDimension, unsigned int,
00120                       TImage::ImageDimension);
00121 
00122 
00123 protected:
00124   ImageToCooccurrenceListAdaptor();
00125   virtual ~ImageToCooccurrenceListAdaptor() {}
00126   void PrintSelf(std::ostream& os, Indent indent) const;  
00127 
00128 private:
00129   ImageToCooccurrenceListAdaptor(const Self&) ; //purposely not implemented
00130   void operator=(const Self&) ; //purposely not implemented
00131   OffsetTable m_OffsetTable;
00132   typename SampleType::Pointer sample;
00133 } ; // end of class ScalarImageToListAdaptor
00134 
00135 } // end of namespace Statistics
00136 } // end of namespace itk
00137 
00138 #ifndef ITK_MANUAL_INSTANTIATION
00139 #include "itkImageToCooccurrenceListAdaptor.txx"
00140 #endif
00141 
00142 #endif
00143 

Generated at Sun Sep 23 13:09:48 2007 for ITK by doxygen 1.5.1 written by Dimitri van Heesch, © 1997-2000