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 906 - (download) (annotate)
Thu Apr 21 17:10:27 2011 UTC (8 years, 6 months ago) by glk
File size: 1189 byte(s)
tweaks to make sure that [-1,1]x[-1,1] is "inside" rgb lookup

echo "for making RGB lookup table for curvature-based VR"

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

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

echo "0 0 1     0 1 1    0 1 0     1 1 0    1 0 0 " \
 | 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 3op + 0.03 x.nrrd y.nrrd \
 | unu 2op x - 40 | unu 1op erf \
 | unu affine -1 - +1 0 1 -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:15,3 \
 | unu quantize -b 16 \
 | unu unquantize -i - -min 0 -max 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: (-1.01,-1.01)" >> hue.nhdr
echo "space directions: none (0.0101,0.0) (0.0,0.0101)" >> 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