Coder Social home page Coder Social logo

pdrgrc / tthresh Goto Github PK

View Code? Open in Web Editor NEW

This project forked from rballester/tthresh

0.0 0.0 0.0 18.68 MB

C++ compressor for multidimensional grid data using the Tucker decomposition

License: GNU Lesser General Public License v3.0

CMake 0.92% C++ 99.08%

tthresh's Introduction

tthresh

Multidimensional Compression Using the Tucker Tensor Decomposition

This is an open-source C++ implementation written by Rafael Ballester-Ripoll ([email protected]) of the compressor developed in TTHRESH: Tensor Compression for Multidimensional Visual Data (R. Ballester-Ripoll, P. Lindstrom and R. Pajarola). It is intended for Cartesian grid data of 3 or more dimensions, and leverages the higher-order singular value decomposition (HOSVD), a generalization of the SVD to 3 and more dimensions.

If you use TTHRESH for a scientific publication, please cite one or both of these papers:

  • TTHRESH: Tensor Compression for Multidimensional Visual Data: @article{BLP:18, author = {{Ballester-Ripoll}, R. and {Lindstrom}, P. and {Pajarola}, R.}, title = "{{TTHRESH}: Tensor Compression for Multidimensional Visual Data}", journal = {ArXiv e-prints}, archivePrefix = "arXiv", eprint = {1806.05952}, primaryClass = "cs.GR", keywords = {Computer Science - Graphics}, year = 2018, month = jun, url = {https://arxiv.org/abs/1806.05952}}
  • Lossy Volume Compression Using Tucker Truncation and Thresholding: @article{BP:15, year={2015}, issn={0178-2789}, journal={The Visual Computer}, title={Lossy volume compression using {T}ucker truncation and thresholding}, publisher={Springer Berlin Heidelberg}, keywords={Tensor approximation; Data compression; Higher-order decompositions; Tensor rank reduction; Multidimensional data encoding}, author={Ballester-Ripoll, Rafael and Pajarola, Renato}, pages={1-14}}

For more information on the Tucker transform and tensor-based volume compression, check out our slides.

Visual Example (click to enlarge)

"Isotropic fine" turbulence timestep (512x512x512, 32-bit float) from the Johns Hopkins Turbulence Database:

Download

git clone https://github.com/rballester/tthresh.git

(or as a zip file).

Compilation

Use CMake to generate an executable tthresh:

mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Release ..
make

Usage

Compression:

tthresh -i <dataset> <options> -c <compressed dataset>

Decompression:

tthresh -c <compressed dataset> -o <decompressed dataset>

Compression + decompression (this will print both the compression rate and the achieved accuracy):

tthresh -i dataset <options> -c <compressed dataset> -o <decompressed dataset>

The target accuracy can be specified either as relative error (-e), RMSE (-r) or PSNR (-p).

Toy example:

A toy data set (a 3D sphere) is included in the data/ folder. You can test the compressor with it as follows:

tthresh -i data/3D_sphere_64_uchar.raw -t uchar -s 64 64 64 -p 30 -c data/comp.raw -o data/decomp.raw

Extra Features

  • Use -a to reconstruct only the data set's bounding box.
  • Use -k when compressing a file to skip its k leading bytes.
  • Use NumPy-like notation immediately after -o to decimate the data while decompression. For example, -o :: :: 0 will reconstruct only the first z-slice of a volume, -o ::2 ::2 ::2 will decompress only every other voxel along all dimensions, and -o ll4 ll4 ll4 will perform Lanczos downsampling by a factor of 4. Some result examples for x2 decimation:

To get more info on the available options, run tthresh -h.

Acknowledgments

This work was partially supported by the UZH Forschungskredit "Candoc", grant number FK-16-012. I also thank Enrique G. Paredes for his help with CMake compilation issues.

Why Tucker?

Tensor-based compression is non-local, in the sense that all compressed coefficients contribute to the reconstruction of each individual voxel (in contrast to e.g. wavelet transforms or JPEG for images, which uses a localized DCT transform). This can be computationally demanding but decorrelates the data at all spatial scales, which has several advantages:

  • Very competitive compression quality
  • Fine bit-rate granularity
  • Smooth degradation at high compression (in particular, no blocking artifacts or temporal glitches)
  • Ability to downsample in the compressed domain

tthresh's People

Contributors

rballester avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.