[vtkusers] How to read 3D data

David Doria daviddoria+vtk at gmail.com
Thu Jul 2 07:45:57 EDT 2009


On Thu, Jul 2, 2009 at 7:33 AM, hammett <notlee at gmail.com> wrote:

>
> I have a file which contains the x, y and z co-ordinates which I wish to
> generate voxels from using vtkImageData. How can I read this data in to
> VTK?
> It looks like this:
>
> 1 28 16
> 1 29 15
> 1 29 16
> 1 30 15
> 1 30 16
> 1 31 14
> 1 31 15
> 1 31 16
> 1 32 14
> 1 32 15
> 1 32 16
> 1 33 14
> 1 33 15
> 1 34 14
>
> etc. Thanks in advance for any help.
> --
>

You can use most of this example:
http://www.vtk.org/Wiki/Write_a_file_of_triangle_corners

just replace the first few lines there that are generating data to some code
that reads your file. Let me know if this was not what you were looking to
do.

Thanks,

David
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20090702/b3013910/attachment.htm>


More information about the vtkusers mailing list