Sorry, it's vtkThreshold. As for the input format, I don't know what the simplest format is for reading in 3D image data. Perhaps someone else on the list knows.<div><br></div><div>Jeff<br><br><div class="gmail_quote">
On Sun, Jun 28, 2009 at 12:14 PM, hammett <span dir="ltr"><<a href="mailto:notlee@gmail.com">notlee@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<br>
Thanks for the starting point. It would make more sense to load from a file<br>
from my point of view too. What format should the file be in? Can I simply<br>
have a list of the x,y and z points I wish to generate voxels from? Like<br>
this:<br>
<br>
1 5 6<br>
1 6 6<br>
1 7 6<br>
etc..<br>
<br>
Also, I couldn't see the vtkThresholdFilter class is the class list.<br>
<br>
Thanks so far!<br>
<div><div></div><div class="h5"><br>
Jeff Baumes wrote:<br>
><br>
> Take a look at the documentation for vtkImageData for how to set the 3D<br>
> extents and fill the scalar data with a 0/1 array. You will have to put<br>
> your<br>
> values in a vtkIntArray one by one since there is no way to pass a java<br>
> array pointer directly to an array. It would be more efficient to load<br>
> your<br>
> data directly from disk using a VTK reader so you don't have to do lots of<br>
> looping with Java-wrapped VTK.<br>
> Then look at vtkThresholdFilter for how to threshold this, then you can<br>
> send<br>
> that through vtkGeometryFilter, then vtkPolyDataMapper/vtkActor and into a<br>
> vtkRenderWindow. You could also I suppose use volume rendering on the<br>
> whole<br>
> dataset using an appropriate transfer function, but I'm not an expert in<br>
> that.<br>
><br>
> Jeff<br>
><br>
> On Thu, Jun 25, 2009 at 10:35 AM, hammett <<a href="mailto:notlee@gmail.com">notlee@gmail.com</a>> wrote:<br>
><br>
>><br>
>> Hi. I have a three-dimensional array, the values of which are either 0 or<br>
>> 1.<br>
>> How can I create a 3D visualisation which shows just the elements in the<br>
>> array which are set to 1 in Java? What I'm trying to do is create voxels<br>
>> from the 3D array. I have looked through the mailing list archive and on<br>
>> the<br>
>> Internet and VTK is quite a lot of information to take in so I haven't<br>
>> managed to work out how to do this.<br>
>><br>
>> Thanks for any help.<br>
>> --<br>
>> View this message in context:<br>
>> <a href="http://www.nabble.com/How-to-visualise-3d-array-of-data-tp24204434p24204434.html" target="_blank">http://www.nabble.com/How-to-visualise-3d-array-of-data-tp24204434p24204434.html</a><br>
>> Sent from the VTK - Users mailing list archive at Nabble.com.<br>
>><br>
>> _______________________________________________<br>
>> Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
>><br>
>> Visit other Kitware open-source projects at<br>
>> <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
>><br>
>> Please keep messages on-topic and check the VTK FAQ at:<br>
>> <a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
>><br>
>> Follow this link to subscribe/unsubscribe:<br>
>> <a href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers</a><br>
>><br>
><br>
> _______________________________________________<br>
> Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
><br>
> Visit other Kitware open-source projects at<br>
> <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
><br>
> Please keep messages on-topic and check the VTK FAQ at:<br>
> <a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
><br>
> Follow this link to subscribe/unsubscribe:<br>
> <a href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers</a><br>
><br>
><br>
<br>
</div></div><font color="#888888">--<br>
View this message in context: <a href="http://www.nabble.com/How-to-visualise-3d-array-of-data-tp24204434p24242865.html" target="_blank">http://www.nabble.com/How-to-visualise-3d-array-of-data-tp24204434p24242865.html</a><br>
</font><div><div></div><div class="h5">Sent from the VTK - Users mailing list archive at Nabble.com.<br>
<br>
_______________________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the VTK FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers</a><br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>Jeff Baumes, Ph.D.<br>R&D Engineer, Kitware Inc.<br>(518) 881-4932<br><a href="mailto:jeff.baumes@kitware.com">jeff.baumes@kitware.com</a><br>
</div>