Home My Page Projects Code Snippets Project Openings diderot
Summary Activity Tracker Tasks SCM

SCM Repository

[diderot] View of /branches/pure-cfg/data/didthis-hue.txt
ViewVC logotype

View of /branches/pure-cfg/data/didthis-hue.txt

Parent Directory Parent Directory | Revision Log Revision Log


Revision 859 - (download) (annotate)
Tue Apr 19 19:45:51 2011 UTC (8 years, 5 months ago) by glk
File size: 1240 byte(s)
RGB txf for curvature-based VR
echo "for making RGB lookup table for curvature-based VR"

echo "-1 1 -1 1" \
 | unu reshape -s 2 2 \
 | unu resample -s 200 200 -k tent -c node -o x.nrrd

unu swap -a 0 1 -i x.nrrd \
 | unu flip -a 1 -o y.nrrd

echo "1 0 0   1 1 0   0 1 0   0 1 1  0 0 1" \
 | unu reshape -s 3 5 -o cmap.txt

unu 2op atan2 x.nrrd y.nrrd \
 | unu 3op clamp -0.7854 - 2.3562 \
 | unu rmap -min -0.7854 -max 2.3562 -m cmap.txt -o hue.nhdr

rm -f cmap.txt

unu 2op + x.nrrd y.nrrd \
 | unu 2op + - 0.03 | unu 2op x - 40 | unu 1op erf \
 | unu 2op + 1 - | unu 2op / - 2 -o mask.nrrd

unu join -i x.nrrd y.nrrd -a 0 -incr \
 | unu project -a 0 -m l2 \
 | unu gamma -g 0.75 \
 | unu 3op clamp 0 - 1 \
 | unu resample -s x1 x1 -k gauss:10,3 \
 | unu 2op - - 0.02 \
 | unu 2op x - 1.03 \
 | unu 3op clamp 0 - 1 \
 | unu 2op x - mask.nrrd -o sat.nrrd

unu join -i sat.nrrd sat.nrrd sat.nrrd -a 0 -incr \
 | unu 3op lerp - 0.65 hue.nhdr -o hue.nhdr

rm -f x.nrrd y.nrrd mask.nrrd sat.nrrd

echo "space dimension: 2" >> hue.nhdr
echo "space origin: (-0.205,-0.205)" >> hue.nhdr
echo "space directions: none (.00206030150753768844,0.0) (0.0,.00206030150753768844)" >> hue.nhdr
echo "kinds: RGB space space" >> hue.nhdr

unu dice -i hue.nhdr -a 0 -o ./ -ff hue-%d.nrrd

root@smlnj-gforge.cs.uchicago.edu
ViewVC Help
Powered by ViewVC 1.0.0