[vtkusers] How to visualise 3d array of data

Jeff Baumes jeff.baumes at kitware.com
Fri Jun 26 16:17:22 EDT 2009


Take a look at the documentation for vtkImageData for how to set the 3D
extents and fill the scalar data with a 0/1 array. You will have to put your
values in a vtkIntArray one by one since there is no way to pass a java
array pointer directly to an array. It would be more efficient to load your
data directly from disk using a VTK reader so you don't have to do lots of
looping with Java-wrapped VTK.
Then look at vtkThresholdFilter for how to threshold this, then you can send
that through vtkGeometryFilter, then vtkPolyDataMapper/vtkActor and into a
vtkRenderWindow. You could also I suppose use volume rendering on the whole
dataset using an appropriate transfer function, but I'm not an expert in
that.

Jeff

On Thu, Jun 25, 2009 at 10:35 AM, hammett <notlee at gmail.com> wrote:

>
> Hi. I have a three-dimensional array, the values of which are either 0 or
> 1.
> How can I create a 3D visualisation which shows just the elements in the
> array which are set to 1 in Java? What I'm trying to do is create voxels
> from the 3D array. I have looked through the mailing list archive and on
> the
> Internet and VTK is quite a lot of information to take in so I haven't
> managed to work out how to do this.
>
> Thanks for any help.
> --
> View this message in context:
> http://www.nabble.com/How-to-visualise-3d-array-of-data-tp24204434p24204434.html
> Sent from the VTK - Users mailing list archive at Nabble.com.
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20090626/d638e7ea/attachment.htm>


More information about the vtkusers mailing list