[Insight-users] drawing a line
David Doria
daviddoria at gmail.com
Thu Apr 21 10:59:05 EDT 2011
2011/4/21 LaMoOsH .. <xlolla28x at hotmail.com>
> Hello,
>
> I am new to itk, and trying to draw a line between two points.
>
> typedef itk::LineConstIterator< OutputImageType > LineIteratorType;
> LineIteratorType it( reader, (170.910,144.438),(170.910,450.510) );
> it.GoToBegin();
> while (!it.IsAtEnd())
> {
> std::cout << (float)it.Get() << std::endl;
> ++it;
> }
>
> can I know what is wring with this code?
> the error is
>
> error C2664: 'itk::LineConstIterator<TImage>::LineConstIterator(const
> itk::Image<TPixel,VImageDimension> *,const itk::Index<VIndexDimension>
> &,const itk::Index<VIndexDimension> &)' : cannot convert parameter 1 from
> 'itk::SmartPointer<TObjectType>' to 'const
> itk::Image<TPixel,VImageDimension> *'
>
> i think the way im writing the points might be wrong. not sure.
> my reader a reader to an image already defined before and the pixel is of
> type float.
> output image type is the output of another function that was applied on my
> image.
>
> hope i get some help.
>
> Thank you.
>
Have you looked at this?
http://www.vtk.org/Wiki/ITK/Examples/Iterators/LineIterator
David
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20110421/0e61d8f9/attachment.htm>
More information about the Insight-users
mailing list