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

itkJointDomainImageToListAdaptor.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Insight Segmentation & Registration Toolkit
00004   Module:    $RCSfile: itkJointDomainImageToListAdaptor.h,v $
00005   Language:  C++
00006   Date:      $Date: 2003/12/15 01:00:46 $
00007   Version:   $Revision: 1.11 $
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 __itkJointDomainImageToListAdaptor_h
00018 #define __itkJointDomainImageToListAdaptor_h
00019 
00020 #include "itkMacro.h"
00021 #include "itkFixedArray.h"
00022 #include "itkPoint.h"
00023 #include "itkPixelTraits.h"
00024 #include "itkImageToListAdaptor.h"
00025 #include "itkImageRegionConstIteratorWithIndex.h"
00026 #include "itkEuclideanDistance.h"
00027 #include "itkListSample.h"
00028 
00029 namespace itk{ 
00030 namespace Statistics{
00031 
00039 template< class TImage >
00040 struct ImageJointDomainTraits
00041 {
00042   typedef ImageJointDomainTraits Self ;
00043   typedef PixelTraits< typename TImage::PixelType > PixelTraitsType ;
00044   typedef typename PixelTraitsType::ValueType RangeDomainMeasurementType ;
00045   typedef typename TImage::IndexType::IndexValueType IndexValueType ;
00046   itkStaticConstMacro(ImageDimension, unsigned int, TImage::ImageDimension) ;
00047   itkStaticConstMacro(Dimension, 
00048                       unsigned int, 
00049                       TImage::ImageDimension +
00050                       PixelTraitsType::Dimension ) ;
00051   typedef float CoordinateRepType ;
00052   typedef Point< CoordinateRepType, itkGetStaticConstMacro(ImageDimension) > PointType ;
00053   typedef JoinTraits< RangeDomainMeasurementType, CoordinateRepType > 
00054   JoinTraitsType ;
00055   typedef typename JoinTraitsType::ValueType MeasurementType ;
00056   typedef FixedArray< MeasurementType, itkGetStaticConstMacro(Dimension) >
00057   MeasurementVectorType ;
00058 } ; // end of ImageJointDomainTraits
00059 
00089 template < class TImage >
00090 class ITK_EXPORT JointDomainImageToListAdaptor 
00091   : public ImageToListAdaptor< 
00092   TImage, 
00093   typename ImageJointDomainTraits< TImage >::MeasurementVectorType >
00094 {
00095 public:
00096   typedef ImageJointDomainTraits< TImage > ImageJointDomainTraitsType ;
00097   typedef typename ImageJointDomainTraitsType::MeasurementVectorType
00098   MeasurementVectorType ;
00099   typedef typename ImageJointDomainTraitsType::MeasurementType
00100   MeasurementType ;
00101   typedef typename ImageJointDomainTraitsType::RangeDomainMeasurementType
00102   RangeDomainMeasurementType ;
00103   typedef typename ImageJointDomainTraitsType::PointType PointType ;
00104   typedef typename ImageJointDomainTraitsType::CoordinateRepType 
00105   CoordinateRepType ;
00107   typedef JointDomainImageToListAdaptor Self;
00108   typedef ImageToListAdaptor< TImage, MeasurementVectorType > 
00109   Superclass;
00110   typedef SmartPointer< Self > Pointer;
00111   typedef SmartPointer<const Self> ConstPointer;
00112   
00114   itkTypeMacro(JointDomainImageToListAdaptor, ImageToListAdaptor) ;
00115   
00117   itkNewMacro(Self) ;
00118   
00120   itkStaticConstMacro(MeasurementVectorSize, 
00121                       unsigned int, 
00122                       ImageJointDomainTraitsType::Dimension) ;
00123 
00126   typedef typename Superclass::FrequencyType FrequencyType ;
00127   typedef typename Superclass::InstanceIdentifier InstanceIdentifier ;
00128 
00129   typedef typename TImage::IndexType ImageIndexType ;
00130   typedef typename TImage::IndexType::IndexValueType ImageIndexValueType ;
00131   typedef typename TImage::SizeType ImageSizeType ;
00132   typedef typename TImage::RegionType ImageRegionType ;
00133   typedef ImageRegionConstIteratorWithIndex< TImage > ImageIteratorType ;
00134 
00135   typedef MeasurementVectorType ValueType ;
00136  
00137   itkStaticConstMacro(RangeDomainDimension, 
00138                       unsigned int, 
00139                       itk::PixelTraits< 
00140                       typename TImage::PixelType >::Dimension) ;
00141 
00142   typedef FixedArray< RangeDomainMeasurementType, 
00143                       itkGetStaticConstMacro( RangeDomainDimension ) > 
00144   RangeDomainMeasurementVectorType ;
00145 
00146   typedef std::vector< InstanceIdentifier > InstanceIdentifierVectorType ; 
00147 
00148   typedef FixedArray< float, itkGetStaticConstMacro(MeasurementVectorSize) >
00149   NormalizationFactorsType ;
00150 
00152   void SetNormalizationFactors(NormalizationFactorsType& factors) ;
00153 
00156   inline const MeasurementVectorType & GetMeasurementVector(const InstanceIdentifier &id) const;
00157 
00160   inline void ComputeRegion(const MeasurementVectorType& mv, 
00161                             const double radius,
00162                             ImageRegionType& region) const;
00163 
00167   inline void Search(const MeasurementVectorType& mv, 
00168                      const double radius, 
00169                      InstanceIdentifierVectorType& result) const;
00170 
00171 protected:
00172   JointDomainImageToListAdaptor() ;
00173   virtual ~JointDomainImageToListAdaptor() {}
00174   void PrintSelf(std::ostream& os, Indent indent) const;  
00175 
00176 private:
00177   JointDomainImageToListAdaptor(const Self&) ; //purposely not implemented
00178   void operator=(const Self&) ; //purposely not implemented
00179 
00180   NormalizationFactorsType m_NormalizationFactors ;
00181 
00182   mutable MeasurementVectorType m_TempVector ;
00183   mutable PointType m_TempPoint ;
00184   mutable ImageIndexType m_TempIndex ;
00185   mutable RangeDomainMeasurementVectorType m_TempRangeVector ;
00186 } ; // end of class JointDomainImageToListAdaptor
00187 
00188 } // end of namespace Statistics
00189 } // end of namespace itk
00190 
00191 #ifndef ITK_MANUAL_INSTANTIATION
00192 #include "itkJointDomainImageToListAdaptor.txx"
00193 #endif
00194 
00195 #endif

Generated at Wed Mar 30 00:00:18 2005 for ITK by doxygen 1.3.9.1 written by Dimitri van Heesch, © 1997-2000