[vtkusers] problems reading in data using vtkImageReader

Amy Henderson amy.henderson at kitware.com
Mon Jun 28 11:56:51 EDT 2004


Did you link the vtkIO library into the program you are writing?

- Amy

At 11:53 AM 6/28/2004, 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