[vtkusers] 2D to 3D dicom image
m26404030 at john.petra.ac.id
m26404030 at john.petra.ac.id
Wed Aug 29 12:50:44 EDT 2007
I am a newbie who want to read a set of DICOM images and display it as 3D
volume..
i dont know how to do it..
plis help me
this is my code(still wrong)
-------------------------------------------
void main()
{
vtkRenderer *aRenderer = vtkRenderer::New();
vtkRenderWindow *renWin = vtkRenderWindow::New();
renWin->AddRenderer(aRenderer);
vtkRenderWindowInteractor *iren = vtkRenderWindowInteractor::New();
iren->SetRenderWindow(renWin);
vtkVolume16Reader *reader=vtkVolume16Reader::New();
reader->SetDataByteOrderToLittleEndian();
reader->SetFilePrefix("SE1/image.dcm");//i put my image in folder SE1 and named
it image.dcm.1,image.dcm.2,...,image.dcm.58
reader->SetImageRange(1,58);
reader->SetDataSpacing (1,1,1);//dont really understand what data spacing means
reader->Update();
vtkImageActor *vol=vtkImageActor::New();
vol->SetInput(reader->GetOutput());
aRenderer->AddActor(vol);
renWin->Render();
iren->Start();
}
More information about the vtkusers
mailing list