[vtkusers] DICOM image rendering problem in VTK-Java
Kadir Cenk
kadircenk3 at hotmail.com
Tue Mar 14 12:20:18 EDT 2017
Hello,
I am trying to develop an application in Java, using VTK to visualize DICOM files read from a directory, using a vtkImageViewer2 object to visualize. Below is the code segment that I try to execute:
vtkDICOMImageReader reader = new vtkDICOMImageReader();
reader.SetDirectoryName("~/DICOM/abdomen_bt/3");
reader.Update();
vtkImageViewer2 imageViewer2 = new vtkImageViewer2();
imageViewer2.SetInputConnection(reader.GetOutputPort());
vtkRenderWindowInteractor renderWindowInteractor = new vtkRenderWindowInteractor();
imageViewer2.SetupInteractor(renderWindowInteractor);
imageViewer2.Render();
imageViewer2.GetRenderer().ResetCamera();
renderWindowInteractor.Start();
imageViewer2.Render();
My problem is that, this code segment renders an empty screen. But when I convert the same code segment to C++, the window renders the DICOM image successfully.
The path to the DICOM directory is valid, and DICOM files are not compressed (180 of them), and I am using VTK 7.1.0.
What might be the problem? Any help will be appreciated.
Thank you.
Kadir Cenk
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20170314/cdc1ecc3/attachment.html>
More information about the vtkusers
mailing list