title: how to use java to read array to vtkImageData
body: <p>I would like to use java to virtualize a 3D array. However, there is not too much demo code using java, so I take some C++ demo code for example.Here is an example using C++ that implements 3D Reconstruction of 3D array data in memory which represents 3D Image. First, it creates a 3D array in memory, like this:</p>
  
  <pre><code>unsigned short data[dim][dim][dim];
  
  for (int i=0;i&lt;dim;i++)
  
  for (int j=0;j&lt;dim;j++)
  
  for (int k=0;k&lt;dim;k++)
  
     data[i][j][k]=1000;
  </code></pre>
  
  <p>and then transfer this array's pointer to vtkImageData which can process the 3D array data later, like this:</p>
  
  <pre><code>vtkUnsignedShortArray *array=vtkUnsignedShortArray::New();
  
  array-&gt;SetVoidArray(data,dim*dim*dim,1);
  
  
  vtkImageData *imageData=vtkImageData::New();
  
  imageData-&gt;GetPointData()-&gt;SetScalars(array);
  </code></pre>
  
  <p>according to this procedure, I write a similar code using java, like this:
  <a href="https://i.stack.imgur.com/QXSSE.png" rel="nofollow noreferrer">enter image description here</a></p>
  
  <p>but I can't find a suitable way to transfer my 3D image data array(<code>imageArr</Code> which read pixel data from a specified tiff file).</p>
  
  <p>Here my problem, how can I reconstruct 3D iamge data array to 3D image using java based on vtk.</p>
  
  <p>I am Chinese student and not good at using English, I will be very exited for your reply.</p>