[vtkusers] Getting image data quickly into Java objects

Jarek Sacha galicjan at yahoo.com
Thu Jun 5 22:44:20 EDT 2003


Greg Scott wrote:

> I've seen in the past people have asked a similar question, yet I've 
> found no answers.
>  
> I would like to move the RGB data from a vtkImageData instance into 
> Java, i.e. into a byte[] array. As I understand it, the usual 
> GetScalarPointer methods are not available in the Java wrapping of VTK.
>  
> Can anyone suggest a fast way to do this, other than looping through 
> the entire image data doing GetPoint... on each one, which returns, 
> say a float.
>  
> Any suggestions would be much appreciated.
> Thanks
> Greg
>  

There is a code that does something similar at 
http://ij-plugins.sourceforge.net/3d-toolkit (look for "VTK Filters")
Pure Java solution :) It is done there through temporary files. It is 
actually quite fast. StructuredPoints are written on VTK side in 
standard VTK format then loaded on Java side; the same thing in other 
direction. However, only single value pixels (gray scale) are supported 
in current version.




More information about the vtkusers mailing list