sci-visus/OpenVisus

visus compress-dataset seems to not work

hoang-dt opened this issue · 6 comments

The compress-dataset command seems broken. When tried on a dataset, the data is either not compressed, or is different from data compressed using the "import export" commands. As a work around, I'm attaching a Python script that will do the compression using "import export" commands.

idx-compress.zip

I think I fixed it.

fc067c3

Sorry Giorgio I didn't get a chance to produce a reproducible test yet. Will get around doing that today. I see that you changed

String compression = query->field.default_compression;

to

String compression = block_header.getCompression();

The problem with the second line is that, if the compression has parameters, during decompression I don't get the parameters passed to the Decoder, only the name of the compression itself (e.g. zip, zfp etc). I need to get zfp-16 not just zfp to be able to decode correctly. What is the problem with the first approach?

Note: the python script appends the new "default_compression" to the ones existing, so if you have a dataset already compressed with zip the new compression will be appended. Visus probably reads the first entry of default_compression and decide to compress with that one.
In the attached script I am using a regular expression to remove any existing "default_compression" from the idx before doing the export.
Another issue in the script is that it requires the output to be in a different folder, but that should be another easy fix to be done, if necessary.

compress.py.zip

Hi @scrgiorgio . So for now I think we can leave things the way they have been (compression info read from block header instead of from .idx). For zfp I can decompress without the parameter (number of bit planes encoded), so it's fine. In the future though, maybe we have to think more on how to store compression parameters. I made a change here to make this work with zfp, please consider merging it #88

@spetruzza With this PR the decompression for zfp should work fine with latest visus commits.