[Insight-users] itkPointSetFileWriter?

Luis Ibanez luis.ibanez at kitware.com
Sat Jul 4 16:41:18 EDT 2009



Hi David,


1) They are "legacy" readers in VTK.
    They are now replaced (in VTK) with
    an XML-based file format that supports
    compression of binary data.

    That said, the legacy reader in VTK
    is still available:

           vtkPolyDataReader
           vtkPolyDataWriter


2) Good point, we should have Examples,
    for all the classes we put into review.

    Tests are not always good examples...



3) The VTP file format is indeed the
    XML-based compressed file format
    mentioned in (1).
    (that is, VTP is not the legacy format).

    You will have to convert your VTP file
    into a VTK file in order to pass it
    as input to the ITK reader.

    From your VTK code, use the vtkPolyDataWriter
    and save your mesh in a file with extension
    ".vtk". That file should be readable with
    the ITK poly data reader.



   Regards,


      Luis


---------------------
David Doria wrote:
> On Sat, Jul 4, 2009 at 3:01 PM, Luis Ibanez <luis.ibanez at kitware.com 
> <mailto:luis.ibanez at kitware.com>> wrote:
> 
> 
>     Hi David,
> 
> 
>     You may want to take a look at
> 
>     Insight/Code/Review
>        itkVTKPolyDataReader.h
>        itkVTKPolyDataReader.txx
>        itkVTKPolyDataWriter.h
>        itkVTKPolyDataWriter.txx
> 
> 
>     They will Write and Read VTK legacy files.
> 
>     They have been used mostly with itk::Mesh
>     but they should work fine with itk::PointSet.
> 
> 
>     Please let us know if you find any problem,
> 
> 
>        Thanks
> 
> 
>           Luis
> 
> 
> Three things:
> 
> 1) If these are legacy readers, what replaced them?
> 
> 2) I found a good example in Insight/Testing/Code/Review, but I found 
> this directory empty: Insight/Examples/Review - maybe the test should 
> also be copied to the example directory? Or at least a text file with a 
> pointer to the Testing directory?
> 
> 3) I tried the example (itkVTKPolyDataReaderTest.cxx) with a simple vtp 
> file (attached, 3 points) and I get this error:
> 
> terminate called after throwing an instance of 'std::out_of_range'
>   what():  basic_string::basic_string
> Aborted
> 
> It was made with vtkXMLPolyDataWriter, is that the problem?
> 
> I've been doing all of my work using VTK and then making a vtp file and 
> viewing the results in Paraview. However, it seems like ITK has much 
> more functionality for what I'm doing (point cloud/ mesh manipulation) 
> so I'm trying to convert my code. That is why I am wondering what the 
> "recommended" file type is for this kind of data.
> 
> Thanks for the help so far!
> 
> David
> 
> 
> ------------------------------------------------------------------------
> 
> _____________________________________
> 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 ITK FAQ at: http://www.itk.org/Wiki/ITK_FAQ
> 
> Follow this link to subscribe/unsubscribe:
> http://www.itk.org/mailman/listinfo/insight-users


More information about the Insight-users mailing list