
228 Chapter 8: Creating a Manipulator
Example: Color Table Manipulator iTool Developer’s Guide
Example Code
The class definition code for this example tool is included in the file
example3tool__define.pro in the examples/doc/itools subdirectory of
the IDL distribution. Run the example procedure by entering
example3tool__define at the IDL command prompt or view the file in an IDL
Editor window by entering .EDIT example3tool__define.pro.
Tool Launch Routine for Custom Color Table Manipulator
Create a launch routine (example3tool.pro) for the tool containing the custom
color table manipulator. Create an IDLImagePixels type of IDLitData object if the
user initializes the tool with a data argument.
Example Code
The class definition code for this example manipulator is included in the file
example3_manippalette__define.pro in the examples/doc/itools
subdirectory of the IDL distribution. Run the example procedure by entering
example3_manippalette__define at the IDL command prompt or view the
file in an IDL Editor window by entering
.EDIT
example3_manippalette__define.pro.
Running the Color Table Manipulator Example
Save and compile all of the files. Enter the following at the command line to
reproduce the display shown in “Example: Color Table Manipulator” on page 226.
ctboneFile = FILEPATH('ctbone157.jpg', $
SUBDIRECTORY = ['examples', 'data'])
READ_JPEG, ctboneFile, ctboneImg
; Launch the example tool with the input data.
example3tool, ctboneImg
Select the Color Table tool on the toolbar and move the cursor over the image. Hold
down the left-mouse button and drag the cursor to the right and left to scroll through
the available color tables. You can also use the right and left arrow keys to modify the
color table value.