[vtkusers] vtkZLibCompressor problem
Dominik Szczerba
domi at vision.ee.ethz.ch
Thu Dec 15 07:00:11 EST 2005
Hello,
I have been failing to get the vtkZLibCompressor working in VTK 4.4.
Unfortunately, I couldnt google out any examples for C++. Here is my code:
//convert legacy format to XML
vtkStructuredGridReader* reader = vtkStructuredGridReader::New();
reader->SetFileName(argv[1]);
vtkStructuredGrid* grid = reader->GetOutput();
grid->Update();
vtkZLibDataCompressor* myZlibCompressor = vtkZLibDataCompressor::New();
myZlibCompressor->SetCompressionLevel(9);
vtkXMLStructuredGridWriter* writer = vtkXMLStructuredGridWriter::New();
writer->SetInput(grid);
writer->SetFileName(argv[2]);
//writer->SetDataModeToBinary();
writer->SetCompressor(myZlibCompressor);
writer->Write();
Now I see absolutely no compressing effect on my output file. On
contrary, gzip file.vtk reduces the file size dramatically. What am I
doing wrong?
regards,
Dominik
--
Dominik Szczerba, Dr.
ETZ C110 CO-ME/BIWI CH-8092 Zurich
http://www.vision.ee.ethz.ch/~domi
More information about the vtkusers
mailing list