falsecolor and textlabels question

Hi!

I am successfully generating falsecolor images and found the labels that find the lowest and hightest values quite useful. Do you know a way to add more labels in the image for intermediate values?

Thanks in advance,

Pierre-Felix Breton

Hi Pierre-Felix,

On X11 displays that support 8-bit color lookup mode, you can use the -b option of ximage and the 'i' command to create contours, labelling them manually with the 'l' command. This doesn't work on a lot of modern graphics cards, unfortunately. The -cl option of falsecolor is your next best option. Or, if you don't like that one, try -cb.

One of my favorites is to generate both an illuminance image and a regular image, then combine them with falsecolor:

rpict \[options\] octree > regular\.pic rpict [same options] -i+ octree > illum.pic
% falsecolor -cl -i illum.pic -l Lux -p regular.pic > isolux.pic

-Greg

From: "Pierre-Felix Breton" <[email protected]>
Date: March 17, 2004 5:13:44 AM PST

Hi!

I am successfully generating falsecolor images and found the labels that find the lowest and hightest values quite useful. Do you know a way to add more labels in the image for intermediate values?

Thanks in advance,

Pierre-Felix Breton

Greg Ward wrote:

% rpict [same options] -i+ octree > illum.pic

You know, all this time, I've always used "-i" to compute irradiance, thinking it was functionally equivalent to "-i+". If the default is for rpict to compute radiance, I'd expect "-i" to always cause an irradiance calculation, the same as "-i+", and that's been my experience. In re-re-re-reading the manpage, I see:

"Normally, the appearance of a boolean option causes a feature to be 'toggled', that is switched from off to on or on to off depending on its previous state."

How does rpict "remember" what state it was placed into from one instance to the next? I suppose the safe thing to do is to always call the option explicitly, but I'm curious now: can someone give me an example of rpict "remembering" it was set to compute irradiance?

···

----

      Rob Guglielmetti

e. [email protected]
w. www.rumblestrip.org

Rpict doesn't "remember" the setting from a previous run, if that's what you're thinking. It only remembers it from previous appearances of the option. For example:

% rpict -i

turns irradiance computation on, but

% rpict -i -i

turns it off again.

% rpict -i -i -i -i -i -i+

turns it on. (Had you counting, didn't I?) If your intention is to switch the option "on", then -i+ (or equivalently, -iY -iy -iT -it -i1 all mean the same) is probably better.

The reason rpict pays attention to multiple appearances of an option is in case you have aliased your version of rpict to something else, e.g. the following in your .cshrc file:

alias robpict 'rpict -ab 1 -ad 2048 -i+ \!*'

Then, every time you ran "robpict" instead of "rpict," you would get the set of starting options above. If you ran "robpict -defaults", you'd get to see these options and how they affect the normal default values.

In other words, giving an option then overriding it later on the command line makes sense in terms of creating your own default sets, which you can incorporate into an alias as above or put into an options file and read with the @file.opt feature. Using rad, the render= variable overrides whatever parameters rad has set for you.

Does this make sense?
-Greg

···

From: Rob Guglielmetti <[email protected]>
Date: March 17, 2004 11:09:54 AM PST

Greg Ward wrote:

% rpict [same options] -i+ octree > illum.pic

You know, all this time, I've always used "-i" to compute irradiance, thinking it was functionally equivalent to "-i+". If the default is for rpict to compute radiance, I'd expect "-i" to always cause an irradiance calculation, the same as "-i+", and that's been my experience. In re-re-re-reading the manpage, I see:

"Normally, the appearance of a boolean option causes a feature to be 'toggled', that is switched from off to on or on to off depending on its previous state."

How does rpict "remember" what state it was placed into from one instance to the next? I suppose the safe thing to do is to always call the option explicitly, but I'm curious now: can someone give me an example of rpict "remembering" it was set to compute irradiance?

----

     Rob Guglielmetti

Greg Ward wrote:

Rpict doesn't "remember" the setting from a previous run, if that's what you're thinking. It only remembers it from previous appearances of the option.

OK. Thanks for the explanation. You've taught me something new...

In other words, giving an option then overriding it later on the command line makes sense in terms of creating your own default sets, which you can incorporate into an alias as above or put into an options file and read with the @file.opt feature. Using rad, the render= variable overrides whatever parameters rad has set for you.

Does this make sense?

Yes, perfect sense. Thanks, Greg. It never occurred to me to "roll my own" commands by aliasing a command and my preferred options (I know this is lame, but UNIX gets cooler all the time!). Now that I understand that scenario, it makes perfect sense that you would have to allow for the possibility of an option being "set twice", once by the alias and then again as an actual commmand line argument.

And in case you're wondering, no, I don't type out the commands all the time. But I use scripts with hard-coded options, so this scenario you described just never materialized in my head before. This alias method is much more flexible, while being simpler to boot. Cool, thanks, etc...

- Rob G.

Hi Greg,

Now that I relook this ,I think I did not expressed myself correctly:

I am using the -e switch of the falsecolor utility. The text labels overlaid
on the drawing (extrema points) are really useful for me. I would like to
add more of theses labels though and wonder if it is possible somehow

Regards,

Pierre-Felix
Note: I must say that I don't generate the irradiance data out of radiance.
I use mental ray that saves a pic file with the data I want so I am
essentially looking for 2d tools.

···

----- Original Message -----
From: "Greg Ward" <[email protected]>
To: "Radiance general discussion" <[email protected]>
Cc: "Pierre-Felix Breton" <[email protected]>
Sent: Wednesday, March 17, 2004 11:07 AM
Subject: Re: falsecolor and textlabels question

Hi Pierre-Felix,

On X11 displays that support 8-bit color lookup mode, you can use the
-b option of ximage and the 'i' command to create contours, labelling
them manually with the 'l' command. This doesn't work on a lot of
modern graphics cards, unfortunately. The -cl option of falsecolor is
your next best option. Or, if you don't like that one, try -cb.

One of my favorites is to generate both an illuminance image and a
regular image, then combine them with falsecolor:

rpict \[options\] octree &gt; regular\.pic rpict [same options] -i+ octree > illum.pic
% falsecolor -cl -i illum.pic -l Lux -p regular.pic > isolux.pic

-Greg

From: "Pierre-Felix Breton" <[email protected]>
Date: March 17, 2004 5:13:44 AM PST

Hi!

I am successfully generating falsecolor images and found the labels
that find the lowest and hightest values quite useful. Do you know a
way to add more labels in the image for intermediate values?

Thanks in advance,

Pierre-Felix Breton

Forgot to forward this to the group. Maybe it's of interest to someone.

-G

···

Begin forwarded message:

From: Greg Ward <[email protected]>
Date: March 19, 2004 8:58:49 AM PST
To: "Pierre-Felix Breton" <[email protected]>

Hi Pierre-Felix,

I think I understood your question, and I answered it as best I could. There are exactly two extrema points in any data set, so you won't get more than this using falsecolor (or any other tool). However, you can get a legend corresponding to other values using the -cl or -cb options of falsecolor. If you want actual numeric labels superimposed on your image, you have to use the trick I explained with ximage, which unfortunately works only on certain X11 servers. Failing that, you would have to do a bit of programming with the C-shell to get place labels in your image.

Here is an example that works within a C-shell:

% ximage -olp -e auto picture.hdr | ( echo -n 'pcond picture.hdr | pcompos - 0 0' ; rcalc -o ' "\\!psign -h 12 ${1\}&quot; {2\} {$3}\' ; echo '| ra_tiff - labelled.tif' ) | csh -f

Once ximage is up, type 't' at the places where you want it to report the luminance. Obviously, you'll have to substitute both occurences of "picture.hdr" with your HDR image name. The output is put in the TIFF "labelled.tif"

-Greg

P.S. Why on Earth are you using Mental Ray? Don't you LIKE long, incomprehensible command lines?

From: "Pierre-Felix Breton" <[email protected]>
Date: March 19, 2004 3:41:15 AM PST

Hi Greg,

Now that I relook this ,I think I did not expressed myself correctly:

I am using the -e switch of the falsecolor utility. The text labels overlaid
on the drawing (extrema points) are really useful for me. I would like to
add more of theses labels though and wonder if it is possible somehow

Regards,

Pierre-Felix
Note: I must say that I don't generate the irradiance data out of radiance.
I use mental ray that saves a pic file with the data I want so I am
essentially looking for 2d tools.