<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-9">
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
</head>
<body dir="ltr">
<div id="divtagdefaultwrapper" style="font-size:12pt;color:#000000;font-family:Calibri,Arial,Helvetica,sans-serif;" dir="ltr">
<p></p>
<p style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px;">Hello,</p>
<p style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px;"><br>
</p>
<p style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px;">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:<br>
<br>
</p>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px;">
vtkDICOMImageReader reader = new vtkDICOMImageReader();<br>
reader.SetDirectoryName("~/DICOM/abdomen_bt/3");<br>
reader.Update();<br>
<br>
vtkImageViewer2 imageViewer2 = new vtkImageViewer2();<br>
imageViewer2.SetInputConnection(reader.GetOutputPort());<br>
<br>
vtkRenderWindowInteractor renderWindowInteractor = new vtkRenderWindowInteractor();<br>
<br>
imageViewer2.SetupInteractor(renderWindowInteractor);<br>
<br>
imageViewer2.Render();<br>
imageViewer2.GetRenderer().ResetCamera();<br>
renderWindowInteractor.Start();<br>
imageViewer2.Render();</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px;">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px;">
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.</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px;">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px;">
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.<br>
<br>
What might be the problem? Any help will be appreciated.<br>
<br>
Thank you.</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px;">
<br>
Kadir Cenk</div>
<br>
<p></p>
</div>
</body>
</html>