[Insight-users] Error in itk::Statistics::ImageToListSampleAdaptor with itk::VectorImage as input

sahar.gh sahargh at augsignals.com
Wed Sep 5 21:14:40 EDT 2012


Hi,

I am trying to use ImageToListSampleAdaptor with a VectorImage in ITK
v3.20.0. My input image pixel type is variable length vector, which the
documentation says is supported by the adaptor. The error I get is:

~/src/myClustering.cxx: In function ‘int main(int, char**)’:
In file included
from~/extern/include/InsightToolkit/Review/Statistics/itkImageToListSampleAdaptor.h:301,
                 from ~/src/myClustering.cxx:18:
~/extern/include/InsightToolkit/Review/Statistics/itkImageToListSampleAdaptor.txx:
In member function ‘const typename
itk::Statistics::ImageToListSampleAdaptor<TImage>::MeasurementVectorType&
itk::Statistics::ImageToListSampleAdaptor<TImage>::GetMeasurementVector(typename
itk::Statistics::ListSample<typename
itk::Statistics::MeasurementVectorPixelTraits<typename
TImage::PixelType>::MeasurementVectorType>::InstanceIdentifier) const [with
TImage = itk::VectorImage<short int, 3u>]’:
~/src/myClustering.cxx:156:   instantiated from here
~/extern/include/InsightToolkit/Review/Statistics/itkImageToListSampleAdaptor.txx:45:
error: no matching function for call to
‘itk::Statistics::MeasurementVectorTraits::Assign(itk::VariableLengthVector<short
int>&, const short int&)’


The code is as follows:

typedef short PixelType;
const unsigned int ImageDimension = 3;
typedef itk::VectorImage< PixelType, ImageDimension >   ImageType;

typedef itk::ImageFileReader<ImageType> ReaderType;
ReaderType::Pointer reader = ReaderType::New();
reader->SetFileName(argv[1]);

typedef itk::Statistics::ImageToListSampleAdaptor< ImageType > AdaptorType;
AdaptorType::Pointer adaptor = AdaptorType::New();
adaptor->SetImage( reader->GetOutput() );
std::cout << "number of samples :" << adaptor->Size() << ", each sample has
length: " <<  adaptor->GetMeasurementVectorSize() << std::endl;


Thanks in advance for your help




--
View this message in context: http://itk-insight-users.2283740.n2.nabble.com/Error-in-itk-Statistics-ImageToListSampleAdaptor-with-itk-VectorImage-as-input-tp7580943.html
Sent from the ITK Insight Users mailing list archive at Nabble.com.


More information about the Insight-users mailing list