<div>If I create an adaptor to represent one channel of a vector image:</div><div><br></div><div>typedef itk::VectorImage<float, 2> VectorImageType;</div><div><br></div><div> VectorImageType::Pointer image = VectorImageType::New();</div>
<div> ... Create image ... </div><div><br></div><div> typedef itk::VectorImageToImageAdaptor<float, 2> ImageAdaptorType;</div><div> ImageAdaptorType::Pointer adaptor = ImageAdaptorType::New();</div><div> adaptor->SetExtractComponentIndex(0);</div>
<div> adaptor->SetImage(image);</div><div><br></div><div>And then try to create an iterator:</div><div><br></div><div> itk::ImageRegionIterator<ImageAdaptorType> imageIterator(adaptor, adaptor->GetLargestPossibleRegion());</div>
<div><br></div><div>I get this error:</div><div><br></div><div><div>itkImageAdaptor.hxx:334:36: error: cannot convert ‘itk::VectorImage<float, 2u>::InternalPixelType* {aka float*}’ to ‘const InternalPixelType* {aka const itk::VariableLengthVector<float>*}’ in return</div>
</div><div><br></div><div>I also tried using the resulting scalar image type for the iterator:</div><div><br></div><div>typedef itk::Image<float, 2> ScalarImageType;</div><div>itk::ImageRegionIterator<ScalarImageType> imageIterator(adaptor, adaptor->GetLargestPossibleRegion());</div>
<div><br></div><div>but of course I get this error:</div><div><div>VectorImageToImageAdaptor.cxx:35:103: error: no matching function for call to ‘itk::ImageRegionIterator<itk::Image<float, 2u> >::ImageRegionIterator(itk::VectorImageToImageAdaptor<float, 2u>::Pointer&, const RegionType&)’</div>
</div><div><br></div><div>Is it not possible to iterate over an adaptor like this?</div><div><br></div>Thanks,<br><br>David<br>