| Image Tools | Text Tools | NanoScope | license | .
. . . .
___
Home
___
IGOR
___
Alpha
___
PGP
___
Resume
___
Version 3.0.4 (née JEG Z-Legend)

IGOR This package is part of JEG Image Tools, a collection of routines for manipulating and displaying images in IGOR Pro. You can download these routines for Mac OS MacOS or Windoze Windoze.

This package has the following dependencies:

If you have already used JEG Z-Legend, the previous version of this package, you may want to read the recent changes

JEG Color Legend appends a color legend for the vertical dimension of image waves and for traces displayed with color as f(z). Controls at the top of the graph allow live adjustment of data range and color table. Everything is balloon-helped, so <CMD><OPT><CTRL>-click on any control to check on its use.

To try out this package, create a demonstration image, then apply a color legend and experiment with adjusting the displayed data range.

Since the demonstration wave is of integral type with a data dimension scaling, you can experiment with dimensional scaling of integer waves.

You can change the displayed colors by setting the color table; you can even easily create and use your own user defined color index waves interchangeably with the built-in color tables.

When done, you can delete the color wave if you desire.

If you find this package useful, you might also want to take a look at JEG Scale-Bar for appending a "nice" scale-bar to a graph.


Create a Demonstration Image

Execute the following lines to create an image wave to try out the JEG Color Legend package.
	Make/N=(100,100)/O/W ColorLegendTest
	ColorLegendTest = sin(p/3)*cos(p/2)*sin(q/4)*32768
	SetScale d, 0, 3e-9, "m", ColorLegendTest
	Display; AppendImage ColorLegendTest
	ModifyGraph width={Aspect,1}

Apply a Color Legend

With a graph containing an image file topmost, select the menu item Graph->Append to Graph->Color legend... and select the appropriate image from the pop-up (usually only one choice).

Alternatively, execute:

	JEG_AddColorLegend2Graph("ColorLegendTest")

It may be necessary to resize the window to see all of the controls.

Adjusting the Displayed Data Range

To change the upper and lower thresholds of the displayed image, either type or click in the SetVariable controls marked "upper z" and "lower z". To return to the original display, see Restoring the full data range. If appropriate (see Dimensional Scaling of Integer Waves), the units of the data dimension will appear in the SetVariable control window.

At least for now, the units text is not available to JEG Color Legend and will not be parsed if changed by the user, i.e., if you change "m" to "nm" in the above window, the additional factor of 10-9 will be ignored. The "proper" response would be rather easy to implement if the SetVariable proc received the full text actually in the window, rather than the result of converting the string to a number and back to a string, which varStr currently is (hint, hint, WaveMetrics).


Restoring the full data range

Click the "Full Range" button to restore the image to its full data range. Dimensional scaling of integer waves, if present, remains in effect.


Offsetting a threshold to zero

Click the "set to zero" check-box next to either the "upper z:" or the "lower z:" SetVariable control to force the value of that threshold to zero. As opposed to their normal behavior of adjusting each threshold separately, when a threshold is zeroed, adjustments to the associated SetVariable control offsets the displayed band; adjustments to the opposing SetVariable control change the size of the band. Obviously, both thresholds can't be zeroed simultaneously; JEG Color Legend enforces this mutual exclusion automatically.


Dimensional Scaling of Integer Waves

As of version 2.0, JEG Color Legend uses a particular (peculiar?) interpretation of data dimension scaling. Specifically, if the wave is of integral type and the "Integer scaling" checkbox is checked, then the data dimension max and min are taken to correspond to the full range of the appropriate integer size, e.g., an 8 bit unsigned integer wave with data dimension full scale of 0-16 nm would scale each data unit to 0.0625 nm and a value of 256 would correspond to 16 nm.

See also: Dialog Help[Change Wave Scaling Dialog]

If the wave is of floating point type
or
if the wave is an f(z) colored trace,

this checkbox does not appear.

If the wave is of integer type and this checkbox is deslected, no scaling will be applied and the dimension string will not appear. To force a dimension string to appear without scaling, set the "Data Properties" "min" to 0 and "max" to MAXINT (28, 216, or 232, as appropriate for the wave precision), set the units string as desired and check the "Apply dimension scaling" checkbox.

At the moment, only the difference between max and min is considered; no attempt is made to offset the minimum (it's awkward and I don't need it; let me know if you do and I'll see).

Setting the Color Table

The color table of the image can be set with the color table menu. Both the image and its associated color legend are updated automatically. Click the "Reverse" check-box to reverse the color table or index wave.


User defined color index waves

User defined color index waves can be used transparently, along with the standard color tables: Grays, Rainbow, YellowHot, BlueHot, BlueRedGreen, and PlanetEarth. Any color index waves (see Image Plots[False Color Details]) placed in the data folder "root:Packages:'JEG Color Legend':'Color Index Waves':" will be appended to the end of the color table menu.

To create a color index wave (appropriate, perhaps, for representing a phosphor screen image):

	NewDataFolder/O/S root:Packages
	NewDataFolder/O/S 'JEG Color Legend'
	NewDataFolder/O/S 'Color Index Waves'
	
	Make/N=(100,3)/W/U/O 'It ain´t easy bein´ green'
	'It ain´t easy bein´ green'[][0] = 0
	'It ain´t easy bein´ green'[][1] = 65535*p/100
	'It ain´t easy bein´ green'[][2] = 0

Then, select the color table menu in an image file with appended Color Legend to try the new color index (you can create a demonstration image to test it on).

Delete the Color Legend

Clicking this button deletes the color legend. A dialog is presented which gives the (default) option of deleting the color legend controls as well. This may seem peculiar, but I've found that some images, such as diffraction patterns, don't need the legend itself, but benefit from controls for adjusting the color table and display thresholds.

This button kills everything in the ProgAxes layer and makes some rather gross assumptions about axis ranges (everything gets set to 0-1), so use with caution if you've made a lot of modifications to the graph layout.


Recent Changes

Since version 2.0 (JEG Z-Legend), the following items (in addition to the name) have changed:

date by version reason
10/28/1998 JEG 4.0.0 non-f(z) traces (aka multi-traces)
assorted bug fixes
10/25/1998 DV 3.0.8 fixed signed integer image scaling
8/11/1998 JEG 3.0.7 fixed bug in application of color index waves
8/10/1998 JP 3.0.6 fixed cosmetic bug in initial color table popup menu
8/10/1998 JEG 3.0.5 replaced hard coding of color tables with CTabList() (if available)
12/16/1997 JEG 3.0.4 Really fixed Graph->Remove->Color legend this time.
Fixed bug in unmatched data folder changes.
Thanks to Ken Winkler.
12/14/1997 JEG 3.0.3 Fixed fatal bug in JEG_EnsureColorLegendPrefs() which caused reproduceable freezes
12/14/1997 JEG 3.0.2 Fixed bug in Graph->Remove->Color legend
12/7/1997 JEG 3.0.1
Horizontal legends and swapXY
A bug prevented proper display of horizontal legends (although apparently nobody noticed!) and legends in graphs which had swapXY = 1 applied. Thanks to Susan Hovde for bringing this to my attention.
Preference panels
Previously, a plethora of preference panels could be opened, and they did not always accurately reflect settings. Now only one each of the Color Legend Display Preferences and Color Legend Configuration preference panels can be opened.
Example layouts
A folder of example layouts is included. Please send me yours for inclusion.
3/2/97 JEG 3.0.0
Traces set as f(z)
Color legends can now be applied to traces as well as image waves. The dialog obtained from Graph->Append to Graph->Color Legend... prescreens the traces in the graph and presents only those to which ModifyGraph zColor={} has already been applied. I suppose I could have figured out a way to allow setting f(z) for any trace, but I think IGOR's existing method of double-clicking the wave and single-clicking the f(z) button is pretty elegant already.
Set to zero (see Offsetting a threshold to zero)
Since, often, the image absolute values are not as interesting as are their range, you can now force one threshold to zero. Presumably this will normally be the lower bound, but perhaps oceanographers or devotees of Dante will have use for zeroing the upper bound.
Layout preferences
Due to constant harrasment from disgruntled users, irate about my legend layout (okay, okay, two people commented that they were changing the layout), I've added a control panel at Misc->Color legend preferences... that allows a fair degree of customization with a semi-graphical interface. If desired, your own settings can be captured to an explicit preference file, "JEG Color Legend Prefs", within the :Igor Pro: folder. If this file is present, these settings will be used for new experiments, in lieu of my defaults.

Disclaimer:

WaveMetrics is not responsible for the content of this site.
Please contact me with any questions.

You are the [an error occurred while processing this directive] visitor to this page.

Last modified August 5, 2003 2:30 PM
by Jonathan Guyer

[Assembled by Alpha] [Hosted by HIS.COM]
[Made With Macintosh]