[vtkusers] File compression using vtkZlibCompressor

Henry J. Karpf hjkarpf at sandia.gov
Wed Jun 9 13:32:45 EDT 2004


Hello,
Thank you for the response.  What i am doing is converting polygon data 
from another program to the vtkXMLUnstructuredGrid format, and not even 
using vtk to generate the file.  Right now it is huge as all the point 
values and cell information is stored in ascii, which is a waste, and i 
was wonderign if there was any quick c++ program to convert from an 
uncompressed file to a compressed one, and automatically recalculate the 
offsets for the cells into the points array?
Any information is welcome.

Mathieu Malaterre wrote:

> Henry,
>
>     Did you try the vtkXML*Writer family ? They use compression by 
> default.
>
>     Typical use is:
>
> package require vtk
> package require vtkinteraction
> package require vtktesting
>
> vtkVolume16Reader v16
>   v16 SetDataDimensions 64 64
>   [v16 GetOutput] SetOrigin 0.0 0.0 0.0
>   v16 SetDataByteOrderToLittleEndian
>   v16 SetFilePrefix "$VTK_DATA_ROOT/Data/headsq/quarter"
>   v16 SetImageRange 1 93
>   v16 SetDataSpacing 3.2 3.2 1.5
>   v16 Update
>
>
> vtkXMLImageDataWriter writer
>   writer SetInput [v16 GetOutput]
>   writer SetFileName compress.vtk
>   writer Write
>
>
> HTH
> Mathieu
>
> Henry J. Karpf wrote:
>
>> I have files that are fairly large and it takes a while to read them. 
>> When i resave them using compression they open much quiker.  Is there 
>> a way that i can avoid this process of writing my files, opening them 
>> adn then resaving them.  Like how do i write out automatically to a 
>> compressed file?  Any examples would be great.  Also when compressed 
>> how do you calculate the offsets in the appended data? Thanks.
>>
>>
>> _______________________________________________
>> This is the private VTK discussion list. Please keep messages 
>> on-topic. Check the FAQ at: <http://public.kitware.com/cgi-bin/vtkfaq>
>> Follow this link to subscribe/unsubscribe:
>> http://www.vtk.org/mailman/listinfo/vtkusers
>>
>
>
>






More information about the vtkusers mailing list