Skip to content

CLI: Multi‐resolution Decoding

Samuel Li edited this page Dec 14, 2023 · 1 revision

SPERR supports "Multi-resolution Decoding," meaning that a hierarchy of the data with coarsened resolutions can be obtained in a decoding pass. Representations with lower resolutions of the slice/volume can be used to perform quick visualizations/examinations. To obtain lower resolutions of the decoded data, one just needs to specify the output filename using options --decomp_lowres_f or --decomp_lowres_d in utilities sperr3d and sperr2d. There's negligible performance penalty to multi-resolution decoding compared to regular (full-resolution) decoding, mostly concerning additional memory operations.

Example

In this example, we use one of the example data fields wmag91.float in this repository. First we compress and obtain a compressed bitstream: wmag.stream.

./bin/sperr3d -c --dims 91 91 91 --ftype 32 --bitstream wmag.stream --bpp 5.0 ./wmag91.float

We then decompress the encoded bitstream. Note that the option --decomp_f specifies that we want the reconstruction in full resolution, and the option --decomp_lowres_f specifies that we want the data in lower resolutions too.

./bin/sperr3d -d --decomp_f wmag.decomp --decomp_lowres_f wmag.lowres ./wmag.stream

At this point, we obtain the decompressed volume in the full resolution as well as in lower resolutions:

  1. wmag.decomp: the full-resolution version, and four low-res versions:
  2. wmag.lowres.46x46x46
  3. wmag.lowres.23x23x23
  4. wmag.lowres.12x12x12
  5. wmag.lowres.6x6x6.

Considerations In 3D

In 3D cases, there are a few considerations to make sure that multi-resolution is available during decoding. Specifically, one needs to pick chunk dimensions carefully so that:

  1. The full volume dimension is perfectly divisible by the chunk dimension.
  2. The chunk dimension is approximately equal in X, Y, and Z directions.

In practice, one can always use the --decomp_lowres_f (or --decomp_lowres_d) option in sperr3d to see if lower-resolutions are produced.