<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>&nbsp;&nbsp; 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-&gt;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&lt;TValueType&gt; *'&nbsp;&nbsp;&nbsp; c:\work\insighttoolkit-3.0.0\insighttoolkit-3.0.0\code\common\itkImageAdaptor.txx&nbsp;&nbsp;&nbsp; 351&nbsp;&nbsp;&nbsp; <br>//end of errors<br><br>//code<br>typedef
 itk::VectorImageToImageAdaptor&lt; PixelType, Dimension &gt; AdaptorType;<br>AdaptorType::Pointer vectorImageToImageAdaptor = AdaptorType::New();<br>vectorImageToImageAdaptor-&gt;SetExtractComponentIndex( componentToExtract );<br>vectorImageToImageAdaptor-&gt;SetImage( vectorImage);<br>vectorImageToImageAdaptor-&gt;Update();<br>//try to define the iterator on the adapted image<br>typedef itk::ImageRegionConstIterator&lt; AdaptorType &gt; ComponentImageIteratorType;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; ComponentImageIteratorType component_iter( <br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; vectorImageToImageAdaptor,<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; vectorImageToImageAdaptor-&gt;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>