[Paraview] Re: Request for reader format (x,y,x)

Andrew Maclean andrew.amaclean at gmail.com
Wed Jan 23 21:09:13 EST 2008


In view of this being such a common request, I have entered it into the
Mantis Bug Tracker as a feature request that vtkparticleReader be
incorporated into the current list of default readers. Hopefully this can be
easily done.


Andrew




On Jan 24, 2008 4:21 AM, Jed Frechette <jedfrechette at gmail.com> wrote:

>
> On Tue, 22 Jan 2008 16:03:00 -0600, Jim Dow wrote:
> > I am looking for a Paraview reader that will read a LIDAR point
> > cloud in
> > (x,y,z) coordinates as a space or comma separated .txt file.
> >
> > Does anyone know of such a reader?
>
>
> I use the standalone Python script given below to convert unsorted xyz
> point clouds to VTK data files, then load those in Paraview. I haven't
> bothered trying to implement this directly in Paraview but I can't
> imagine it would be to difficult.
>
> Best,
>
> --
> Jed Frechette
>
> University of New Mexico Lidar Lab
> www.unm.edu/~lidar
>
>
> #!/usr/bin/env python
> """Convert a csv file containing particles to a VTK XML PolyData file.
>
> The format of the comma separated file is: x, y, z, scalar. Additional
> columns will be ignored as will missing scalars.
>
> The results are saved to an output file with the same base name as the
> input
> file and the extension vtp."""
>
> __author__ = "Jed Frechette <jdfrech at unm.edu>"
> __date__ = "27 September 2007"
> __version__ = "0.1"
> __license__ = "BSD <http://opensource.org/licenses/bsd-license.php>"
>
> from glob import glob
> from optparse import OptionParser
> from os import name, path
> from vtk import vtkParticleReader, vtkXMLPolyDataWriter
>
> def get_filenames():
>     """Return a list of filenames to process."""
>     parser = OptionParser(usage='%prog INPUT_FILES',
>                           description=' '.join(__doc__.split()),
>                           version=__version__)
>     (opts, args) = parser.parse_args()
>     if name == 'nt':
>         args = glob(args[0])
>     return args
>
> if __name__ == '__main__':
>     for in_filename in get_filenames:
>         out_filename = '.'.join([path.splitext(path.split(in_filename)
> [-1])[0],
>                                 'vtp'])
>         reader = vtkParticleReader()
>         reader.SetFileName(in_filename)
>
>         writer = vtkXMLPolyDataWriter()
>         writer.SetFileName(out_filename)
>         writer.SetInputConnection(reader.GetOutputPort())
>         writer.Write()
>         print "Saved file: %s" % out_filename
>  _______________________________________________
> ParaView mailing list
> ParaView at paraview.org
> http://www.paraview.org/mailman/listinfo/paraview
>



-- 
___________________________________________
Andrew J. P. Maclean
Centre for Autonomous Systems
The Rose Street Building J04
The University of Sydney  2006  NSW
AUSTRALIA
Ph: +61 2 9351 3283
Fax: +61 2 9351 7474
URL: http://www.acfr.usyd.edu.au/
___________________________________________
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://public.kitware.com/pipermail/paraview/attachments/20080124/7dc87041/attachment-0001.html


More information about the ParaView mailing list