[vtkusers] Please help this beginner of the VTK
ÿffffd6NDER AYDEMÿffffddR
onder_aydemir13 at yahoo.com
Sat Nov 18 12:43:25 EST 2006
Hi all;
I want to read a volume data and show that on the screen, (using C++) The voume data`s extension is .raw .I tried but I haven`t achieved yet. Could you tell me the problem?
here my codes;
#include "vtkImageReader2.h"
#include "vtkImageViewer2.h"
#include <iostream>
void main ()
{
//Reading .raw volume data
vtkImageReader2 *Reader=vtkImageReader2::New();
vtkImageViewer2 *viewer = vtkImageViewer2::New();
Reader->SetFilePrefix("C:\Documents and Settings\aydemir\Desktop\CAD");
Reader->SetFilePattern("%s%.d.img");
Reader->SetDataScalarTypeToUnsignedShort();
Reader->SetDataByteOrderToBigEndian();
Reader->SetDataExtent(0,255,0,255,1,28);//
Reader->SetDataSpacing(1,1,1.7);
Reader->Update();
viewer->SetInput(Reader->GetOutput());
int VolData_Images = viewer->GetWholeZMax ();
for (int i=1;i<VolData_Images;i++)
{
viewer->SetZSlice(i);
viewer->SetSize(512,512);
viewer->SetPosition(500,0);
viewer->SetColorWindow(512);
viewer->SetColorLevel(256);
viewer->Render();
}
}
---------------------------------
Sponsored Link
$420,000 Mortgage for $1,399/month - Think You Pay Too Much For Your Mortgage? Find Out!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20061118/10350d9a/attachment.htm>
More information about the vtkusers
mailing list