[vtkusers] problems reading in data using vtkImageReader

Lindsey McAninch lindsey at sci.utah.edu
Mon Jun 28 11:53:52 EDT 2004


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



More information about the vtkusers mailing list