[Insight-users] drawing a line

David Doria daviddoria at gmail.com
Thu Apr 21 13:38:01 EDT 2011


2011/4/21 LaMoOsH .. <xlolla28x at hotmail.com>

>  Hi,
>
> Thank you for your help !
>
> I did what u told me .. and I still get the same error
>
> 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> *'
>
> how can I fix it ?
>
> thanks
>

This builds fine for me:

#include <iostream>

#include "itkLineConstIterator.h"

int main(int argc, char *argv[])
{
  typedef itk::Image<unsigned char, 2> ImageType;
  ImageType::Pointer image = ImageType::New();

  typedef itk::LineConstIterator< ImageType > LineIteratorType;
  ImageType::IndexType point0;
  point0[0] = 170.91;
  point0[1] = 144.438;

  ImageType::IndexType point1;
  point1[0] = 170.91;
  point1[1] = 450.510;

  LineIteratorType it( image, point0, point1);
  it.GoToBegin();
  while (!it.IsAtEnd())
    {
    std::cout << (float)it.Get() << std::endl;
    ++it;
    }

  return EXIT_SUCCESS;
}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20110421/a723bd71/attachment.htm>


More information about the Insight-users mailing list