<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=gb2312">
<META content="MSHTML 6.00.2900.2180" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2>Hi,</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>I want to&nbsp;convert&nbsp;a &nbsp;java 3D 
array(threeDarray) to&nbsp;a vtkImageData object(image).</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>I do it use java as below:</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; vtkImageData 
image = new vtkImageData();<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
image.SetDimensions(iWidth, iHeight, 
iNumImg);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; image.SetOrigin(0.0, 0.0, 
0.0);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
image.SetSpacing(spacing[0],spacing[1],spacing[2]);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
image.SetScalarType(5);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
image.AllocateScalars();<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; vtkDataArray 
array = 
image.GetPointData().GetScalars();<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
</FONT></DIV><FONT size=2>
<DIV><BR><FONT 
face=Arial>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;for(int iZ = 0; iY 
&lt; iNumImg; iZ++){</FONT></DIV>
<DIV><FONT face=Arial></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
for(int iY= 0; iY &lt; iHeight; iY++){</FONT></DIV>
<DIV><FONT face=Arial></FONT>&nbsp;</DIV>
<DIV><FONT 
face=Arial>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
for(int iX = 0; iX &lt; iWidth; iX++){</FONT></DIV>
<DIV><FONT face=Arial></FONT>&nbsp;</DIV>
<DIV><FONT 
face=Arial>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
array.InsertNextTuple1(threeDarray[iZ][iY][iX]);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
}</FONT></DIV>
<DIV><FONT face=Arial>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</FONT></DIV>
<DIV><FONT face=Arial>}</FONT></DIV>
<DIV><FONT face=Arial></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial>However, it is very slow due to the insertNextTuple(). 
Anybody tell me a queikly method?</FONT></DIV>
<DIV><FONT face=Arial></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial>Best regards,</FONT></DIV>
<DIV><FONT face=Arial></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial>Yixun Liu</FONT></FONT></DIV></BODY></HTML>