[vtkusers] vtkQt Volume Rendering

Matthew Seier mattie_seier at hotmail.com
Tue Jun 21 15:16:50 EDT 2005


Dear Users,

I am using the vtkQt classes by Matthias Koenig to do a ray cast volume 
rendering using .vol files as input to vtkImageImport.  I am displaying one 
volume in each of 2 vtkQtRenderWindows inside a Qt Widget.  However, 
whenever I call the Render() function using the Renderer or Interactor 
nothing renders, and when I call it using the vtkQtRenderWindow, the program 
crashes with a Segmentation fault.  I am using a tested vtk pipeline, so I 
am fairly certain that is not the problem.  I should also add that I am 
using SUSE Linux.  Does anyone know how to solve this dilemma?

Here is some of my code to import one of the volumes:
//file 1 is a string containing a filename
ifstream f1;
f1.open(file1,ios::binary);
volume1 = new unsigned short int [bytesize/2];
f1.read((char*)vol1,bytesize);
if(!f1)
    cout << "File not Found"<<endl;
f1.close();

imgdata1=vtkImageImport::New();
imgdata1->SetImportVoidPointer(vol1);
imgdata1->SetWholeExtent(0,extent1[0]-1,0,extent1[1]-1,0,extent1[2]-1);
  imgdata1->SetDataExtentToWholeExtent();
imgdata1->SetDataScalarTypeToUnsignedShort();
imgdata1->SetNumberOfScalarComponents(1);
imgdata1->Modified();
imgdata1->Update();

Thanks for your help,
Matt





More information about the vtkusers mailing list