[vtkusers] problems reading in data using vtkImageReader
Mathieu Malaterre
mathieu.malaterre at kitware.com
Mon Jun 28 11:57:20 EDT 2004
Lindsey,
You need to add vtkIO in your CMakeLists.txt
HTH
Mathieu
Lindsey McAninch wrote:
> Hello all! This is probably an easy question but I am new at vtk and am
> struggling a little bit. I am trying write a program that reads raw
> image data into vtk. I am programming in c++. Every time I include
> this portion of code:
>
>
> vtkImageReader *aReader = vtkImageReader::New();
> aReader->SetFileName (argv[1]);
> aReader->SetDataScalarTypeToUnsignedChar();
> aReader->SetDataByteOrderToLittleEndian();
> aReader->SetFileDimensionality( 3 );
> aReader->SetDataSpacing(0.294922, 0.0294922, 1);
> aReader->SetDataExtent(0, 200, 0, 200, 0, 50);
>
> specifically creating a new vtkImageReader, I get the following error:
>
> Building executable /home/sci/lindsey/VTK/LindseyPrograms/SegRender...
> SegRender.o(.text+0x120): In function `main':
> : undefined reference to `vtkImageReader::New()'
> collect2: ld returned 1 exit status
> make[1]: *** [/home/sci/lindsey/VTK/LindseyPrograms/SegRender] Error 1
> make: *** [default_target] Error 2
>
> I am not sure what I am doing wrong, whether my vtk is not built right
> or if I am not including a needed library or something of that sort.
> Any help would be much appreciated.
> Thanks!
>
> Lindsey
>
> lindsey at sci.utah.edu
> _______________________________________________
> This is the private VTK discussion list. Please keep messages on-topic.
> Check the FAQ at: <http://public.kitware.com/cgi-bin/vtkfaq>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>
More information about the vtkusers
mailing list