Skip to content

sunjianxin/example_MFA-DVR

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

example_MFA-DVR

This repo provides examples of using MFA-DVR pipeline to visualize volumetric data, including encoding raw data to MFA model and visualizing them using MFA-DVR.

Dependencies

  • C++11 or higher compiler.
  • mfa, Multivariate Functional Approximations (MFA) library.
  • VTK_MFA-DVR, MFA-DVR libraries implemented on top of The Visualization Toolkit (VTK).
  • MPI

Build

  1. Create project folder
mkdir myProject
cd myProject
  1. Get mfa library, no need to build or install it.
git clone https://github.com/sunjianxin/mfa
  1. Install VTK_DVR-MFA based on VTK of verion 9.0.3.
  2. Get and build example code
git clone https://github.com/sunjianxin/example_MFA-DVR
cd example_MFA-DVR
mkdir build
cd build
cmake ..  \
-DCMAKE_CXX_COMPILER=mpicxx \
-DMFA_INCLUDE_DIR=path_to_mfa_include_folder \
-DVTK_DIR:PATH=path_to_VTK_DVR-MFA_installation_folder

path_to_mfa_include_folder is the folder location in the project folder in step 2. path_to_VTK_DVR-MFA_installation_folder is the installation location when you configure VTK_DVR-MFA before building, and it is normally at /usr/local/include/vtk-9.0 by default.

MFA Modeling

Encoding raw volumetric data into MFA model. fixed is the program encoding raw volumetric data into MFA model.

  • Synthetic data
cd data
../build/src/fixed/fixed -m 3 -d 4 -f gaussianBeam_8x8x8.xyz -i general -n 8 -v 8 -q 4
mv approx.out gaussianBeam.mfa

Above operation encodes raw volumetric data, .xyz, into mfa model named approx.out using number of control points of 8 and polynomial degree of 4. Detail options of encoding can be checked using -h flag.

  • Real data
cd data
../build/src/fixed/fixed -m 3 -d 4 -f vertebra_128x128x128.xyz -i general -n 128 -v 128 -q 4
mv approx.out vertebra.mfa

For real data with a large size, a compressed MFA model can be encoded by using a smaller number of control points that is less or equal to the data sample size of each dimension, in another word, using an argument value smaller than 128 for -v option for the vertebra dataset. The current MFA encoding library generates the approx.out file including MFA model and metadata, so its size might not be smaller than the raw data. The compression ratio together with other information can be found in the output of the program. Only MFA model will be generated in the upcoming version of mfa library in the future.

MFA Rendering

Visualize data using MFA-DVR. simple_ray_cast_switch is the program generating volume rendering results using MFA-DVR or default NNS or trilinear interpolation methods provided by VTK. Shading can be turn on or off through SHADEON macro.

  • Synthetic data
cd build/src/simple_ray_cast_switch
./simple_ray_cast_switch -v ../../../data/gaussianBeam_8x8x8.vtk -m ../../../data/gaussianBeam.mfa -n gaussianbeam -d 8 -e mfa

results

  • Real data
cd build/src/simple_ray_cast_switch
./simple_ray_cast_switch -v ../../../data/vertebra_128x128x128.vtk -m ../../../data/vertebra.mfa -n vertebra -d 128 -e mfa

Above operation generate the volume rendering image using MFA-DVR. The .vtk file is the VTK data file in structured points format used for comparison. Detail options of volume rendering can be checked using -h flag. results

About

Volume visualization application using MFA-DVR implemented on top of VTK.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published