[Insight-users] problem with VectorImageToImageAdaptor and
ImageRegionConstIterator
ahmed saad
ahmedalysaad2004 at yahoo.com
Thu Jan 11 01:32:58 EST 2007
Hi All,
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 ?
//errors
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
//end of errors
//code
typedef itk::VectorImageToImageAdaptor< PixelType, Dimension > AdaptorType;
AdaptorType::Pointer vectorImageToImageAdaptor = AdaptorType::New();
vectorImageToImageAdaptor->SetExtractComponentIndex( componentToExtract );
vectorImageToImageAdaptor->SetImage( vectorImage);
vectorImageToImageAdaptor->Update();
//try to define the iterator on the adapted image
typedef itk::ImageRegionConstIterator< AdaptorType > ComponentImageIteratorType;
ComponentImageIteratorType component_iter(
vectorImageToImageAdaptor,
vectorImageToImageAdaptor->GetLargestPossibleRegion() );
//end of code
Please, Can you help me with this problem?
Best regards,
Ahmed
____________________________________________________________________________________
Yahoo! Music Unlimited
Access over 1 million songs.
http://music.yahoo.com/unlimited
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://public.kitware.com/pipermail/insight-users/attachments/20070110/551ccf15/attachment.htm
More information about the Insight-users
mailing list