[vtkusers] about the vtkDICOMImageReader

Zhang Chuanting zctzzy2008 at 163.com
Wed Dec 5 04:13:45 EST 2012


Hi vtkusers,
I want to use the vtkDICOMImageReader to open this dicom file. But I met an error when I using the following code:
int main()
{
 //vtkStringArray *stringArray = vtkStringArray::New();
 vtkDICOMImageReader *dicomReader = vtkDICOMImageReader::New();
 //dicomReader->SetFileName("DICOM7_000152.dcm");
 dicomReader->SetFileName("IM-0001-0002.dcm");
 //dicomReader->SetFileNames();
 dicomReader->Update();
 vtkImageViewer *viewer = vtkImageViewer::New();
 viewer->SetInput(dicomReader->GetOutput());
 viewer->Render();
 vtkRenderWindowInteractor *interactor = vtkRenderWindowInteractor::New();
 viewer->SetupInteractor(interactor);
 interactor->Initialize();
 interactor->Start();
 dicomReader->Delete();
 viewer->Delete();
 interactor->Delete();
 
 return 0;
}
can anybody use vtk to open the file? Thanks a lot for anybody help me.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20121205/641e2c0c/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: IM-0001-0001.dcm
Type: application/octet-stream
Size: 99686 bytes
Desc: not available
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20121205/641e2c0c/attachment.obj>


More information about the vtkusers mailing list