[vtkusers] Reading raw volume data into vtk

Emma Ryan eryanvtk at yahoo.com
Tue Oct 24 03:21:23 EDT 2006


Hi all,
  
  I am trying to read a set of 2D slices that are in .raw format. How should I do this ? in C++. 

The following is the code that I use and I get errors with it

My quesiton is: 

1. How should the slices be labeled ?

I have 065.raw, 066.raw, 067.raw....095.raw as the slice names
There are 32 slices in all each of 256 x 256 size.

I renamed them to file.raw.0, file.raw.1, file.raw.2...
Some websites mentioned that this should be the format.
I renamed the first 3 slices and have hence reduced the extent to
 0, 255, 0,255, 0, 2.

2. I get the following error for 
ERROR: In ..\..\vtk\Filtering\vtkStreamingDemandDrivenPipeline.cxx, line 
628
vtkStreamingDemandDrivenPipeline (061A8E28): The update extent specified 
in the information ....(the rest is hidden by a windows-debug popup window)


Here is the code that I use.

vtkImageReader *v16 = vtkImageReader::New();

    v16->SetDataScalarTypeToUnsignedChar();
    v16->SetHeaderSize(0);
    v16->SetFileDimensionality(2);
    v16->SetDataByteOrderToLittleEndian();
    v16->SetFilePrefix ("065.raw");
    v16->SetDataExtent(0, 255, 0, 255, 0 , 2);
    v16->SetDataSpacing (1.0, 1.0, 4.0);
    v16->Update();


Any help in this direction is greatly appreciated.
thanks,
Emma

 		
---------------------------------
Get your email and more, right on the  new Yahoo.com 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20061024/bedb266d/attachment.htm>


More information about the vtkusers mailing list