17 #ifndef __itkImageToCooccurrenceListAdaptor_txx
18 #define __itkImageToCooccurrenceListAdaptor_txx
21 namespace Statistics {
23 template <
class TImage >
27 m_Sample = SampleType::New();
28 m_Sample->SetMeasurementVectorSize( MeasurementVectorSize );
31 template <
class TImage >
36 Superclass::PrintSelf(os,indent);
39 template <
class TImage >
54 FaceCalculatorType faceCalculator;
55 typename FaceCalculatorType::FaceListType faceList;
56 typename FaceCalculatorType::FaceListType::iterator fit;
60 typedef typename OffsetTable::iterator OffsetIterator;
64 faceList = faceCalculator( this->GetImage(),
65 this->GetImage()->GetRequestedRegion(),
69 center_offset.
Fill( 0 );
71 for ( fit=faceList.begin(); fit != faceList.end(); ++fit)
75 it.OverrideBoundaryCondition(&boundaryCondition);
77 OffsetIterator iter = m_OffsetTable.begin();
78 while( iter != m_OffsetTable.end() )
84 for ( it.GoToBegin(); !it.IsAtEnd(); ++it )
87 const PixelType center_pixel_intensity = it.GetPixel( center_offset );
89 ShapeNeighborhoodIterator ci = it.
Begin();
90 while ( ci != it.
End() )
96 coords[0] = center_pixel_intensity;
97 coords[1] = pixel_intensity;
99 m_Sample->PushBack(coords);
108 template <
class TImage >
114 bool isTheCenterPixel =
true;
115 for(
unsigned int i=0; i<ImageDimension; i++)
119 isTheCenterPixel =
false;
124 if( !isTheCenterPixel )
126 m_OffsetTable.push_back( offset );