From: David W. <dm...@sc...> - 2004-08-01 16:30:22
|
This worked great -- thanks!! Dave On Jul 31, 2004, at 9:49 PM, Gordon Kindlmann wrote: > > > Begin forwarded message: > >> From: Gordon Kindlmann <gk...@cs...> >> Date: Sat Jul 31, 2004 11:44:03 AM US/Mountain >> To: tee...@li... >> Subject: Re: [Teem-users] uniform resampling of non-uniform data >> >> hi, >> >> Great question, and a great place to ask! >> >> If you save those numbers into a text file bow.txt, then: >> >> echo "0 1" \ >> | unu reshape -s 2 \ >> | unu resample -s 256 -k tent \ >> | unu imap -r -m bow.txt -o bow-256.txt >> >> will save a 256-entry lookup table in bow-256.txt, using simple >> linear interpolation between the (irregularly spaced) control points. >> Unfortunately, nrrd has no way (not that I know of) to do filtered >> sampling on irregularly spaced points. Actually, I can imagine some >> twisted scheme where you warp the values around prior to doing the >> lookup, so that effectively the control points are regularly spaced, >> and then unwarping afterwards, but off the top of my head I can't see >> how to do it. And its probably moot anyway because "unu rmap" (and >> the nrrdApply1DRegMap() call behind it) can't use a kernel- I felt >> that it wouldn't be useful enough. >> >> As for doing cubic interpolation, I'd be surprised if you actually >> wanted ringing between the control points in a colormap- that would >> look awful. If you just want a touch of blurring between the control >> point colors, then you could: >> >> echo "0 1" \ >> | unu reshape -s 2 \ >> | unu resample -s 256 -k tent -o ramp.nrrd >> >> unu resample -i bow.txt -s = x1 -k cubic:1,0 \ >> | unu crop -min 1 0 -max M M \ >> | unu inset -i bow.txt -s - -min 1 0 \ >> | unu imap -r -i ramp.nrrd -m - -o bow-blur-256.txt >> >> But having just tried this, and looked at the results, you might >> actually want to do this: >> >> unu resample -i bow.txt -s = x1 -k cubic:1,0 \ >> | unu crop -min 1 0 -max M M \ >> | unu inset -i bow.txt -s - -min 1 0 \ >> | unu imap -r -i ramp.nrrd -m - \ >> | unu resample -s = x1 -k gauss:4,3 -o bow-blur2-256.txt >> >> which seems to have a smoother transition around orange. >> >> To look at this as an image: >> >> unu axinsert -i bow-blur2-256.txt -a 2 \ >> | unu pad -min 0 0 0 -max M M M+100 \ >> | unu quantize -b 8 \ >> | unu save -f pnm | xv - >> >> >> Gordon >> >> PS: rm -f ramp.nrrd >> >> >> On Saturday, July 31, 2004, at 10:09 AM, David Weinstein wrote: >> >>> Hi, >>> >>> I have a colormap (attached below) which has irregular spacing >>> (stored in the first column). How do I use "unu imap" to create a >>> colormap with 256 uniformly spaced samples (say, using cubic >>> interpolation)? >>> >>> Thanks, >>> Dave >>> >>> ========== >>> >>> 0 0.453125 0.000000 0.000000 >>> 0.0605 0.753906 0.000000 0.000000 >>> 0.121 0.972656 0.218750 0.000000 >>> 0.146 1.000000 0.313002 0.000000 >>> 0.332 1.000000 0.804688 0.000000 >>> 0.389 0.910156 0.851562 0.000000 >>> 0.529 0.468750 0.886719 0.066406 >>> 0.623 0.113281 0.886719 0.441406 >>> 0.682 0.000000 0.835938 0.640625 >>> 0.771 0.000000 0.664062 0.941406 >>> 0.834 0.000000 0.425781 1.000000 >>> 0.889 0.000000 0.16 1.000000 >>> 0.920 0.000000 0.070312 0.953125 >>> 0.961 0.000000 0.000000 0.687500 >>> 1.0 0.000000 0.000000 0.45 >>> >>> >>> >>> ------------------------------------------------------- >>> This SF.Net email is sponsored by OSTG. Have you noticed the changes >>> on >>> Linux.com, ITManagersJournal and NewsForge in the past few weeks? >>> Now, >>> one more big change to announce. We are now OSTG- Open Source >>> Technology >>> Group. Come see the changes on the new OSTG site. www.ostg.com >>> _______________________________________________ >>> teem-users mailing list >>> tee...@li... >>> https://lists.sourceforge.net/lists/listinfo/teem-users >> > |