00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
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 } ;
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&) ;
00178
void operator=(
const Self&) ;
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 } ;
00187
00188 }
00189 }
00190
00191
#ifndef ITK_MANUAL_INSTANTIATION
00192
#include "itkJointDomainImageToListAdaptor.txx"
00193
#endif
00194
00195
#endif