backback

Figures 2,3 : Marschner-Lobb renderings

perfectml thumbnail fourml thumbnail

The dataset was generated by a "test" program in teem, teem/src/nrrd/test/genvol.c, which can make any number of volumes, depending on which lines are commented out. Currently, it makes the Marschner-Lobb test volume. Teem's test programs are not distributed with the pre-compiled binaries, so can download the source and compile it yourself:

cd teem-1.5/src/nrrd
make
alias genvol `pwd`/test/genvol

The program is test/genvol, which you use to make the datasets as follows. Note the "correct" renderings actually come from a ridiculously high resolution version of the volume, for which nearly any non-brain-dead choice of kernels will lead to curvature computations arbitrarily close to the correct values:

genvol -s 40 40 40 -min -1 -1 -1 -max 1 1 1 -o ML2.nrrd
genvol -s 600 600 40 -min -1 -1 -1 -max 1 1 1 -o ML3.nrrd
The ML3.nrrd is too big to put online, but here's ML2.nrrd.

Make transfer functions (using the color control points in hue2.txt):

echo "0 1" \
 | unu reshape -s 2 \
 | unu resample -s 4000 -k tent -o ramp.nrrd

echo "-1 0    -0.005 0     0.005 1     1 1" \
 | unu reshape -s 2 4 \
 | unu imap -i ramp.nrrd -r -m - \
 | unu axinsert -a 0 -l "A" \
 | unu axinfo -a 1 -l "gage(v)" -mm 0 1 -o val-txf.nrrd

unu 2op / hue2.txt 255 \
 | unu gamma -g 2.3 \
 | unu rmap -i ramp.nrrd -m - \
 | unu gamma -g 0.44 \
 | unu axinfo -a 0 -l "RGB" \
 | unu axinfo -a 1 -l "gage(mc)" -mm -15 15 -o mc-hue-txf.nrrd

Now, the renderings for Figure 2. The -ads 0.2 0.75 0.0 in the first rendering has been added for this page, it should have been used to make the rendering in the paper.

setenv IS 512
setenv NT 53

alias ML_DEMO miter \
   -fr -5 0 15 -up 0 0 1 -or -rh \
   -dn -1.5 -di 0 -df 1.5 -ar \
   -ur -0.6 0.6 -vr -0.6 0.6 \
   -is $IS $IS -step 0.001 -nt $NT \
   -ld 4.5 -8 -12 -ads 0.43 0.57 0.0

ML_DEMO -i ML3.nrrd \
   -k00 cubic:1,0 -k11 cubicd:1,0 -k22 cubicdd:1,0 \
   -txf val-txf.nrrd -ads 0.2 0.75 0.0 -o - \
 | overrgb -i - -b 0 0 0 -o correct-gray.png

ML_DEMO -i ML3.nrrd \
   -k00 cubic:1,0 -k11 cubicd:1,0 -k22 cubicdd:1,0 \
   -txf val-txf.nrrd mc-hue-txf.nrrd -o - \
 | overrgb -i - -b 0 0 0 -o correct-mc.png

Renderings for Figure 3:

ML_DEMO -i ML2.nrrd \
   -k00 cubic:0,0.5 -k11 cubicd:0,0.5 -k22 cubicdd:0,0.5 \
   -txf val-txf.nrrd mc-hue-txf.nrrd -o - \
 | overrgb -i - -b 0 0 0 -o catmull.png

ML_DEMO -i ML2.nrrd \
   -k00 tmf:0,3,4 -k11 tmf:1,3,4 -k22 tmf:2,3,4 \
   -txf val-txf.nrrd mc-hue-txf.nrrd -o - \
 | overrgb -i - -b 0 0 0 -o best-tmf.png

ML_DEMO -i ML2.nrrd \
   -k00 tmf:0,3,3 -k11 tmf:1,2,2 -k22 tmf:2,0,2 \
   -txf val-txf.nrrd mc-hue-txf.nrrd -o - \
 | overrgb -i - -b 0 0 0 -o best4.png

ML_DEMO -i ML2.nrrd \
   -k00 cubic:0,0.5 -k11 cubicd:1,0 -k22 cubicdd:1,0 \
   -txf val-txf.nrrd mc-hue-txf.nrrd -o - \
 | overrgb -i - -b 0 0 0 -o okay4.png

Then, some unu magic to compose the renderings into the two final figures. Figure 2 includes a unu-generated colorbar:

unu pad -i correct-gray.png -min 0 0 0 -max M M+40 M -b pad -v 255 \
 | unu join -i - correct-mc.png -a 1 \
 | unu pad -min 0 0 0 -max M M M+60 -b pad -v 255 -o tmp.png

setenv NRRD_DEF_CENTER cell
unu resample -i mc-hue-txf.nrrd -s = 552 -k tent \
 | unu axinsert -a 2 | unu resample -s = = 40 -k box \
 | unu quantize -b 8 -min 0 -max 1 \
 | unu inset -i tmp.png -min 0 256 522 -s - \
 | unu gamma -g 1.3 -o perfectml.png
unsetenv NRRD_DEF_CENTER

Figure 3:

unu pad -i catmull.png -min 0 0 0 -max M M+40 M -b pad -v 255 \
 | unu join -i - best-tmf.png -a 1 -o a.png
unu pad -i best4.png -min 0 0 0 -max M M+40 M -b pad -v 255 \
 | unu join -i - okay4.png -a 1 -o b.png
unu pad -i a.png -min 0 0 0 -max M M M+150 -b pad -v 255 \
 | unu join -i - b.png -a 2 \
 | unu pad -min 0 0 0 -max M M M+150 -b pad -v 255 \
 | unu gamma -g 1.3 -o fourml.png

These web pages:

unu resample -i perfectml.png -s = x0.25 x0.25 -o _perfectml.png
unu resample -i four.png -s = x0.25 x0.25 -o _four.png
unu resample -i perfectml.png -s = x0.15 x0.15 -o __perfectml.png
unu resample -i fourml.png -s = x0.15 x0.15 -o __fourml.png
Clean-up:
rm -f b.png a.png tmp.png *-txf.nrrd ramp.nrrd