[Insight-users] VectorImageToImageAdaptor

David Doria daviddoria at gmail.com
Thu Mar 24 17:12:37 EDT 2011


I am having trouble getting this filter to present a scalar image.
Below is a short example - it creates a vector image and then tries to
find the max/min of the adapted scalar image (the 0th component) :

typedef itk::VectorImage<float, 2> VectorImageType;
VectorImageType::Pointer image;

// ... Fill image ...

typedef itk::VectorImageToImageAdaptor<float, 2> ImageAdaptorType;
ImageAdaptorType::Pointer adaptor = ImageAdaptorType::New();
adaptor->SetExtractComponentIndex(0);
adaptor->SetImage(image);

typedef itk::MinimumMaximumImageCalculator <ImageAdaptorType>
ImageCalculatorFilterType;
ImageCalculatorFilterType::Pointer imageCalculatorFilter =
ImageCalculatorFilterType::New();
imageCalculatorFilter->SetImage(adaptor);
imageCalculatorFilter->Compute();

The error is:
itkImageAdaptor.txx:334: error: cannot convert ‘float*’ to ‘const
itk::VariableLengthVector<float>*’ in return

Is there a different adaptor I am supposed to be using for this?

Thanks,

David


More information about the Insight-users mailing list