#
# OpenGL Volumizer 1.1 demos
#

setenv DATAPATH /usr/share/Volumizer/data/volumes/Phantom/

# pick a small or medium size volume
# setenv DATAFILE ${DATAPATH}/tiff/CT.Head.Bone.char.tif
setenv DATAFILE ${DATAPATH}/tiff/CT.Head.Small.char.tif

# get informatiojn on the file size/format
imginfo ${DATAFILE}

# voglSimple is a limited functionality volume viewer
# use left mouse button to rotate
voglSimple ${DATAFILE}

# voglBasic adds lookup table manipulation and command line parsing
# use middle mouse button to adjust the lookup table

voglBasic ${DATAFILE} -sc 1 1 3.2
voglBasic ${DATAFILE} -sc 1 1 3.2 -2D
voglBasic ${DATAFILE} -sc 1 1 3.2 -color
voglBasic ${DATAFILE} -sc 1 1 3.2 -color -lutFile ${DATAPATH}/tables/CT1.table 

# enable transient geometry caching
voglCache ${DATAFILE} -sc 1 1 3.2
# adjust the cache threshold
voglCache ${DATAFILE} -sc 1 1 3.2 -cache 0.9
# adjust the sampling rate
voglCache ${DATAFILE} -sc 1 1 3.2 -samplingRate 0.5
# uses more memory but can be faster
voglCache ${DATAFILE} -sc 1 1 3.2 -2D
# fill effort is expensive to compute 
voglCache ${DATAFILE} -sc 1 1 3.2 -fill


# per-vertex colors
voglPerVertexColors ${DATAFILE} -sc 1 1 3.2

# Multi-planar reformatting demos
voglMPR1 ${DATAPATH}/tiff/CT.Head.char.tif -sc 1 1 3.2
voglMPR2 ${DATAPATH}/tiff/CT.Head.char.tif -sc 1 1 3.2

# space leaping demos
# drag right to re-window and adjust the tesselation
voglSpaceLeap ${DATAFILE}  -sc 1 1 3.2 -tess  12 40 255
voglSpaceLeap ${DATAFILE}  -sc 1 1 3.2 -tess  16 40 255 -2D

# volume morphing demo
voglMorph ${DATAFILE}  -sc 1 1 3.2

# voxel picking demo
# click right mouse button to select a line of sight through the cursor
voglPick ${DATAFILE}  -sc 1 1 3.2

# sperical region of interest
voglSphere ${DATAFILE}  -sc 1 1 3.2

# tangent space per-voxel shading
# use the right mouse button to move the light source
voglShade ${DATAFILE}  -sc 1 1 3.2

# unstructured mesh demo
voglUnstructured

# multi-pass reflection rendering of heterogeneous scenes
voglMirror ${DATAFILE} /usr/share/Volumizer/data/textures/plank.rgb

# use 2D raw files as input (ushort data currently not implemented on O2)

voglRaw 0 256 256 77 ushort $DATAPATH/raw/*ima \
-dataRange 0 4095 -sc 1 1 3 


# Raw input lung CT + dose

setenv DATAPATH /usr/share/Volumizer/data/volumes/Lung/raw

# single channel anatomy with grayscale window/level
voglRaw 0 256 256 49 ushort -sc 1 1 2 \
  -mono -dataRange 0 4095 -lut 50 55 \
  $DATAPATH/lung*ima

# single channel dose distribution with a color wash
voglRaw 0 256 256 52 ushort -sc 1 1 2 \
  -color -dataRange 0 100 \
  -lutFile $DATAPATH/../tables/doseRGBA.table \
  $DATAPATH/dose10*ima

# anatomy and dose combined into RGBA as 4 ubytes
voglRaw 0 256 256 49 ubyte4 -sc 1 1 2 \
  -color -lut 50 55 \
  $DATAPATH/dose+ct10*ima

# anatomy and dose combined into RGBA as packed pixels
# packed pixles not supported on RE/RE2 platforms
voglRaw 0 256 256 49 int8888 -sc 1 1 2 \
  -color -lut 50 55 \
  $DATAPATH/dose+ct10*ima

# 4D volumes

# generate a 4D pattern
../../util/faketime fake4D 4 64 64 64 4

# display a 4D volume (e.g., a temporal sequence of 3D volumes)
# drag right to advance a frame
vogl4D fake4D*tif


# Multiple Volumes

# generate some volumetric test patters

../../util/mkcubes 64 64 64  8 cubes.64.08.tif
../../util/mkcubes 64 64 64 16 cubes.64.16.tif
../../util/mkcubes 64 64 64 32 cubes.64.32.tif

voglMultiVolume cubes.64.16.tif
voglMultiVolume cubes.64.16.tif cubes.64.32.tif
voglMultiVolume cubes.64.16.tif cubes.64.32.tif cubes.64.08.tif

