Code Monkey home page Code Monkey logo

idx2's Introduction

What is idx2?

idx2 is a compressed file format for scientific data represented as 2D or 3D regular grids of data samples. From a single idx2 dataset, you can retrieve data at different resolution and tolerance levels that best suit your needs at hand.

Compilation

idx2 can be built using CMake. The dependencies are:

  • CMake (>= 3.8)
  • A C++ compiler supporting C++17
  • (Optional) nanobind (do git submodule update --recursive --init to pull it from GitHub)
  • (Optional) Python 3

The optional dependencies are only needed if BUILD_IDX2PY is set to ON in CMake.

Using the idx2App command line tool to encode raw to idx2

idx2App --encode Miranda-Viscosity-[384-384-256]-Float64.raw

For convenience, the dimensions of the input are automatically parsed if the input file is named in the Name-Field-[DimX-DimY-DimZ]-Type.raw format.

Note that Type can only be either Float32 or Float64 (currently idx2 only supports floating-point scalar fields). If the input raw file name is not in this form, please additionally provide --name, --field, --dims, and --type.

Using the idx2App command line tool to decode idx2 to raw

idx2App --decode Miranda/Viscosity.idx2 --downsampling 1 1 1 --tolerance 0.001

--downsampling specifies the desired downsampling passes along each axis (each pass halves the number of samples along an axis), and --tolerance to specify the desired absolute error tolerance.

Optionally, use --first x_begin y_begin z_begin and --last x_end y_end z_end (the end points are inclusive) to specify the region of interest instead of decoding the whole field.

Using the C++ API to read from an idx2 dataset to memory

See the Source/Applications/idx2Samples.cpp file for an example of how to use idx2's C++ API.

(Most convenient option) Using the header-only library idx2.hpp

Just include a single header file for convenience. The idx2.hpp header file can be included anywhere, but you need to #define idx2_Implementation in exactly one of your cpp files before including it.

#define idx2_Implementation
#include <idx2.hpp>

Using the compiled idx2 library

Alternatively, with CMake, you can build an idx2 library and link it against your project. Then, just #include <idx2.h> to use it.

References

Efficient and flexible hierarchical data layouts for a unified encoding of scalar field precision and resolution D. Hoang, B. Summa, H. Bhatia, P. Lindstrom, P. Klacansky, W. Usher, P-T. Bremer, and V. Pascucci. 2021 - IEEE Transactions on Visualization and Computer Graphics

For the paper preprint and presentation slides, see http://www.sci.utah.edu/~duong

idx2's People

Contributors

hoang-dt avatar scrgiorgio avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

idx2's Issues

[OpenViSUS and idx2 integration] idx2 chunks being too small for cloud

I have added an option to group multiple bit planes into a chunk (default is 4). To change it, provide, say --bit_planes_per_chunk 8, when encoding. With this change, the chunks are about 150KB on average.

The chunk size can also be changed with two options when encoding:

  • --bricks_per_chunk (default is 512). For example, --bricks_per_chunk 4096 should create chunks of size 1 MB ish.
  • --brick_size (default is 32 32 32). For example, --brick_size 64 64 64 should also create chunks of size 1 MB ish.

The first option (increasing the bricks-per-chunk) will result in more metadata to be stored, but is better in that the bricks are kept small so fewer samples need to be decoded when we ask for a small region of interest (e.g., a slice).

TODO

  • Can we plot the impact of the chunk size on data retrieval time?
  • Can we allow fetching parts of an object? (so that each chunk does not have to be stored as a file)

idx2 and OpenViSUS integration

Current status:

idx2 dataset can be uploaded and retrieved from object storage.

Limitations

@scrgiorgio: can you upload your powerpoint slides with the TODO list?

  • Small chunk size (see #8)

TODO

@scrgiorgio: can you add instructions for the following?

  • How to generate an idx2 dataset that can be uploaded to the cloud
  • How to upload such a dataset to the cloud?
  • How to retrieve such a dataset from visusviewer/OpenViSUS python?

[ERROR] make install

Hi,

I'm getting some error when installing the idx2. Please check it.

zhangbo@zhangbo-PC:~/Codes/idx2/build$ make install
Consolidate compiler generated dependencies of target faster
[ 10%] Built target faster
Consolidate compiler generated dependencies of target idx2Core
[ 79%] Built target idx2Core
Consolidate compiler generated dependencies of target idx2
[ 83%] Built target idx2
Consolidate compiler generated dependencies of target idx2App
[ 87%] Built target idx2App
Consolidate compiler generated dependencies of target idx2App_v2
[ 91%] Built target idx2App_v2
Consolidate compiler generated dependencies of target idx2Samples
[ 95%] Built target idx2Samples
Consolidate compiler generated dependencies of target idx2CompareVolumes
[100%] Built target idx2CompareVolumes
Install the project...
-- Install configuration: ""
-- Installing: /home/zhangbo/Codes/idx2/install/lib/libidx2.a
CMake Error at Source/cmake_install.cmake:50 (file):
  file INSTALL cannot find "/home/zhangbo/Codes/idx2/Source/idx2.h
  idx2_v2.h": No such file or directory.
Call Stack (most recent call first):
  cmake_install.cmake:47 (include)

make install fails to install idx2Config.cmake

It looks like either idx2Config.cmake is missing from the repo, or the cmake configuration to generate it is missing. I get:

CMake Error at Source/cmake_install.cmake:73 (file):
  file INSTALL cannot find "/home/pdavis/idx2/Source/idx2Config.cmake": No
  such file or directory.
Call Stack (most recent call first):
  cmake_install.cmake:47 (include)

and indeed that file does not exist.

Some issues on linux/gcc 10.3

  1. Receiving an error:
 oid idx2::Print(idx2::printer*, const idx2::array<t>&)’:
/home/pdavis/idx2/Source/Core/Format.h:33:3: error: there are no arguments to ‘idx2_Print’ that depend on a template parameter, so a declaration of ‘idx2_Print’ must be available

Which can be reduced to a warning with '-fpermissive`.

 #if defined(__clang__)

Has a trailing tick (`) at a couple different places, which gcc doesn't like.

  1. The following define in FileSystem.cpp (line 27) causes gcc some parsing confusion:
#define stat struct stat

in combination with the define on line 27, it causes line 220 to expand to a syntax error. I'm not sure what the portable solution is, but for linux I could just remove the line 27 define and change line 219 to struct stat S.

  1. Pthread isn't being linked for linux machines.

  2. GCC scope struct stat from the idx2 namespace on line 10786 of idx2.hpp, and I can't figure out how to make it not do so. I finally resorted to renaming idx2::stat to idx2::idx_stat, which is somewhat ugly and requires changing about a dozen variable types just after line 40609.

  3. Source/Core/String.cpp has to explicitly include cerrno in gcc

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.