<P>hello,</P>
<P>I would like to create a vtkImageData&nbsp; from an image&nbsp;data stacks. In the stack i have method to extract all pixels of a slice.</P>
<P>I did it with a vtkUnsignedCharArray.InsertNextValue((char)pixels[j]), but it is very slow ...., because i insert all the pixels values one by one in the array...</P>
<P>&nbsp;byte[] pixels = (byte[])stack.getPixels(i); // retrieve all pixels of the slice (image values)<BR>&nbsp;vtkUnsignedCharArray array=new vtkUnsignedCharArray();<BR>&nbsp;for (int j=0;j&lt;width*height;j++)&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;array.InsertNextValue((char)pixels[j]);</P>
<P>// build the ImageData from the vtkUnsignedCharArray <BR>&nbsp; vtkImageData id=new vtkImageData();<BR>&nbsp; id.GetPointData().SetScalars(array);</P>
<P>I think, it is possible to insert all the pixels of one&nbsp;slice in one time in the vtkUnsignedCharArray, but i don't know how to do this with java/vtk.</P>
<P>&nbsp;</P>
<P>thanks for help</P>
<P>arnaud</P>
<P><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</P>
<P>&nbsp;</P><p><br><hr size=1><a href="http://fr.mail.yahoo.com">Yahoo! Mail</a> -- Une adresse @yahoo.fr gratuite et en français !<br>