[vtkusers] reading row 3D voxel data

Jens Frederich jfrederich at mac.com
Sat Jan 8 14:27:25 EST 2005


Hi all,

what is the best class (way) for reading 3D binary row voxel data. The 
data is saved in one file, not many 2D images. I would do volume 
rendering, isosurface, contour etc with this data.
With the volume rendering library vgl 
(http://www.volumegraphics.com/products/vgl/index.html) is this very 
simple. Here a code sample:

VGLSampleGridData* volumeData = new VGLSampleGridData (VGL_TYPE_UINT16);
  // load voxel data:
   VGLSampleGridIO* importPlugIn = VGLSampleGridIO::create ("raw");
   importPlugIn->setHeaderSkip (40);
   imortPlugIn->setSampleGridSize (VGLSampleGridSize (42,42,42));
   importPlugIn->setSampleGridSize (VGLSampleGridSize (250,250,1));
   importPlugIn->setSampleDataType (VGL_TYPE_UINT16);
   importPlugIn->open ("../data/simdata4.vol");
   importPlugIn->read (volumeData);
   importPlugIn->close ();
   delete importPlugIn;

It's very easy. But I search the same on vtk please.
Thanks for help.

Best regards,
Jens




More information about the vtkusers mailing list