<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:times new roman, new york, times, serif;font-size:12pt"><div>Hi All,<br> I had an image of type itk::VectorImage. I tried to use VectorImageToImageAdaptor to extract one component from the VectorImage.This works fine. But when I tried to use ImageRegionConstIterator over the VectorImageToImageAdaptor image I found this compilation error. I use Visual Studio 2005. Although when I use vectorImageToImageAdaptor->GetPixel(someIndex) it works fine. So how can I define a correct iterator over the VectorImageToImageAdaptor ?<br><br>//errors<br>error C2440: 'return' : cannot convert from 'unsigned char *' to 'const itk::VariableLengthVector<TValueType> *' c:\work\insighttoolkit-3.0.0\insighttoolkit-3.0.0\code\common\itkImageAdaptor.txx 351 <br>//end of errors<br><br>//code<br>typedef
itk::VectorImageToImageAdaptor< PixelType, Dimension > AdaptorType;<br>AdaptorType::Pointer vectorImageToImageAdaptor = AdaptorType::New();<br>vectorImageToImageAdaptor->SetExtractComponentIndex( componentToExtract );<br>vectorImageToImageAdaptor->SetImage( vectorImage);<br>vectorImageToImageAdaptor->Update();<br>//try to define the iterator on the adapted image<br>typedef itk::ImageRegionConstIterator< AdaptorType > ComponentImageIteratorType;<br> ComponentImageIteratorType component_iter( <br> vectorImageToImageAdaptor,<br> vectorImageToImageAdaptor->GetLargestPossibleRegion() );<br>//end of code<br><br>Please, Can you help me with this problem?<br>Best regards,<br>Ahmed<br></div></div><br>
<hr size=1>Need a quick answer? Get one in minutes from people who know. Ask your question on
<a href="http://answers.yahoo.com/;_ylc=X3oDMTFvbGNhMGE3BF9TAzM5NjU0NTEwOARfcwMzOTY1NDUxMDMEc2VjA21haWxfdGFnbGluZQRzbGsDbWFpbF90YWcx">Yahoo! Answers</a>.</body></html>