Since the imported image does not have an associated color table, you need to apply a pre-defined color table to display the image. If you are running IDL on a TrueColor display, set the DECOMPOSED keyword of the DEVICE command to zero before your first color table related routine is used within an IDL session or program. Import the image from the file: ctscanImage = READ_BINARY(ctscanFile, $ DATA_DIMS = ctscanSize) Initialize the image size parameter: ctscanSize = If the BLOCK keyword was not set, the example routine would produce all of the displays at once and then end.ĭetermine the path to the ctscan.dat binary file: ctscanFile = FILEPATH( 'ctscan.dat', $ SUBDIRECTORY = ) The BLOCK keyword is set when using XLOADCT to force the example routine to wait until the Done button is pressed to continue. Run the example procedure by entering usingxloadct at the IDL command prompt or view the file in an IDL Editor window by entering. #Loadct idl pro#pro in the examples/doc/image subdirectory of the IDL installation directory for code that duplicates this example. Complete the following steps for a detailed description of the process. The indexed image used in this example is a computed tomography (CT) scan of a human thoracic cavity and is contained (without a default color table) within the ctscan.dat file in IDL’s examples/data directory. #Loadct idl how to#The following example shows how to use XLOADCT to load a color table and then change that table to highlight specific features of an image. The XLOADCT utility allows you to load one of IDL’s pre-defined color tables and change that color table if necessary. Set this keyword to use the current color tables, regardless of the contents of the COLORS common block. If the UPDATECBDATA keyword is not set the value accepted by the DATA keyword to the procedure specified by UPDATECALLBACK will be undefined. It will be passed via the DATA keyword to the user-supplied procedure specified via the UPDATECALLBACK keyword, if any. The procedure may optionally accept a keyword called DATA, which will be automatically set to the value specified by the optional UPDATECBDATA keyword. Set this keyword to a string containing the name of a user-supplied procedure that will be called when the color table is updated by XLOADCT. If this keyword is set to zero, the message is printed. Normally, no informational message is printed when a color map is loaded. The default is all available colors (!D.TABLE_SIZE). Use color indices from 0 to the smaller of !D.TABLE_SIZE-1 and NCOLORS-1. By default, XLOADCT does not block event processing. A group leader must be specified (via the GROUP keyword) for the MODAL keyword to have any effect. Set this keyword to block processing of events from other widgets until the user quits XLOADCT. When this ID is specified, a death of the caller results in a death of XLOADCT. The widget ID of the widget that calls XLOADCT. Set this keyword to a string representing the name of the file to be used instead of the file colors1.tbl in the IDL directory. XLOADCT will use color indices from BOTTOM to BOTTOM+NCOLORS-1. See the documentation for the NO_BLOCK keyword to XMANAGER for an example. Therefore, to have XLOADCT block, any earlier calls to XMANAGER must have been called with the NO_BLOCK keyword. Note: Only the outermost call to XMANAGER can block. For more information, see the documentation for the NO_BLOCK keyword to XMANAGER. Note that setting BLOCK=1 will cause all widget applications to block, not just this application. By default, BLOCK is set equal to zero, providing access to the command line if active command line processing is available. Set this keyword to have XMANAGER block when this application is registered. Its source code can be found in the file xloadct.pro in the lib/utilities subdirectory of the IDL distribution. This routine is written in the IDL language. Many other options, such as Gamma correction, stretching, and transfer functions can also be applied to the colortable. IDL maintains a color table on PseudoColor displays or when the DECOMPOSED keyword to the DEVICE command is set to zero ( DEVICE, DECOMPOSED = 0) on TrueColor displays. Clicking on the name of a color table causes that color table to become IDL’s current color table. XLOADCT displays the current Direct Graphics color table and shows a list of available predefined color tables. The XLOADCT procedure is a utility that provides a graphical widget interface to the LOADCT procedure.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |