[vtkusers] DICOM image rendering problem in VTK-Java

Sebastien Jourdain sebastien.jourdain at kitware.com
Tue Mar 14 13:05:12 EDT 2017


Hi Kadir,

I'm guessing for the path you are not using "~" but the actual absolute
path?

I don't know anything on the DICOM part, but for Java I would suggest using
the vtkCanvas class.

Seb

On Tue, Mar 14, 2017 at 10:20 AM, Kadir Cenk <kadircenk3 at hotmail.com> wrote:

> 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
>
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at http://www.kitware.com/
> opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
>
> Search the list archives at: http://markmail.org/search/?q=vtkusers
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/vtkusers
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20170314/198d7230/attachment.html>


More information about the vtkusers mailing list