ANNOTATEWINDOW Name
ANNOTATEWINDOW
Purpose
The purpose of this routine is to allow the user to annotate or make
measurements on a graphics window. A copy of the graphics window is
created and placed into an annotation window. The user can create
various kinds of file output from within the annotation window.
Select the annotation tool from the tool bar at the top of the annotate
window. Click and drag in the window to draw the annotation. (The text
tool requires you to click in the window to start typing. Be sure to
hit a carriage return at the end of typing to "set" the text in the
window.) Click anywhere inside the tool to "select" it. Most tools
allow you to move and edit the shape of the annotation after selection.
Right click inside a selected annotation to access properties of that
annotation, such as grouping, moving an annotation forward to backward,
deleting the object, etc. Click the "Other Properties" button to access
individual properties for the annotations. For example, if you mis-spelled
some text, you would click on the text to select it. Right click to access
it's select menu, select the Other Properties button, and find the text
field in this pop-up dialog to change the spelling of the text.
Authors
FANNING SOFTWARE CONSULTING BURRIDGE COMPUTING
1645 Sheely Drive 18 The Green South
Fort Collins Warborough, Oxon
CO 80526 USA OX10 7DN, ENGLAND
Phone: 970-221-0438 Phone: +44 (0)1865 858279
E-mail: davidf@dfanning.com E-mail: davidb@burridgecomputing.co.uk
Category
Catalyst Applications. Syntax
AnnotateWindow, theBackground
Arguments
theBackground: This can either be the window index number of a graphics window,
or it can be an 8-bit or 24-bit image variable. If this argument
is undefined, the program tries to obtain a background image
from the current graphics window. Note that if the graphics window
contains a black background (the normal situation for many IDL
graphics windows), this will be reproduced *exactly* in PostScript
output. This is NOT the same as most PostScript output. If you
intend to create PostScript output of your annotated window, it
may be better to create graphics windows with white backgrounds.
Device, Decomposed=0, Get_Decomposed=currentState
TVLCT, [0, 255], [0,255], [0, 255], !D.Table_Size-3
Plot, findgen(11), Color=!D.Table_Size-3, Background=!D.Table_Size-2
Device, Decomposed=currentState
AnnotateWindow
Keywords
ADD_OBJECTS: An object, or an array of objects to add to the Annotation Window.
Objects added in this fashion will be destroyed when the Annotate window
is destroyed.
BG_COLOR: The name of a background color. This is used only if there is a margin
around the background image. By default, "white". The background color
will always be "white" if the output is sent to a PostScript file. (See list
of color names below.)
COLOR: The name of the foreground color for the annotations. By default "Light Coral"
as something that might contrast enough with any background. (See list
of color names below.)
NOMARGIN: There is a 10% margin added to the background image, unless this keyword
is set, in which case the background image will fill the annotation window.
OUTPUT_FILENAME: The base name of the output filename used in SAVE AS operations. By default, "annotation".
XRANGE: The TapeMeasure tool will report the distance in normalized coordinate space
by default. Use this keyword to specify a two-element array that represents
the minimum and maximum X range of the background image.
YRANGE: The TapeMeasure tool will report the distance in normalized coordinate space
by default. Use this keyword to specify a two-element array that represents
the minimum and maximum Y range of the background image.
_EXTRA: Any keywords appropriate for the ANNOTATEINTERACTION object.
Restrictions
Requires the Catalyst Library from Fanning Software Consulting, Inc., or a catalyst.sav file
to be restored prior to use. A Catalyst save file may be download from Coyote's Guide to IDL
Programming. Be sure to download a version compatible with your IDL license.
http://www.dfanning.com/programs/catalyst.sav (for IDL 6.1 or higher)
The following color names can be used for the BG_COLOR and COLOR keywords:
Active Almond Antique White Aquamarine Beige Bisque
Black Blue Blue Violet Brown Burlywood Cadet Blue
Charcoal Chartreuse Chocolate Coral Cornflower Blue Cornsilk
Crimson Cyan Dark Goldenrod Dark Gray Dark Green Dark Khaki
Dark Orchid Dark Red Dark Salmon Dark Slate Blue Deep Pink Dodger Blue
Edge Face Firebrick Forest Green Frame Gold
Goldenrod Gray Green Green Yellow Highlight Honeydew
Hot Pink Indian Red Ivory Khaki Lavender Lawn Green
Light Coral Light Cyan Light Gray Light Salmon Light Sea Green Light Yellow
Lime Green Linen Magenta Maroon Medium Gray Medium Orchid
Moccasin Navy Olive Olive Drab Orange Orange Red
Orchid Pale Goldenrod Pale Green Papaya Peru Pink
Plum Powder Blue Purple Red Rose Rosy Brown
Royal Blue Saddle Brown Salmon Sandy Brown Sea Green Seashell
Selected Shadow Sienna Sky Blue Slate Blue Slate Gray
Snow Spring Green Steel Blue Tan Teal Text
Thistle Tomato Turquoise Violet Violet Red Wheat
White Yellow Example
To annotate a medical image:
filename = Filepath(Subdirectory=['examples','data'], 'mr_knee.dcm')
image = Read_DICOM(filename)
AnnotateWindow, Rebin(image, 512, 512), XRange=[0,5], YRange=[0,5]
Remember to right-click on any annotation object to access that objects properties.
This is the way you would change a mis-spelled text label, add units to a measurement,
change the color of an annotation object, etc.
Also remember that you MUST type a carriage return when using the Text Tool to
"set" the text into the annotation window.
Modification History
Written by: David W. Fanning, 25 July 2005.
Improved documentation header. 11 August 2005. DWF.
Added the ability to add annotation objects on initialization. 1 October 2008. DWF.
Added the ability to make this a resizeable graphics window. 1 October 2008. DWF.