# Catalyst Source-Data Directory On-Line Help

This page was created by the IDL library routine `mk_html_help`. For more information on this routine, refer to the IDL Online Help Navigator or type:

         ? mk_html_help

at the IDL command line prompt.

Last modified: Sun Oct 26 20:43:11 2008.

# List of Routines

- CATDATAATOM
- CATDATAATOM::ADDTOOL
- CATDATAATOM::APPLYCOLORS
- CATDATAATOM::APPLYCOORDS
- CATDATAATOM::CLEANUP
- CATDATAATOM::GETDATA
- CATDATAATOM::GETPROPERTY
- CATDATAATOM::INIT
- CATDATAATOM::REDO
- CATDATAATOM::SETDATA
- CATDATAATOM::SETPROPERTY
- CATDATAATOM::UNDO
- CATIMAGE
- CATIMAGE2D
- CATIMAGE2D::CONTROLPANEL
- CATIMAGE2D::EVENTHANDLER
- CATIMAGE2D::GETPROPERTY
- CATIMAGE2D::INIT
- CATIMAGE2D::LOADIMAGE
- CATIMAGE2D::PIXEL_TO_VALUE
- CATIMAGE2D::SETPROPERTY
- CATIMAGE::CLEANUP
- CATIMAGE::CONTROLPANEL
- CATIMAGE::COPYPARAMETERS
- CATIMAGE::CREATEDISPLAYIMAGE
- CATIMAGE::DRAW
- CATIMAGE::DRAW_MODE_0
- CATIMAGE::DRAW_MODE_1
- CATIMAGE::DRAW_MODE_2
- CATIMAGE::EVENT_HANDLER
- CATIMAGE::GETPROPERTY
- CATIMAGE::INIT
- CATIMAGE::MESSAGEHANDLER
- CATIMAGE::MOVE
- CATIMAGE::PAN
- CATIMAGE::PIXEL_TO_VALUE
- CATIMAGE::POINT_INSIDE
- CATIMAGE::SELECT
- CATIMAGE::SELECTPANEL
- CATIMAGE::SETPROPERTY
- CATIMAGE::SHOW
- CATIMAGE::ZOOMIN
- CATIMAGE::ZOOMOUT
- CATIMAGEDATA
- CATIMAGEDATA::CLEANUP
- CATIMAGEDATA::DRAW
- CATIMAGEDATA::GETDATA
- CATIMAGEDATA::GETPROPERTY
- CATIMAGEDATA::INIT
- CATIMAGEDATA::IP
- CATIMAGEDATA::LOADCT
- CATIMAGEDATA::LOADIMAGE
- CATIMAGEDATA::MESSAGEHANDLER
- CATIMAGEDATA::SETDATA
- CATIMAGEDATA::SETORIGINAL
- CATIMAGEDATA::SETPROPERTY
- CATIMAGEDATA::SHOW
- CATIMAGEDATA::WINDOW
- CATIMAGEDATA::XCOLORS
- CATTRUECOLORIMAGE
- CATTRUECOLORIMAGE::CONTROLPANEL
- CATTRUECOLORIMAGE::EVENTHANDLER
- CATTRUECOLORIMAGE::INIT
- CATTRUECOLORIMAGE::LOADIMAGE
- CATTRUECOLORIMAGE::PIXEL_TO_VALUE
- CATTRUECOLORIMAGE::SETPROPERTY
- IMAGECONTAINER::ADD
- IMAGECONTAINER::DRAW
- IMAGECONTAINER::GETFRAME
- IMAGECONTAINER::REMOVEFRAME
- IMAGECONTAINER__DEFINE
- IMAGEFRAME
- IMAGEFRAME::CLEANUP
- IMAGEFRAME::DRAW
- IMAGEFRAME::DRAW_MODE_0
- IMAGEFRAME::DRAW_MODE_1
- IMAGEFRAME::DRAW_MODE_2
- IMAGEFRAME::GETPROPERTY
- IMAGEFRAME::INIT
- IMAGEFRAME::MESSAGEHANDLER
- IMAGEFRAME::PIXEL_TO_VALUE
- IMAGEFRAME::POINT_INSIDE
- IMAGEFRAME::SETPROPERTY
- IMAGEFRAME::SHOW
- IMAGESTACK::CLEANUP
- IMAGESTACK::DRAW
- IMAGESTACK::GETFRAME
- IMAGESTACK::GETPROPERTY
- IMAGESTACK::INIT
- IMAGESTACK::SETPROPERTY
- IMAGESTACK__DEFINE
- SCALEIMAGE::CLEANUP
- SCALEIMAGE::CONTROLPANEL
- SCALEIMAGE::CREATEDISPLAYIMAGE
- SCALEIMAGE::EVENT_HANDLER
- SCALEIMAGE::GETPROPERTY
- SCALEIMAGE::INIT
- SCALEIMAGE::SCALETHEIMAGE
- SCALEIMAGE::SETPROPERTY
- SCALEIMAGE__DEFINE

# Routine Descriptions

## CATDATAATOM

[Next Routine] [List of Routines]

     NAME:
           CATDATAATOM

     PURPOSE:

           This is the most basic data object in the CATALYST Object Library. It is a subclassed
           CATATOM object and implements a generic data class in the IDL object hierarchy.
           All data objects in the heirarchy are subclassed from this object. The fundamental
           principal of the Catalyst Library is that data is associated with colors (for display)
           and a coordinate system (for interaction). Thus, there are placeholders in CATDATAATOM
           for a COLORTOOL and a CATCOORD object (or their equivalents). (There is also a placeholder
           for tools that work on the data, but this has been less frequently employed.)

     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

     SUPERCLASSES:

           CATATOM
           CATCONTAINER
           IDL_CONTAINER

     SYNTAX:

           dataObject = Obj_New('CATDATA')

     CLASS_DEFINITION:

       class   = { CATDATAATOM,           $   ; The CATDATAATOM class name.
                  _dataPtr   : PTR_NEW(), $   ; A pointer to the data
                  _coords    : OBJ_NEW(), $   ; A CATCOORD object of some type.
                  _colors    : OBJ_NEW(), $   ; A COLORTOOL object for setting up color tables.
                  _toolList  : OBJ_NEW(), $   ; The TOOLLIST object.
                  INHERITS CATATOM        $   ; CATDATA is an CATATOM object.
                 }

     MODIFICATION_HISTORY:

           Written by: David Burridge, 27th March 2003.

(See C:\IDL\Catalyst\source\data\catdataatom__define.pro)

## CATDATAATOM::ADDTOOL

[Previous Routine] [Next Routine] [List of Routines]

     NAME:
           CATDATAATOM::AddTool

     PURPOSE:

           This method adds an object (presumably a tool object) to the ToolList for this object.

     SYNTAX:

           self -> AddTool, object

     ARGUMENTS:

           OBJECT: The object to be added.

     KEYWORDS:

           None.

(See C:\IDL\Catalyst\source\data\catdataatom__define.pro)

## CATDATAATOM::APPLYCOLORS

[Previous Routine] [Next Routine] [List of Routines]

     NAME:
           CATDATAATOM::APPLYCOLORS

     PURPOSE:

           This method sets up the colors for the data object if they exist. For this
           reason, sub-classes *MUST* call this method at the *START* of their draw methods.

     SYNTAX:

           self -> ApplyColors

     ARGUMENTS:

           None.

     KEYWORDS:

          None.

(See C:\IDL\Catalyst\source\data\catdataatom__define.pro)

## CATDATAATOM::APPLYCOORDS

[Previous Routine] [Next Routine] [List of Routines]

     NAME:
           CATDATAATOM::APPLYCOORDS

     PURPOSE:

           This method sets up the coordinates for the data object if they exist. For this
           reason, sub-classes *MUST* call this method at the *START* of their draw methods.

     SYNTAX:

           self -> ApplyCoords

     ARGUMENTS:

           None.

     KEYWORDS:

          None.

(See C:\IDL\Catalyst\source\data\catdataatom__define.pro)

## CATDATAATOM::CLEANUP

[Previous Routine] [Next Routine] [List of Routines]

     NAME:
           CATDATAATOM::CLEANUP

     PURPOSE:

           This is the CATDATAATOM object class destructor method.

     SYNTAX:

           Called automatically when the object is destroyed thus:

               OBJ_DESTROY, dataObject

     ARGUMENTS:

           None.

     KEYWORDS:

           _EXTRA:  Any keyword appropriate for the CATATOM::CLEANUP method.

(See C:\IDL\Catalyst\source\data\catdataatom__define.pro)

## CATDATAATOM::GETDATA

[Previous Routine] [Next Routine] [List of Routines]

     NAME:
           CATDATAATOM::GetData

     PURPOSE:

           This function method enables data to be retreived from this object. It is written
           for internal use and should not be called without due consideration. All data
           handling should be done inside the object.

     SYNTAX:

           data = imageObject -> GetData (Success=s)

     ARGUMENTS:

           None.

     KEYWORDS:

           SUCCESS: This flag shows whether the get has been successful or not.

(See C:\IDL\Catalyst\source\data\catdataatom__define.pro)

## CATDATAATOM::GETPROPERTY

[Previous Routine] [Next Routine] [List of Routines]

     NAME:
           CATDATAATOM::GETPROPERTY

     PURPOSE:

           This method is used to get the object's properties.

     SYNTAX:

           dataObject -> GetProperty, Data=data

     ARGUMENTS:

           None.

     KEYWORDS:

           COLOR_OBJECT: Use this keyword to get the contained COLORTOOL object.

           COORD_OBJECT: Use this keyword to get the contained CATCOORD object.

           TOOLLIST:     The object's toolist object.

           UNDO_LIMIT:   The current undo limit for the data object.

           _REF_EXTRA:   Any keyword appropriate for the GETPROPERTY method of the superclass object.

(See C:\IDL\Catalyst\source\data\catdataatom__define.pro)

## CATDATAATOM::INIT

[Previous Routine] [Next Routine] [List of Routines]

     NAME:
           CATDATAATOM::INIT

     PURPOSE:

           This method is used upon object creation.

     SYNTAX:

           Called automatically when the object is created thus:

               dataObject = OBJ_NEW (CatDataAtom, Hanning (50,50))

     ARGUMENTS:

           DATA: Some data to use in the object (optional).

     KEYWORDS:

           COLOR_OBJECT: Use this keyword to load a color object for setting up colors
                         for data display.

           COORD_OBJECT: Use this keyword to load a coordinate object for setting up
                         the data coordinate system for data display.

           NO_COPY:      Set this keyword to "move" supplied data into the object rather than
                         make a copy. Note that this will leave the input "data" variable
                         undefined.

           PARENT:       The object reference to the parent of this object.

           UNDO_LIMIT:   The number of tools kept in the undo buffer. This is set to 5 by default.

           _EXTRA:       Any keyword appropriate for the INIT method of the superclass object.

(See C:\IDL\Catalyst\source\data\catdataatom__define.pro)

## CATDATAATOM::REDO

[Previous Routine] [Next Routine] [List of Routines]

     NAME:
           CATDATAATOM::REDO

     PURPOSE:

           This method allows a previous UNDO to be reversed.

     SYNTAX:

               dataObject -> REDO

     ARGUMENTS:

           None.

     KEYWORDS:

           Draw: Set this keyword to allow the object to DRAW itself at the completion of the REDO.

(See C:\IDL\Catalyst\source\data\catdataatom__define.pro)

## CATDATAATOM::SETDATA

[Previous Routine] [Next Routine] [List of Routines]

     NAME:
           CATDATAATOM::SetData

     PURPOSE:

           This method enables new data to be added to this object.

     SYNTAX:

           imageObject -> SetData, Dist(40,40), /Draw

     ARGUMENTS:

           DATA: The data to be added. Note that any existing data will be removed, so this
                 routine should be used with caution!

     KEYWORDS:

           DRAW:    Set this keyword makes the object DRAW itself once the data is loaded.

           NO_COPY: Set this keyword to "move" supplied data into the object rather than
                    make a copy. Note that this will leave the input "data" variable
                    undefined.

(See C:\IDL\Catalyst\source\data\catdataatom__define.pro)

## CATDATAATOM::SETPROPERTY

[Previous Routine] [Next Routine] [List of Routines]

     NAME:
           CATDATAATOM::SETPROPERTY

     PURPOSE:

           This method is used to get the object's properties.

     SYNTAX:

           dataObject -> SetProperty, Data=data

     ARGUMENTS:

           None.

     KEYWORDS:

           COLOR_OBJECT: Use this keyword to load a color object for setting up colors
                         for data display.

           COORD_OBJECT: Use this keyword to load a coordinate object for setting up
                         the data coordinate system for data display.

           DRAW:         Set this keyword makes the object DRAW itself once the data is loaded.

           UNDO_LIMIT:   The number of tools kept in the undo buffer.

           _EXTRA:       Any keyword appropriate for the SETPROPERTY method of the superclass object.

(See C:\IDL\Catalyst\source\data\catdataatom__define.pro)

## CATDATAATOM::UNDO

[Previous Routine] [Next Routine] [List of Routines]

     NAME:
           CATDATAATOM::UNDO

     PURPOSE:

           This method performs a one-step "undo" of the object on the UNDO LIST.

     SYNTAX:

               dataObject -> UNDO

     ARGUMENTS:

           None.

     KEYWORDS:

           DRAW:   Set this keyword to immediately call the draw method of the object
                   when the UNDO is finished.

           _Extra: Extra keywords appropriate for toollist UNDO method.

(See C:\IDL\Catalyst\source\data\catdataatom__define.pro)

## CATIMAGE

[Previous Routine] [Next Routine] [List of Routines]

     NAME:
           CatImage

     PURPOSE:

           This object implements a class for handling image data. It is a subclassed
           CATDATAATOM object and can be subclassed for specific image implementations.

           Out first attempts to define an image object class resulted in the three
           object classes CatImageData, CatImage2D, and CatTrueColorImage. These are
           still used in Catalyst applications, but are included more for historical
           reasons than for practical reasons. These days all image object implementations
           start with CatImage (or, more likely, with ScaleImage, which is subclassed from
           CatImage). It is our recommendation that you start your own object implementation
           from this CatImage object.

     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

     SUPERCLASSES:

           CATDATAATOM
           CATATOM
           CATCONTAINER
           IDL_CONTAINER

     SYNTAX:

           imageObject = OBJ_NEW ('CatImage', image)

     CLASS DEFINITION:

        class = { CatImage, $                      ; The CatImage object class.
                  _displayImage: Ptr_New(), $      ; The byte-scaled, congridded image for display.
                  _display_mode: 0B, $             ; A flag indicating which display method to use for drawing.
                  _keep_aspect: 0L, $              ; Flag: Keep the aspect ratio when calculating image position.
                  _location   : DblArr(6,2), $     ; Location information about the "displayed" image.
                  _interleaving : 0L, $            ; The type of pixel interleaving for this image.
                  _interpolate: 0L, $              ; Flag: When set, bilinear interpolation is used.
                  _order      : 0L, $              ; Image display order.
                  _out_xsize  : 0L, $              ; The output X size of the image. (Display_Mode=1 and Display_Mode=2)
                  _out_ysize  : 0L, $              ; The output Y size of the image. (Display_Mode=1 and Display_Mode=2)
                  _position   : DblArr(4), $       ; The position of the image in the output window. (Display_Mode=0)
                  _scale      : 0.0, $             ; The zoom scale factor.
                  _x1          : 0L, $             ; The starting X coordinate in the zoom.
                  _x2          : 0L, $             ; The ending X coordinate in the zoom.
                  _y1          : 0L, $             ; The starting Y coordinate in the zoom.
                  _y2          : 0L, $             ; The ending Y coordinate in the zoom.
                  _xsize      : 0L, $              ; The X size of the image.
                  _xstart     : 0L, $              ; The starting X location for displaying image. (Display_Mode=1)
                  _ysize      : 0L, $              ; The Y size of the image.
                  _ystart     : 0L, $              ; The starting Y location for displaying image. (Display_Mode=1)
                  _wid        : Obj_New(), $       ; The window object where this image should be displayed.
                  _window_position: 0L, $          ; The window position for displaying this image. (Display_Mode=2)
                  _zoomcoords  : Obj_New(), $      ; A coordinate object for the zoom capability.
                  INHERITS CatDataAtom $           ; Subclassed from CATDATAATOM.
                }

     MODIFICATION_HISTORY:

           Written by: David W. Fanning, 27 March 2003.
           Added PAN, ZOOMIN, and ZOOMOUT methods 25 June 2004. DWF.
           Removed MINUS_ONE keywords from the CONGRIDs in CreateDisplayImage.
             They caused me to get, for example, 15 colors instead of 16 when I
             restricted the number of colors in the image. 5 July 2005. DWF.
           Fixed a bug in Pixel_To_Value method that caused value to be slightly off.
              This was most noticable with really small images. 10 Oct 2008. DWF.

(See C:\IDL\Catalyst\source\data\catimage__define.pro)

## CATIMAGE2D

[Previous Routine] [Next Routine] [List of Routines]

     NAME:
           CATIMAGE2D

     PURPOSE:

           This object implements a class for handling 2D image data. It is a subclassed
           ImageData object and can be subclassed for specific image implementations.
           This object was an early attempt at creating an image object for the Catalyst
           Library, and has been depreciated it favor of CatImage. It is left in the Library
           for historical reasons and because there are Catalyst applications that use it.

     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

     SUPERCLASSES:

           CATIMAGEDATA
           CATDATAATOM
           CATATOM
           CATCONTAINER
           IDL_CONTAINER

     SYNTAX:

           imageObject = OBJ_NEW ('CATIMAGE2D', image)

     CLASS_DEFINITION:

        class = { CATIMAGE2D, $                     ; The CATIMAGE2D object class.
                  INHERITS CatImageData, $          ; Inherits the CatImageData object class. MUST be inherited first.
                  _smooth_width: 0L, $              ; The width value for the SMOOTH operation.
                  _median_width: 0L $               ; The width value for the MEDIAN operation.
                }

     MODIFICATION_HISTORY:

           Written by: David Fanning, 27 March 2003.

(See C:\IDL\Catalyst\source\data\catimage2d__define.pro)

## CATIMAGE2D::CONTROLPANEL

[Previous Routine] [Next Routine] [List of Routines]

     NAME:
           CATIMAGE2D::CONTROLPANEL

     PURPOSE:

           This method creates a control panel for the object

     SYNTAX:

           imageObject -> ControlPanel, baseObj

     ARGUMENTS:

           baseObject:    The object reference of a base widget for this control to
                          be added to. If not supplied, the control panel will be a
                          self contained window.

     KEYWORDS:

           _EXTRA:       Any keywords appropriate for the "CONTROLPANEL::INIT" method.

(See C:\IDL\Catalyst\source\data\catimage2d__define.pro)

## CATIMAGE2D::EVENTHANDLER

[Previous Routine] [Next Routine] [List of Routines]

     NAME:
           CATIMAGE2D::EVENTHANDLER

     PURPOSE:

           This method is an event handler for the Control Panel.

     SYNTAX:

           Called automatically by the event handling system

     ARGUMENTS:

           event:  The event structure.

     KEYWORDS:

           None.

(See C:\IDL\Catalyst\source\data\catimage2d__define.pro)

## CATIMAGE2D::GETPROPERTY

[Previous Routine] [Next Routine] [List of Routines]

     NAME:
           CATIMAGE2D::GETPROPERTY

     PURPOSE:

           This method allows the user to obtain CATIMAGE2D properties.
     SYNTAX:

           theObject -> GetProperty ...

     ARGUMENTS:

         None.

     KEYWORDS:

         MEDIAN_WIDTH: The size of the two-dimensional neighborhood to use with the MEDIAN function.

         SMOOTH_WIDTH: The size of the two-dimensional neighborhood to use with the SMOOTH function.

         __REF_EXTRA:  Any keyword appropriate for the SETPROPERTY method of the superclass object.

(See C:\IDL\Catalyst\source\data\catimage2d__define.pro)

## CATIMAGE2D::INIT

[Previous Routine] [Next Routine] [List of Routines]

     NAME:
           CATIMAGE2D::INIT

     PURPOSE:

           This method is used upon object creation.

     SYNTAX:

           Called automatically when the object is created thus:

               imageObject = OBJ_NEW ('CatImage2D', image)

     ARGUMENTS:

           image           The 2D image array of any data type.

     KEYWORDS:

         MEDIAN_WIDTH:     The size of the two-dimensional neighborhood to use with the MEDIAN function.

         SMOOTH_WIDTH:     The size of the two-dimensional neighborhood to use with the SMOOTH function.

         _EXTRA:           Any keyword appropriate for the INIT method of the superclass object or for
                           the LoadImage method.

(See C:\IDL\Catalyst\source\data\catimage2d__define.pro)

## CATIMAGE2D::LOADIMAGE

[Previous Routine] [Next Routine] [List of Routines]

     NAME:
           CATIMAGE2D::LOADIMAGE

     PURPOSE:

           This method is used to load images into the object.

     SYNTAX:

           imageObject -> LOADIMAGE

     ARGUMENTS:

           None.

     INPUT_KEYWORDS:

           _EXTRA:        Any keyword appropriate for the ImageData::LOADIMAGE method.

     OUTPUT_KEYWORDS:

           CANCEL:        This keyword is set to 1 if the user exits the program in any way except
                          hitting the ACCEPT button. The ACCEPT button will set this keyword to 0.

           FILEINFO:      This keyword returns information about the selected file. Obtained from the QUERY_**** functions.

           OUTDIRECTORY:  The directory where the selected file is found.

           OUTFILENAME:   The short filename of the selected file.

(See C:\IDL\Catalyst\source\data\catimage2d__define.pro)

## CATIMAGE2D::PIXEL_TO_VALUE

[Previous Routine] [Next Routine] [List of Routines]

     NAME:
           CATIMAGE2D::PIXEL_TO_VALUE

     PURPOSE:

           This method calculates the original image value underneath a pixel location
           in the display window. To be accurate, the window that contains the image
           MUST BE the current graphics window or you MUST PASS the window number in
           with the WINDOWINDEX keyword. This is NOT nessarily the value of the image
           in the display window. It is the original image value.

     SYNTAX:

           image_value = imageObject -> Pixel_to_Value(x, y)

     RETURN_VALUE:

           image_value:   The image value at image[x,y]

     ARGUMENTS:

           X:             The x location in the display window (pixel coordinates).

           Y:             The y location in the display window (pixel coordinates).

     INPUT_KEYWORDS:

           OUTSIDE:       The value to represent "outside" the image. Default is !Values.F_NAN.

     OUTPUT_KEYWORDS:

           DISPLAY_VALUE: Set this keyword to a named variable that will contain the value
                          of the display image, rather than the original image.

           INSIDE:        Returns a 1 if the (x,y) values are inside the image and 0 otherwise.

           WINDOWINDEX:   The window index number of the window containing the image object. Set
                          to !D.Window by default.

           XDATA:         The x data value with respect to the image data coordinate system,

           XPIXEL:        The x pixel value in terms of image (rather than window) device coordinates.

           YDATA:         The y data value with respect to the image data coordinate system,

           YPIXEL:        The y pixel value in terms of image (rather than window) device coordinates.

(See C:\IDL\Catalyst\source\data\catimage2d__define.pro)

## CATIMAGE2D::SETPROPERTY

[Previous Routine] [Next Routine] [List of Routines]

     NAME:
           CATIMAGE2D::SETPROPERTY

     PURPOSE:

           This method is used to set properties of the CATIMAGE2D object

     SYNTAX:

           imageObject -> SETPROPERTY, Image=newImage

     ARGUMENTS:

           None.

     KEYWORDS:

         IMAGE:   A 2D image array to load into the object.

         MEDIAN_WIDTH: The size of the two-dimensional neighborhood to use with the MEDIAN function.

         SMOOTH_WIDTH: The size of the two-dimensional neighborhood to use with the SMOOTH function.

         _EXTRA:  Any keyword appropriate for the SETPROPERTY method of the superclass object.

(See C:\IDL\Catalyst\source\data\catimage2d__define.pro)

## CATIMAGE::CLEANUP

[Previous Routine] [Next Routine] [List of Routines]

     NAME:
           CatImage::CLEANUP

     PURPOSE:

           This is the CatImage object class destructor method.

     SYNTAX:

           Called automatically when the object is destroyed thus:

               OBJ_DESTROY, imageObject

     ARGUMENTS:

           None.

     KEYWORDS:

           _EXTRA:  Any keyword appropriate for the DATAATOM::CLEANUP method.

(See C:\IDL\Catalyst\source\data\catimage__define.pro)

## CATIMAGE::CONTROLPANEL

[Previous Routine] [Next Routine] [List of Routines]

     NAME:
           CatImage::CONTROLPANEL

     PURPOSE:

           This method creates a control panel for the CATIMAGE object. A
           control panel is a graphical user interface for setting object
           properties. If you create a control panel, the events are typically
           sent to the EVENTHANDLER method.

     SYNTAX:

           theObject -> ControlPanel, baseObject

     ARGUMENTS:

           baseObject:    The object reference of a base widget for this control to
                          be added to. If not supplied, the control panel will be in a
                          self contained window (i.e., a TOPLEVELBASE object).

     KEYWORDS:

           _EXTRA:       Any keywords appropriate for the CatControlPanel::INIT method.

(See C:\IDL\Catalyst\source\data\catimage__define.pro)

## CATIMAGE::COPYPARAMETERS

[Previous Routine] [Next Routine] [List of Routines]

     NAME:
           CatImage::COPYPARAMETERS

     PURPOSE:

           This method returns the lower-left corner of the bounary box
           in the DESTINATION keyword, and the number of columns and rows
           in the boundary box in the EXTENT keyword, all in window or pixel
           coordinates. It's purpose is to return a section of a pixmap, for
           example, so that only that section can be copied.

     SYNTAX:

           theObject -> CopyParameters, drawid, DESTINATION=destination, EXTENT=extent

     ARGUMENTS:

           drawID:         The identifier of a draw widget object whose extent will
                           provide the size of the window for calculating device coordinates.
                           This parameter is required.

     KEYWORDS:

           DESTINATION:    A two-element array containing the lower-left corner
                           of the boundary box in device coordinates. An output keyword.

           EXTENT:         A two-element array containing the number of columns and
                           rows in the boundary box in device coordinates. An output keyword.

(See C:\IDL\Catalyst\source\data\catimage__define.pro)

## CATIMAGE::CREATEDISPLAYIMAGE

[Previous Routine] [Next Routine] [List of Routines]

     NAME:
           CatImage::CREATEDISPLAYIMAGE

     PURPOSE:

           This method creates a display image for the object

     SYNTAX:

           imageObject -> CreateDisplayImage

     ARGUMENTS:

           None.

     KEYWORDS:

           None.

(See C:\IDL\Catalyst\source\data\catimage__define.pro)

## CATIMAGE::DRAW

[Previous Routine] [Next Routine] [List of Routines]

     NAME:
           CatImage::DRAW

     PURPOSE:

           This method draws the image to the display based on the current DISPLAY_MODE
           in effect for the widget.

     SYNTAX:

           imageObject -> Draw

     ARGUMENTS:

           None.

     KEYWORDS:

           None.

(See C:\IDL\Catalyst\source\data\catimage__define.pro)

## CATIMAGE::DRAW_MODE_0

[Previous Routine] [Next Routine] [List of Routines]

     NAME:
           CatImage::DRAW_MODE_0

     PURPOSE:

           This display mode position's the image in the display window based
           on the POSITION of the image.

     SYNTAX:

           imageObject -> Draw_Mode_0

     ARGUMENTS:

           None.

     KEYWORDS:

           None.

(See C:\IDL\Catalyst\source\data\catimage__define.pro)

## CATIMAGE::DRAW_MODE_1

[Previous Routine] [Next Routine] [List of Routines]

     NAME:
           CatImage::DRAW_MODE_1

     PURPOSE:

           This display mode position's the image in the display window based
           on the lower-left corner of the image.

     SYNTAX:

           imageObject -> Draw_Mode_1

     ARGUMENTS:

           None.

     KEYWORDS:

           None.

(See C:\IDL\Catalyst\source\data\catimage__define.pro)

## CATIMAGE::DRAW_MODE_2

[Previous Routine] [Next Routine] [List of Routines]

     NAME:
           CatImage::DRAW_MODE_2

     PURPOSE:

           This display mode position's the image in the display window based
           on a window position parameter.

     SYNTAX:

           imageObject -> Draw_Mode_2

     ARGUMENTS:

           None.

     KEYWORDS:

           None.

(See C:\IDL\Catalyst\source\data\catimage__define.pro)

## CATIMAGE::EVENT_HANDLER

[Previous Routine] [Next Routine] [List of Routines]

     NAME:
            CatImage::EVENT_HANDLER

     PURPOSE:

            This method is the event handler for the CATIMAGE object. It will typically
            be used to respond to events from widget objects created in the CONTROLPANEL
            method.

     SYNTAX:

            This method is called automatically by the event handling mechanism.

     ARGUMENTS:

           event: The event structure as described in the IDL help files, except
                  that the ID, TOP and HANDLER tags will be object references.

     KEYWORDS:

           None.

(See C:\IDL\Catalyst\source\data\catimage__define.pro)

## CATIMAGE::GETPROPERTY

[Previous Routine] [Next Routine] [List of Routines]

     NAME:
           CatImage::GETPROPERTY

     PURPOSE:

           This method is used to get properties of the CatImage object

     SYNTAX:

           imageObject -> GETPROPERTY, XSIZE=xsize, YSIZE=ysize

     ARGUMENTS:

           None.

     KEYWORDS:

           ASPECT_RATIO:     The aspect ratio of the image: ysize/xsize.

           AXES:             The image axes object for this image. If not available, a null object.

           DIMENSIONS:       The dimensions of the image (e.g, Size(image, /DIMENSIONS).

           IMAGE:            The image data.

           KEEP_ASPECT:      The keep aspect ratio flag.

           LOCATION:         A 6-by-2 floating array containing information about the position of the
                             "displayed" image, which is updated after every image DRAW. The first two
                             elements (location[0:1,0] contain the X and Y positions of the
                             lower-left corner of the image (device units), the next two elements
                             (location[2:3,0]) the X and Y positions of the upper-right corner of the
                             image (device units)), and the last two elements contain the X and Y size of
                             the display window (device units). The location[*,1] elements are
                             exactly the same as the location[*,0] elements, except they are
                             expressed in normalized (0 to 1) coordinates.

           MINMAX:           A two-element array giving the minimum and maximum value of the orginal image data.

           N_DIMENSIONS:     The number of dimensions of the image (e.g, Size(image, /N_DIMENSIONS).

           NOINTERPOLATE:    The nointerpolate flag.

           ORDER:            The display order of the image.

           OUT_XSIZE:        The X size of the image on the display.

           OUT_YSIZE:        The Y size of the image on the display.

           POSITION:         A four-element vector giving the position of the image in the
                             display window in normalized coordinates: [x0, y0, x1, y1].

           SELECTABLE:       Set to 1 if the image is selectable.

           TRUEINDEX:        Set the the index of the "3" in a true-color image, or to -1 otherwise.

           XSIZE:            The X size of the image.

           XSTART:           The X location (in pixels) of the lower-left corner of the image. Used only
                             in DISPLAY_MODE=1.

           YSIZE:            The Y size of the image.

           YSTART:           The Y location (in pixels) of the lower-left corner of the image. Used only
                             in DISPLAY_MODE=1.

           VISIBLE:          Set to 1 if the image is visible.

           WID:              The window object where this image will be displayed.

           WINDOW_POSITION:  A single number that gives a "window position" for displaying the image.
                             The same as calling the TV command with a single positional parameter other
                             than the image.

           ZOOM_COORD:       The zoom coordinate system.

           ZOOMRECT:         The coordinates of the zoom rectangle in the image in the form [x1, y1, x2, y2].
                             The coordinates are in the image pixel coordinate system (e.g., 0 to self._xsize-1).

           _REF_EXTRA:       Any keyword appropriate for the DATAATOM::GETPROPERTY method.

(See C:\IDL\Catalyst\source\data\catimage__define.pro)

## CATIMAGE::INIT

[Previous Routine] [Next Routine] [List of Routines]

     NAME:
           CatImage::INIT

     PURPOSE:

           This method is used upon object creation.

     SYNTAX:

           Called automatically when the object is created thus:

               imageObject = OBJ_NEW ('CatImage', image)

     ARGUMENTS:

           image           The image array of any data type.

     KEYWORDS:

         AXES:             Set this keyword to add axes to the image display. Or, set this
                           keyword to an axis object.

         DISPLAY_MODE:     Images can be displayed in any of three display "modes". Display Mode 0 is
                           the default and allows images to be positioned in the window using the
                           POSITION keyword. Display Mode 1 is the standard "TV" display mode in which
                           the image is positioned with respect to its lower-left corner in the
                           display window. Display Mode 2 is the standard "TV" display mode in which
                           the image is positioned in the window according to the WINDOW_POSITION.

                           PAN and ZOOM capability is only available when in DISPLAY_MODE=0.

         NOINTERPOLATE:    If the image is resized to fit the window, this keyword, if set, will
                           cause nearest neighbor interpolation of image values to be used. The
                           default is to use  bilinear interpolation. Applies only to DISPLAY_MODE=0.

         KEEP_ASPECT:      If this keyword is set, the POSITION of the image in the window
                           is always adjusted to preserve the image aspect ratio (ratio of height
                           divided by width). Otherwise, the image is resized arbitrarily. Applies
                           only to DISPLAY_MODE=0.

         NO_COPY:          If this keyword is set, the image data is transfered directly to the object
                           and not copied. The image parameter will become undefined if this keyword is set.

         ORDER:            The display order of the image. We seriously recommend that you NOT use this
                           keyword!! Instead, use REVERSE to change the Y values of your image:
                                image = Reverse(image,1)

         POSITION:         The position of the image in the display window. The position is given
                           as a four-element array in normalized (0 to 1) coordinates of the form
                           [x0, y0, x1, y1], where (x0,y0) is the lower-left corner of the image and
                           (x1,y1) is the upper-right corner of the image. If the KEEP_ASPECT keyword
                           is set, the image will be located within the specified POSITION in a way
                           that preserves the aspect ratio of the image. For the image's exact location
                           in the window after it has been displayed, use the LOCATION keyword to the
                           GetProperty method.

         SELECTABLE:       Set this keyword to make the image selectable.

         XSIZE:            The desired X size of the image upon output. This is used only for DISPLAY_MODE=1
                           and DISPLAY_MODE=2.

         XSTART:           The X location (in pixels) of the lower-left corner of the image. Used only
                           in DISPLAY_MODE=1.

         YSIZE:            The desired Y size of the image upon output. This is used only for DISPLAY_MODE=1
                           and DISPLAY_MODE=2.

         YSTART:           The Y location (in pixels) of the lower-left corner of the image. Used only
                           in DISPLAY_MODE=1.

         WID:              The window object where this image is to be displayed. Use this with some trepidation,
                           because having an image wedded to a particular window can cause difficulties for
                           pixmaps and interaction objects. Better to write code so that the image does not
                           know where it is drawn. Still, it is sometimes useful to have this functionality.

         WINDOW_POSITION:  A single number that gives a "window position" for displaying the image.
                           The same as calling the TV command with a single positional parameter other
                           than the image.

         _EXTRA:           Any keyword appropriate for the INIT method of the superclass object.

(See C:\IDL\Catalyst\source\data\catimage__define.pro)

## CATIMAGE::MESSAGEHANDLER

[Previous Routine] [Next Routine] [List of Routines]

     NAME:
           CatImage::MESSAGEHANDLER

     PURPOSE:

           This method responds to "messages" sent from other objects. It is called
           automatically by other objects. To receive messages, it is necessary to
           "register" with the messaging object.

     SYNTAX:

           None. Called by other objects.

     ARGUMENTS:

           TITLE:  The message title. This is the "name" of the message indicated when
                   the object registered for messages with the messaging object.

     KEYWORDS:

           DATA:   Information from the SENDER that may be relevant in processing the message.
                   Typically, an anonymous structure variable, although it could be anything at all.

           SENDER: An output keyword. This is the object reference of the object that is sending
                   the message.

(See C:\IDL\Catalyst\source\data\catimage__define.pro)

## CATIMAGE::MOVE

[Previous Routine] [Next Routine] [List of Routines]

     NAME:
           CatImage::MOVE

     PURPOSE:

           This method moves the image in a graphics window.

     SYNTAX:

           theObject -> Move, x, y

     ARGUMENTS:

           X:          The number of pixels to move in the X direction.

           Y:          The number of pixels to move in the Y direction.

     KEYWORDS:

           NODRAW:     If this keyword is set, only the coordinates are updated. No drawing occurs.

           PIXMAP:     Set this keyword to a pixmap that can be used to erase the previous
                       contents of the window.

(See C:\IDL\Catalyst\source\data\catimage__define.pro)

## CATIMAGE::PAN

[Previous Routine] [Next Routine] [List of Routines]

     NAME:
           CatImage::PAN

     PURPOSE:

           This method pans the image.

     SYNTAX:

           theImage -> Pan, movex, movey

     ARGUMENTS:

           movex:  The number of (window) pixels to move in the X direction.

           movey:  The number of (window) pixels to move in the Y direction.

     KEYWORDS:

           None.

(See C:\IDL\Catalyst\source\data\catimage__define.pro)

## CATIMAGE::PIXEL_TO_VALUE

[Previous Routine] [Next Routine] [List of Routines]

     NAME:
           CatImage::PIXEL_TO_VALUE

     PURPOSE:

           This method calculates the original image value underneath a pixel location
           in the display window. To be accurate, the window that contains the image
           MUST BE the current graphics window. To be certain of this, use the WID
           keyword in the INIT or SetProperty methods to associate an image with its
           display window.

     SYNTAX:

           image_value = imageObject -> Pixel_to_Value(x, y)

     RETURN_VALUE:

           image_value:   The image value at image[x,y]. For 2D images, a single value. For
                          true-color images a three-element array representing the RGB values
                          at that image pixel.

     ARGUMENTS:

           X:             The x location in the display window (pixel coordinates).

           Y:             The y location in the display window (pixel coordinates).

     OUTPUT_KEYWORDS:

           INSIDE:        Returns a 1 if the (x,y) values are inside the image and 0 otherwise. No values
                          are returned in other keywords if the point is not inside the image.

           XDATA:         The x data value with respect to the image data coordinate system,

           XPIXEL:        The x pixel value in terms of image (rather than window) device coordinates.

           YDATA:         The y data value with respect to the image data coordinate system,

           YPIXEL:        The y pixel value in terms of image (rather than window) device coordinates.

(See C:\IDL\Catalyst\source\data\catimage__define.pro)

## CATIMAGE::POINT_INSIDE

[Previous Routine] [Next Routine] [List of Routines]

     NAME:
           CatImage::POINT_INSIDE

     PURPOSE:

           This method returns a 1 if the specified point is inside the image, and a 0
           if the specified point is outside the image.

     SYNTAX:

           is_inside = imageObject -> Point_Inside(x, y)

     ARGUMENTS:

           x:      The X value of the point in window or pixel coordinates.

           y:      The Y value of the point in window or pixel coordinates.

     KEYWORDS:

           None

(See C:\IDL\Catalyst\source\data\catimage__define.pro)

## CATIMAGE::SELECT

[Previous Routine] [Next Routine] [List of Routines]

     NAME:
           CatImage::SELECT

     PURPOSE:

           This method returns the object reference if the requested point is inside
           the image

     SYNTAX:

           selectedObject = theObject -> Select, x, y

     ARGUMENTS:

           X:   The X location of a point in device or window coordinates.

           Y:   The Y location of a point in device or window coordinates.

     KEYWORDS:

           SUCCESS:   Set to 1 if a selection is made. To 0 otherwise.

(See C:\IDL\Catalyst\source\data\catimage__define.pro)

## CATIMAGE::SELECTPANEL

[Previous Routine] [Next Routine] [List of Routines]

     NAME:
           CatImage::SELECTPANEL

     PURPOSE:

           Similar to a Control Panel, it gives context menu access to properties
           of selectable objects.

     SYNTAX:

           selectedObject = theObject -> SelectPanel, x, y, drawID

     ARGUMENTS:

           X:       The X location of a point in device or window coordinates.

           Y:       The Y location of a point in device or window coordinates.

           DRAWID:  The identifer of the draw widget object in which the selection is taking place.

     KEYWORDS:

           None:

(See C:\IDL\Catalyst\source\data\catimage__define.pro)

## CATIMAGE::SETPROPERTY

[Previous Routine] [Next Routine] [List of Routines]

     NAME:
           CatImage::SETPROPERTY

     PURPOSE:

           This method is used to set properties of the CatImage object

     SYNTAX:

           imageObject -> SETPROPERTY, XSIZE=xsize, YSIZE=ysize

     ARGUMENTS:

           None.

     KEYWORDS:

         AXES:             Set this keyword to add axes to the image display. Or, set this
                           keyword to an axes object that is added to the image.

         AXIS_PROPERTY:    Set this keyword to invoke the axes control panel (if there are axes)
                           in a separate window.

         BRING_TO_FRONT:   Set this keyword to move this selectable object to the front of all selectable objects.

         COLOR_OBJECT:     Use this keyword to load a COLORTOOL object for setting up colors
                           for data display. The image will automatically register for COLORTOOL_TABLECHANGE
                           messages.

         DISPLAY_MODE:     Images can be displayed in any of three display "modes". Display Mode 0 is
                           the default and allows images to be positioned in the window using the
                           POSITION keyword. Display Mode 1 is the standard "TV" display mode in which
                           the image is positioned with respect to its lower-left corner in the
                           display window. Display Mode 2 is the standard "TV" display mode in which
                           the image is positioned in the window according to the WINDOW_POSITION.

         DRAW:             Set this keyword to DRAW the image after it's properties have been set.

         IMAGE:            A image to load into the object.

         KEEP_ASPECT:      If this keyword is set, the POSITION of the image in the window
                           is always adjusted to preserve the image aspect ratio (ratio of height
                           divided by width). Otherwise, the image is resized arbitrarily. Applies
                           only to DISPLAY_MODE=0.

         MOVE_BACKWARD:    Set this keyword to move this selectable object to the back of all selectable objects.

         MOVE_FORWARD:     Set this keyword to move this selectable object to the front of all selectable objects.

         NO_COPY:          If this keyword is set, the image data is transfered directly to the object
                           and not copied. The image parameter will become undefined if this keyword is set.

         NOINTERPOLATE:    If the image is resized to fit the window, this keyword, if set, will
                           cause nearest neighbor interpolation of image values to be used. The
                           default is to use  bilinear interpolation. Applies only to DISPLAY_MODE=0.
                           Note: True-Color images *always* use bilinear interpolation no matter what
                           the value of this keyword.

         ORDER:            The display order of the image.

         POSITION:         The position of the image in the display window. The position is given
                           as a four-element array in normalized (0 to 1) coordinates of the form
                           [x0, y0, x1, y1], where (x0,y0) is the lower-left corner of the image and
                           (x1,y1) is the upper-right corner of the image. If the KEEP_ASPECT keyword
                           is set, the image will be located within the specified POSITION in a way
                           that preserves the aspect ratio of the image. For the image's exact location
                           in the window after it has been displayed, use the LOCATION keyword to the
                           GetProperty method.

         SELECTABLE:       Set this keyword to make the image selectable.

         SEND_TO_BACK:     Set this keyword to move this selectable object to the back of all selectable objects.

         XSIZE:            The desired X size of the image upon output. This is used only for DISPLAY_MODE=1
                           and DISPLAY_MODE=2.

         XSTART:           The X location (in pixels) of the lower-left corner of the image. Used only
                           in DISPLAY_MODE=1.

         YSIZE:            The desired Y size of the image upon output. This is used only for DISPLAY_MODE=1
                           and DISPLAY_MODE=2.

         YSTART:           The Y location (in pixels) of the lower-left corner of the image. Used only
                           in DISPLAY_MODE=1.

         VISIBLE:          Set this keyword to 1 to make the object visible.

         WID:              The window object where this image is to be displayed.

         WINDOW_POSITION:  A single number that gives a "window position" for displaying the image.
                           The same as calling the TV command with a single positional parameter other
                           than the image.

         ZOOMRECT:         The coordinates of the zoom rectangle in the image in the form [x1, y1, x2, y2].
                           The coordinates are in the image pixel coordinate system (e.g., 0 to self._xsize-1).

         _EXTRA:           Any keyword appropriate for the SETPROPERTY method of the superclass object.

(See C:\IDL\Catalyst\source\data\catimage__define.pro)

## CATIMAGE::SHOW

[Previous Routine] [Next Routine] [List of Routines]

     NAME:
           CatImage::SHOW

     PURPOSE:

           This method attempts to pull the draw widget containing the image forward on
           the display, if possible.

     SYNTAX:

               imageObject -> SHOW

     ARGUMENTS:

           None.

     KEYWORDS:

           None.

(See C:\IDL\Catalyst\source\data\catimage__define.pro)

## CATIMAGE::ZOOMIN

[Previous Routine] [Next Routine] [List of Routines]

     NAME:
           CatImage::ZOOMIN

     PURPOSE:

           This method allows the user to zoom into the image.

     SYNTAX:

           imageObject -> ZoomIn, x, y

     ARGUMENTS:

           x_img: The X focal point for zooming. If not provided, the center of the image.
                  The value will be a pixel value in the native image coordinate system.
                  That is to say, a value between 0 and the image X size. The value can
                  be obtained from an event structure by passing the event structure to
                  the method Pixel_To_Value:

                     imgVal = self -> Pixel_To_Value(event.x, event.y, XPixel=x_img, YPixel=y_img)
                     self -> ZoomIn, x_img, y_img

           y_img: The Y focal point for zooming. If not provided, the center of the image.
                  The value will be a pixel value in the native image coordinate system.
                  That is to say, a value between 0 and the image Y size.

     KEYWORDS:

           NODRAW: Normally the image is drawn as soon as it is resized. Setting this
                   keyword prevents the redraw.

(See C:\IDL\Catalyst\source\data\catimage__define.pro)

## CATIMAGE::ZOOMOUT

[Previous Routine] [Next Routine] [List of Routines]

     NAME:
           CatImage::ZOOMOUT

     PURPOSE:

           This method allows the user to zoom out of the image.

     SYNTAX:

           imageObject -> ZoomOut, x, y

     ARGUMENTS:

           None.

     KEYWORDS:

           ALLTHEWAY:  If this keyword is set, the image is zoomed all the way back to its starting value.

           NODRAW:     Normally the image is drawn as soon as it is resized. Setting this
                       keyword prevents the redraw.

(See C:\IDL\Catalyst\source\data\catimage__define.pro)

## CATIMAGEDATA

[Previous Routine] [Next Routine] [List of Routines]

     NAME:
           CatImageData

     PURPOSE:

           This object implements a class for handling image data. It is a subclassed
           CATDATAATOM object and can be subclassed for specific image implementations.
           This object was an early attempt at creating an image object for the Catalyst
           Library, and has been depreciated it favor of CatImage. It is left in the Library
           for historical reasons and because there are Catalyst applications that use it.

     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

     SUPERCLASSES:

           CATDATAATOM
           CATATOM
           CATCONTAINER
           IDL_CONTAINER

     SYNTAX:

           imageObject = OBJ_NEW ('CatImageData', image)

     MESSAGES:

        If a new image is loaded with the LOADIMAGE method, a CATIMAGE_NEWIMAGE message is sent to registered users.

     CLASS DEFINITION:

        class = { CatImageData, $                  ; The CatImageData object class.
                  _backgroundColor: "", $          ; The name of a background color to use when ERASING.
                  _bytsclmin  : 0.0D, $            ; The MIN value when byte scaling the data for display.
                  _bytsclmax  : 0.0D, $            ; The MAX value when byte scaling the data for display.
                  _directory  : "", $              ; The directory to look in for reading image files.
                  _erase      : 0L, $              ; Flag: Erase the window before displaying image.
                  _filename   : "", $              ; The name of the image file that has been read.
                  _interpolate: 0L, $              ; Flag: Interpolate when resizing. Nearest neighbor is default.
                  _keep_aspect: 0L, $              ; Flag: Keep the aspect ratio when calculating image position.
                  _location   : FltArr(6,2), $     ; Location information about the "displayed" image.
                  _original   : Ptr_New(), $       ; The original image data
                  _noresize   : 0L, $              ; Flag: No display resizing.
                  _position   : FltArr(4), $       ; The position of the image in the output window.
                  _wid        : 0L, $              ; The window this image should be drawn in.
                  _xsize      : 0L, $              ; The X size of the image.
                  _ysize      : 0L, $              ; The Y size of the image.
                  INHERITS CatDataAtom $           ; Subclassed from CATDATAATOM.
                }

     MODIFICATION_HISTORY:

           Written by: David Fanning, 27 March 2003.

(See C:\IDL\Catalyst\source\data\catimagedata__define.pro)

## CATIMAGEDATA::CLEANUP

[Previous Routine] [Next Routine] [List of Routines]

     NAME:
           CatImageData::CLEANUP

     PURPOSE:

           This is the CatImageData object class destructor method.

     SYNTAX:

           Called automatically when the object is destroyed thus:

               OBJ_DESTROY, imageObject

     ARGUMENTS:

           None.

     KEYWORDS:

           _EXTRA:  Any keyword appropriate for the DATAATOM::CLEANUP method.

(See C:\IDL\Catalyst\source\data\catimagedata__define.pro)

## CATIMAGEDATA::DRAW

[Previous Routine] [Next Routine] [List of Routines]

     NAME:
           CatImageData::DRAW

     PURPOSE:

           This method draws the image to the current window at the size
           specified by the xsize and ysize properties. These default to
           the image size. If either/both are zero nothing is drawn.

     SYNTAX:

           imageObject -> Draw

     ARGUMENTS:

           None.

     KEYWORDS:

           NOCOLORS:  Set this keyword if you just want to draw the image
                      without first loading the image color tables. This is
                      useful if you want to see the image with a temporary
                      color table.

           NOCOORDS:  Set this keyword to display the image without first
                      drawing the COORDINATE object.

           _EXTRA:    Any keyword appropriate for the DRAW method of the superclass objects.

(See C:\IDL\Catalyst\source\data\catimagedata__define.pro)

## CATIMAGEDATA::GETDATA

[Previous Routine] [Next Routine] [List of Routines]

     NAME:
           CatImageData::GetData

     PURPOSE:

           This function method enables data to be retreived from this object. It is written
           for internal use and should not be called without due consideration. All data
           handling should be done inside the object.

     SYNTAX:

           data = imageObject -> GetData (Success=s)

     ARGUMENTS:

           None.

     KEYWORDS:

           ORIGINAL: Set this keyword to obtain the original image data, rather than the display data.

           SUCCESS:  This flag shows whether the get has been successful or not.

(See C:\IDL\Catalyst\source\data\catimagedata__define.pro)

## CATIMAGEDATA::GETPROPERTY

[Previous Routine] [Next Routine] [List of Routines]

     NAME:
           CatImageData::GETPROPERTY

     PURPOSE:

           This method is used to get properties of the CatImageData object

     SYNTAX:

           imageObject -> GETPROPERTY, XSIZE=xsize, YSIZE=ysize

     ARGUMENTS:

           None.

     KEYWORDS:

           ASPECT_RATIO:     The ratio of ysize/xsize for the image.

           AXES:             The image axes object for this image. If not available, a null object.

           BYTSCLMAX:        The maximum value (MAX keyword) for byte scaling the image for display.

           BYTSCLMIN:        The minimum value (MIN keyword) for byte scaling the image for display.

           BACKGROUNDCOLOR:  The name of the background color.

           ERASE:            Erase flag.

           FILENAME:         The name of the image file.

           DIMENSIONS:       A two- or three-element array representing the dimensions of the image.

           DIRECTORY:        The starting location to search for images when reading image
                             files. This directory is updated to reflect the last directory
                             used when reading an image file.

           DISPLAY_IMAGE:    A copy of the display image.

           DISPLAY_RANGE:    The minimum and maximum value of the display image as a two-element array.

           IMAGE:            A copy of the original image.

           INTERPOLATE:      Interpolate flag.

           KEEP_ASPECT:      Keep aspect ratio flag.

           LOCATION:         A 6-by-2 floating array containing information about the position of the
                             "displayed" image, which is updated after every image DRAW. The first two
                             elements (location[0:1,0] contain the X and Y positions of the
                             lower-left corner of the image (device units), the next two elements
                             (location[2:3,0]) the X and Y positions of the upper-right corner of the
                             image (device units)), and the last two elements contain the X and Y size of
                             the display window (device units). The location[*,1] elements are
                             exactly the same as the location[*,0] elements, except they are
                             expressed in normalized (0 to 1) coordinates.

           NORESIZE:         No resize flag.

           POSITION:         A four-element vector giving the position of the image in the
                             display window in normalized coordinates: [x0, y0, x1, y1].

           RANGE:            The minimum and maximum value of the original image as a two-element array.

           TOOLDATA:         A copy of the image that is to be processed. (The same as DISPLAY_IMAGE.
                             This keyword MUST be defined to work with TOOLATOM objects.)

           TRUEINDEX:        The position of the "true color" index. It is -1 for 2D images. Add one
                             to get the "pixel interleaving" value for this image.

           WID:              The window object where this image will be displayed.

           XINDEX:           The index of the X dimension of the image in the DIMENSIONS variable.

           XSIZE:            The X size of the image.

           YINDEX:           The index of the Y dimension of the image in the DIMENSIONS variable.

           YSIZE:            The Y size of the image.

           UNDOLIMIT:        The number of images kept in the undo buffer.

           _REF_EXTRA:       Any keyword appropriate for the DATAATOM::GETPROPERTY method.

(See C:\IDL\Catalyst\source\data\catimagedata__define.pro)

## CATIMAGEDATA::INIT

[Previous Routine] [Next Routine] [List of Routines]

     NAME:
           CatImageData::INIT

     PURPOSE:

           This method is used upon object creation.

     SYNTAX:

           Called automatically when the object is created thus:

               imageObject = OBJ_NEW ('CatImageData', image)

     ARGUMENTS:

           image           The image array of any data type.

     KEYWORDS:

         AXES:             Set this keyword to add axes to the image display. Or, set this
                           keyword to an axis object.

         BACKGROUNDCOLOR:  The name of the background color. Used only if the ERASE
                           keyword is set. Set to "IVORY" by default.

         BYTSCLMAX:        The maximum value for bytscaling the image. If undefined, Max(image).

         BYTSCLMIN:        The minimum value for bytscaling the image. If undefined, Min(image).

         COLOR_OBJECT:     Use this keyword to load a COLORTOOL object for setting up colors
                           for data display. The image will automatically register for COLORTOOL_TABLECHANGE
                           messages.

         COLORTABLE:       The index number of a standard color table to use for this image.
                           The image is displayed with a gray-scale color table by default.

         DIRECTORY:        The starting location to search for images when reading image
                           files. This directory is updated to reflect the last directory
                           used when reading an image file.

         ERASE:            Set this keyword if you wish to erase the display before
                           the image is drawn.

         FILENAME:         The name of the image file. This keyword is only used if an IMAGE
                           is passed in simultaneously or if the LOAD_IMAGE keyword is used.

         INTERPOLATE:      If the image is resized to fit the window, this keyword will
                           cause bilinear interpolation of image values to be used. The
                           default is to use nearest neighbor interpolation.

         KEEP_ASPECT:      If this keyword is set, the POSITION of the image in the window
                           is always adjusted to preserve the image aspect ratio (ratio of height
                           divided by width). Otherwise, the image is resized arbitrarily.

         LOAD_IMAGE:       If this keyword is set, and no image data is passed into the INIT method,
                           then the ReadImageFile method is called to obtain an image data set.

         NO_COPY:          If this keyword is set, the image data is transfered directly to the object
                           and not copied. The image parameter will become undefined if this keyword is set.

         NORESIZE:         Set this keyword to ensure the image is always drawn at
                           its original size, rather than that specified by XSIZE
                           and YSIZE.

         POSITION:         The position of the image in the display window. The position is given
                           as a four-element array in normalized (0 to 1) coordinates of the form
                           [x0, y0, x1, y1], where (x0,y0) is the lower-left corner of the image and
                           (x1,y1) is the upper-right corner of the image. If the KEEP_ASPECT keyword
                           is set, the image will be located within the specified POSITION in a way
                           that preserves the aspect ratio of the image. For the image's exact location
                           in the window after it has been displayed, use the LOCATION keyword to the
                           GetProperty method.

         XSIZE:            The X size of the image.

         YSIZE:            The Y size of the image.

         WID:              The window object where this image is to be displayed.

         _EXTRA:           Any keyword appropriate for the INIT method of the superclass object or for
                           the LoadImage method.

(See C:\IDL\Catalyst\source\data\catimagedata__define.pro)

## CATIMAGEDATA::IP

[Previous Routine] [Next Routine] [List of Routines]

     NAME:
           CatImageData::IP

     PURPOSE:

           This method creates an image processing tool (CATIPTOOL) to perform an image
           processing function, and executes the tool process.

     SYNTAX:

           processedImage = imageObject -> IP(theProcessName)

     ARGUMENTS:

           theProcessName: The name of an image processing command. For example, "SMOOTH".

           p1:             This is the first additional parameter of the image processing command.
                           The *first* parameter of the image processing command is always the
                           image data obtained from the targetObject with the GETDATA method. For
                           example, in this case P1 will be equal to 7:

                             smoothObj = Obj_New('CATIPTOOL', 'Smooth', 7)

                           And the command that will be executed is this:

                             targetObject -> SetData, Smooth(targetObject->GetData(), 7)

           p2:             This is the second additional parameter of the image processing command.

           p3:             This is the third additional parameter of the image processing command.

     KEYWORDS:

           DESTROY:        Normally, the image processing object created in this method is added
                           to the tool list of the image. If the DESTROY keyword is set, however,
                           the new object is destroyed and not added to the image tool list. This
                           is appropriate for image processing tasks that can't be undone, for
                           example.

           DRAW:           Set this keyword to DRAW the image after the processing has been applied.

           ORIGINAL:       Set this keyword to apply the image processing operation to the original
                           image data and not to the display image data.

           _EXTRA:         Any keyword appropriate for the INIT method of the image processing tool.

(See C:\IDL\Catalyst\source\data\catimagedata__define.pro)

## CATIMAGEDATA::LOADCT

[Previous Routine] [Next Routine] [List of Routines]

     NAME:
           CatImageData::LOADCT

     PURPOSE:

           This method loads a pre-determined color table for the image. The parameters
           and keywords are passed along to the image's built-in color table.

     SYNTAX:

           imageObject -> LoadCT, colorIndex

     ARGUMENTS:

           colorIndex: The color table index number to load. If missing, 0 is assumed.

     KEYWORDS:

           DRAW:       If this keyword is set, the DRAW method is called after the colors
                       have been loaded.

(See C:\IDL\Catalyst\source\data\catimagedata__define.pro)

## CATIMAGEDATA::LOADIMAGE

[Previous Routine] [Next Routine] [List of Routines]

     NAME:
           CatImageData::LOADIMAGE

     PURPOSE:

           This method is used to load images into the object.

     SYNTAX:

           imageObject -> LOADIMAGE

     ARGUMENTS:

           None.

     INPUT KEYWORDS:

           BMP:            Set this keyword to select BMP files.

           COLORTABLE:     The index number of a standard color table to use for this image.
                           The image is displayed with a gray-scale color table by default.

           DICOM:          Set this keyword to select DICOM files.

           DIRECTORY:      The initial input directory name. The current directory by default.

           DEMO:           Set this keyword to load demonstration files via LOADDATA rather than SELECTIMAGE.
                           Setting this keyword will disable all other keywords.

           DRAW:           Set this keyword to immediately draw the image after loading.

           FILENAME:       The initial filename. If the initial directory has image files of the
                           correct type, the default is to display the first of these files. Otherwise, blank.

           FLIPIMAGE:      Set this keyword if you wish to flip the image from its current orientation.
                           Setting this keyword reverses the Y dimension of the image.

           _EXTRA:         This keyword is used to collect and pass keywords on to the FSC_FILESELECT
                           object. See the code for FSC_FILESELECT for details.

           GIF:            Set this keyword to select GIF files. This capability is not available in IDL 5.4 and higher.

           GROUP_LEADER:   Set this keyword to a widget identifier group leader. This keyword MUST be
                           set when calling this program from another widget program to guarantee modal operation.

           JPEG:           Set this keyword to select JPEG files.

           ONLY2D:         Set this keyword if you only want to allow 2D image arrays to be loaded.

           ONLY3D:         Set this keyword if you only want to allow 3D or true-color image arrays to be loaded.

           PICT:           Set this keyword to select PICT files.

           PNG:            Set this keyword to select PNG files.

           PREVIEWSIZE:    Set this keyword to the maximum size (in pixels) of the preview window. Default is 150.

           TIFF:           Set this keyword to select TIFF files. (This is the default filter selection.)

     OUTPUT KEYWORDS:

           CANCEL:        This keyword is set to 1 if the user exits the program in any way except
                          hitting the ACCEPT button. The ACCEPT button will set this keyword to 0.

           FILEINFO:      This keyword returns information about the selected file. Obtained from the QUERY_**** functions.

           OUTDIRECTORY:  The directory where the selected file is found.

           OUTFILENAME:   The short filename of the selected file.

(See C:\IDL\Catalyst\source\data\catimagedata__define.pro)

## CATIMAGEDATA::MESSAGEHANDLER

[Previous Routine] [Next Routine] [List of Routines]

     NAME:
           CatImageData::MESSAGEHANDLER

     PURPOSE:

           This method responds to "messages" sent from other objects. It is called
           automatically by other objects. To receive messages, it is necessary to
           "register" with the messaging object.

     SYNTAX:

           None. Called by other objects.

     ARGUMENTS:

           TITLE:  The message title. This is the "name" of the message indicated when
                   the object registered for messages with the messaging object.

     KEYWORDS:

           DATA:   Information from the SENDER that may be relevant in processing the message.
                   Typically, an anonymous structure variable, although it could be anything at all.

           SENDER: An output keyword. This is the object reference of the object that is sending
                   the message.

(See C:\IDL\Catalyst\source\data\catimagedata__define.pro)

## CATIMAGEDATA::SETDATA

[Previous Routine] [Next Routine] [List of Routines]

     NAME:
           CatImageData::SetData

     PURPOSE:

           This function method enables data to be set from this object. It is written
           for internal use and should not be called without due consideration. All data
           handling should be done inside the object.

     SYNTAX:

           imageObject -> SetData (Success=s, image)

     ARGUMENTS:

           image:    The image data to be placed into the object.

     KEYWORDS:

           DRAW:     Set this keyword makes the object DRAW itself once the data is loaded.

           NO_COPY:  Set this keyword to "move" supplied data into the object rather than
                     make a copy. Note that this will leave the input "data" variable
                     undefined.
           ORIGINAL: Set this keyword to replace the original image data, rather than the display data.

(See C:\IDL\Catalyst\source\data\catimagedata__define.pro)

## CATIMAGEDATA::SETORIGINAL

[Previous Routine] [Next Routine] [List of Routines]

     NAME:
           CatImageData::SETORIGINAL

     PURPOSE:

           This method attempts simply replaces the display image with the original image.
           As a side effect, any processing objects on the UNDO list are automatically deleted.

     SYNTAX:

               imageObject -> SetOriginal

     ARGUMENTS:

           None.

     KEYWORDS:

           DRAW:    Set this keyword to draw the image after replacement.

(See C:\IDL\Catalyst\source\data\catimagedata__define.pro)

## CATIMAGEDATA::SETPROPERTY

[Previous Routine] [Next Routine] [List of Routines]

     NAME:
           CatImageData::SETPROPERTY

     PURPOSE:

           This method is used to set properties of the CatImageData object

     SYNTAX:

           imageObject -> SETPROPERTY, XSIZE=xsize, YSIZE=ysize

     ARGUMENTS:

           None.

     KEYWORDS:

         AXES:             Set this keyword to add axes to the image display. Or, set this
                           keyword to an axes object that is added to the image.

         AX_PROPERTY:      Set this keyword to invoke the axes control panel (if there are axes)
                           in a separate window.

         BYTSCLMAX:        The maximum value (MAX keyword) for byte scaling the image for display.

         BYTSCLMIN:        The minimum value (MIN keyword) for byte scaling the image for display.

         BACKGROUNDCOLOR:  The name of the background color. Used only if the ERASE
                           keyword is set.

         COLOR_OBJECT:     Use this keyword to load a COLORTOOL object for setting up colors
                           for data display. The image will automatically register for COLORTOOL_TABLECHANGE
                           messages.

         COLORTABLE:       The index number of a standard color table to use for this image.
                           The image is displayed with a gray-scale color table by default.

         DIRECTORY:        The starting location to search for images when reading image
                           files. This directory is updated to reflect the last directory
                           used when reading an image file.

         DRAW:             Set this keyword to DRAW the image after it's properties have been set.

         ERASE:            Set this keyword if you wish to erase the display before
                           the image is drawn.

         FILENAME:         The name of the image file. This keyword is only used if an IMAGE
                           is passed in simultaneously.

         IMAGE:            A image to load into the object.

         INTERPOLATE:      If the image is resized to fit the window, this keyword will
                           cause bilinear interpolation of image values to be used. The
                           default is to use nearest neighbor interpolation.

         KEEP_ASPECT:      If this keyword is set, the POSITION of the image in the window
                           is always adjusted to preserve the image aspect ratio. Otherwise,
                           the image is resized arbitrarily.

         NO_COPY:          If this keyword is set, the image data is transfered directly to the object
                           and not copied. The image parameter will become undefined if this keyword is set.

         NORESIZE:         Set this keyword to ensure the image is always drawn at its original size,
                           rather than that specified by XSIZE and YSIZE. IF NORESIZE is set,
                           the lower-left corner of the image is positioned at (POSITION[0], POSITION[1]).

         POSITION:         The position of the image in the display window. The position is given
                           as a four-element array in normalized (0 to 1) coordinates of the form
                           [x0, y0, x1, y1], where (x0,y0) is the lower-left corner of the image and
                           (x1,y1) is the upper-right corner of the image. If the KEEP_ASPECT keyword
                           is set, the image will be located within the specified POSITION in a way
                           that preserves the aspect ratio of the image. For the image's exact location
                           in the window after it has been displayed, use the LOCATION keyword to the
                           GetProperty method.

         WID:              The window objectr where this image is to be displayed.

         UNDOLIMIT:        The number of tool objects kept in the image's undo buffer.

         _EXTRA:           Any keyword appropriate for the SETPROPERTY method of the superclass object.

(See C:\IDL\Catalyst\source\data\catimagedata__define.pro)

## CATIMAGEDATA::SHOW

[Previous Routine] [Next Routine] [List of Routines]

     NAME:
           CatImageData::SHOW

     PURPOSE:

           This method attempts to pull the draw widget containing the image forward on
           the display, if possible.

     SYNTAX:

               imageObject -> SHOW

     ARGUMENTS:

           None.

     KEYWORDS:

           None.

(See C:\IDL\Catalyst\source\data\catimagedata__define.pro)

## CATIMAGEDATA::WINDOW

[Previous Routine] [Next Routine] [List of Routines]

     NAME:
           CatImageData::WINDOW

     PURPOSE:

           This method with create a CATGRAPHICSWINDOW for the image and add itself
           to the window. The image will be destroyed when the graphics window
           is destroyed.

           This method is provided mostly for interactive development of the image
           object.

           Note that other image properties are also set when the GRAPHICSWINDOW is created.

     SYNTAX:

           imageObject -> Window

     ARGUMENTS:

           None.

     KEYWORDS:

           _EXTRA:   Any keyword appropriate for the image SETPROPERY method.

(See C:\IDL\Catalyst\source\data\catimagedata__define.pro)

## CATIMAGEDATA::XCOLORS

[Previous Routine] [Next Routine] [List of Routines]

     NAME:
           CatImageData::XCOLORS

     PURPOSE:

           This method changes color tables for the image. It is only
           available for 2D image arrays.

     SYNTAX:

               imageObject -> XColors

     ARGUMENTS:

           None.

     KEYWORDS:

           _EXTRA:  Any keyword appropriate for the COLORTOOL::XCOLORS method.

(See C:\IDL\Catalyst\source\data\catimagedata__define.pro)

## CATTRUECOLORIMAGE

[Previous Routine] [Next Routine] [List of Routines]

     NAME:
           CATTRUECOLORIMAGE

     PURPOSE:

           This object implements a class for handling true-color image data. It is a subclassed
           CatImageData object and can be subclassed for specific image implementations.
           This object was an early attempt at creating an image object for the Catalyst
           Library, and has been depreciated it favor of CatImage. It is left in the Library
           for historical reasons and because there are Catalyst applications that use it.

     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

     SUPERCLASSES:

           CATIMAGEDATA
           CATDATAATOM
           ATOM
           CATCONTAINER IDL_CONTAINER

     SYNTAX:

           imageObject = OBJ_NEW ('CATTRUECOLORIMAGE', image)

     CLASS DEFINITION:

        class = { CATTRUECOLORIMAGE, $              ; The CATTRUECOLORIMAGE object class.
                  INHERITS CatImageData $           ; Inherits the CatImageData class.
                }

     MODIFICATION_HISTORY:

           Written by: David Fanning, 19 April 2003.

(See C:\IDL\Catalyst\source\data\cattruecolorimage__define.pro)

## CATTRUECOLORIMAGE::CONTROLPANEL

[Previous Routine] [Next Routine] [List of Routines]

     NAME:
           CATTRUECOLORIMAGE::CONTROLPANEL

     PURPOSE:

           This method creates a control panel for the object

     SYNTAX:

           imageObject -> ControlPanel, baseObj

     ARGUMENTS:

           baseObject:    The object reference of a base widget for this control to
                          be added to. If not supplied, the control panel will be a
                          self contained window.

     KEYWORDS:

           _EXTRA:       Any keywords appropriate for the "CONTROLPANEL::INIT" method.

(See C:\IDL\Catalyst\source\data\cattruecolorimage__define.pro)

## CATTRUECOLORIMAGE::EVENTHANDLER

[Previous Routine] [Next Routine] [List of Routines]

     NAME:
           CATTRUECOLORIMAGE::EVENTHANDLER

     PURPOSE:

           This method is an event handler for the Control Panel.

     SYNTAX:

           Called automatically by the event handling system

     ARGUMENTS:

           event:  The event structure.

     KEYWORDS:

           None.

(See C:\IDL\Catalyst\source\data\cattruecolorimage__define.pro)

## CATTRUECOLORIMAGE::INIT

[Previous Routine] [Next Routine] [List of Routines]

     NAME:
           CATTRUECOLORIMAGE::INIT

     PURPOSE:

           This method is used upon object creation.

     SYNTAX:

           Called automatically when the object is created thus:

               imageObject = OBJ_NEW ('CatTrueColorImage', image)

     ARGUMENTS:

           image           The 24-bit image array of byte type.

     KEYWORDS:

         _EXTRA:           Any keyword appropriate for the INIT method of the superclass object or for
                           the LoadImage method.

(See C:\IDL\Catalyst\source\data\cattruecolorimage__define.pro)

## CATTRUECOLORIMAGE::LOADIMAGE

[Previous Routine] [Next Routine] [List of Routines]

     NAME:
           CATTRUECOLORIMAGE::LOADIMAGE

     PURPOSE:

           This method is used to load images into the object.

     SYNTAX:

           imageObject -> LOADIMAGE

     ARGUMENTS:

           None.

     INPUT KEYWORDS:

           _EXTRA:        Any keyword appropriate for the CatImageData::LOADIMAGE method.

     OUTPUT KEYWORDS:

           CANCEL:        This keyword is set to 1 if the user exits the program in any way except
                          hitting the ACCEPT button. The ACCEPT button will set this keyword to 0.

           FILEINFO:      This keyword returns information about the selected file. Obtained from the QUERY_**** functions.

           OUTDIRECTORY:  The directory where the selected file is found.

           OUTFILENAME:   The short filename of the selected file.

(See C:\IDL\Catalyst\source\data\cattruecolorimage__define.pro)

## CATTRUECOLORIMAGE::PIXEL_TO_VALUE

[Previous Routine] [Next Routine] [List of Routines]

     NAME:
           CATTRUECOLORIMAGE::PIXEL_TO_VALUE

     PURPOSE:

           This method calculates the image RGB value underneath a pixel location
           in the display window. To be accurate, the window containing the image MUST
           be the current graphics window.

     SYNTAX:

           image_value = imageObject -> Pixel_to_Value(x, y)

     RETURN_VALUE:

           image_value: The image value at image[x,y]

     ARGUMENTS:

           X:           The x location in the display window (pixel coordinates).

           Y:           The y location in the display window (pixel coordinates).

     INPUT_KEYWORDS:

           OUTSIDE:     The value to represent "outside" the image. Default is !Values.F_NAN.

     OUTPUT_KEYWORDS:

           INSIDE:      Returns a 1 if the (x,y) values are inside the image and 0 othewise.

           WINDOWINDEX: The window index number of the window containing the image object. Set
                        to !D.Window by default.

           XDATA:       The x data value with respect to the image data coordinate system,

           XPIXEL:      The x pixel value in terms of image (rather than window) device coordinates.

           YDATA:       The y data value with respect to the image data coordinate system,

           YPIXEL:      The y pixel value in terms of image (rather than window) device coordinates.

(See C:\IDL\Catalyst\source\data\cattruecolorimage__define.pro)

## CATTRUECOLORIMAGE::SETPROPERTY

[Previous Routine] [Next Routine] [List of Routines]

     NAME:
           CATTRUECOLORIMAGE::SETPROPERTY

     PURPOSE:

           This method is used to set properties of the CATTRUECOLORIMAGE object

     SYNTAX:

           imageObject -> SETPROPERTY, Image=newImage

     ARGUMENTS:

           None.

     KEYWORDS:

         IMAGE:   A true-color (24-bit) image array to load into the object.

         _EXTRA:  Any keyword appropriate for the SETPROPERTY method of the superclass object.

(See C:\IDL\Catalyst\source\data\cattruecolorimage__define.pro)

## IMAGECONTAINER::ADD

[Previous Routine] [Next Routine] [List of Routines]

     NAME:
           IMAGECONTAINER::ADD

     PURPOSE:

           This method is where you can screen what kinds of objects are
           added to this object's hierarchy. The method is not always needed.
           If you do create it, be CERTAIN to call the superclass ADD method
           or your program will not work correctly.

     SYNTAX:

           theObject -> Add, object

     ARGUMENTS:

         object:     The object to be added to this one.

     KEYWORDS:

         _EXTRA:     Any keywords appropriate for the superclass Add method.

(See C:\IDL\Catalyst\source\data\imagecontainer__define.pro)

## IMAGECONTAINER::DRAW

[Previous Routine] [Next Routine] [List of Routines]

     NAME:
           IMAGECONTAINER::DRAW

     PURPOSE:

           This method may or may not be needed by your object, depending
           upon whether a graphical representation of the object is required.
           If you wish the DRAW method to automatically propogates down to any
           objects contained in this object's container, call the superclass DRAW
           method.

     SYNTAX:

           theObject -> Draw

     ARGUMENTS:

           None.

     KEYWORDS:

           None.

(See C:\IDL\Catalyst\source\data\imagecontainer__define.pro)

## IMAGECONTAINER::GETFRAME

[Previous Routine] [Next Routine] [List of Routines]

     NAME:
           IMAGECONTAINER::GETFRAME

     PURPOSE:

           This method retrieves an image from its container, based on the image framenumber

     SYNTAX:

           thisObject -> GetFrame, frameNumber

     ARGUMENTS:

           framenumber: The image framenumber. If an image with this framenumber can be found, it
                        is removed from the image container.

     KEYWORDS:

           None.

(See C:\IDL\Catalyst\source\data\imagecontainer__define.pro)

## IMAGECONTAINER::REMOVEFRAME

[Previous Routine] [Next Routine] [List of Routines]

     NAME:
           IMAGECONTAINER::REMOVEFRAME

     PURPOSE:

           This method removes an image from its container, based on the image framenumber

     SYNTAX:

           thisObject -> RemoveFrame, frameNumber

     ARGUMENTS:

           framenumber: The image framenumber. If an image with this framenumber can be found, it
                        is removed from the image container.

     KEYWORDS:

           None.

(See C:\IDL\Catalyst\source\data\imagecontainer__define.pro)

## IMAGECONTAINER__DEFINE

[Previous Routine] [Next Routine] [List of Routines]

     NAME:
           IMAGECONTAINER__DEFINE

     PURPOSE:

           The purpose of this routine is to provide a container class for image
           objects. Calling the DRAW method of a container calls the DRAW method
           on all the items in the container. It is similar to a CatLayer object,
           which was developed later for annotations. It was developed specifically
           for ImageFrame objects, and still contains some unneeded dependencies
           on that object.

     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:

           Objects.

     SYNTAX:

           theObject = Obj_New("IMAGECONTAINER")

     SUPERCLASSES:

           CATATOM
           CATCONTAINER IDLITCOMPONENT
           IDL_CONTAINER

     CLASS_STRUCTURE:

       class = { IMAGECONTAINER, $
                 INHERITS CATATOM $
               }

     MESSAGES:

       None.

     MODIFICATION_HISTORY:

           Written by: David W. Fanning, May 24, 2005.

(See C:\IDL\Catalyst\source\data\imagecontainer__define.pro)

## IMAGEFRAME

[Previous Routine] [Next Routine] [List of Routines]

     NAME:
           ImageFrame

     PURPOSE:

           This object implements a class for handling image data. This object is
           conceptually identical to a CatImage object, except that the image data
           is not stored directly in the object. Rather, a pointer to an ImageStack
           object, a frame number, and a slice orientation are used to access the
           image data when needed for display. This object was used in a medical
           imaging application in support of volumentric image data.

     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

     SUPERCLASSES:

           CATDATAATOM
           CATATOM
           CATCONTAINER
           IDL_CONTAINER

     SYNTAX:

           imageObject = OBJ_NEW ('ImageFrame', imageStack)

     CLASS DEFINITION:

        class = { ImageFrame, $                    ; The ImageFrame object class.
                  _stack        : Obj_New(), $     ; The IMAGESTACK object.
                  _display_mode : 0B, $            ; A flag indicating which display method to use for drawing.
                  _inverse      : 0B, $            ; If this flag is set, the image is drawn in inverse color.
                  _keep_aspect  : 0L, $            ; Flag: Keep the aspect ratio when calculating image position.
                  _location     : DblArr(6,2), $   ; Location information about the "displayed" image.
                  _interpolate  : 0L, $            ; Flag: When set, bilinear interpolation is used.
                  _order        : 0L, $            ; Image display order.
                  _out_xsize    : 0L, $            ; The output X size of the image. (Display_Mode=1 and Display_Mode=2)
                  _out_ysize    : 0L, $            ; The output Y size of the image. (Display_Mode=1 and Display_Mode=2)
                  _position     : DblArr(4), $     ; The position of the image in the output window. (Display_Mode=0)
                  _xsize        : 0L, $            ; The X size of the image.
                  _xstart       : 0L, $            ; The starting X location for displaying image. (Display_Mode=1)
                  _ysize        : 0L, $            ; The Y size of the image.
                  _ystart       : 0L, $            ; The starting Y location for displaying image. (Display_Mode=1)
                  _wid          : Obj_New(), $     ; The window object where this image should be displayed.
                  _window_position: 0L, $          ; The window position for displaying this image. (Display_Mode=2)
                  _orientation  : "", $            ; The orientation of the slice: "X", "Y", or "Z" (the default).
                  _framenumber  : 0L, $            ; The frame number.
                  _thick        : 0L, $            ; The "thickness" of the image slice. (See IMAGESTACK documentation.)
                  INHERITS CatDataAtom $           ; Subclassed from CATDATAATOM.
                }

     MODIFICATION_HISTORY:

           Written by: David Fanning, 27 March 2003.

(See C:\IDL\Catalyst\source\data\imageframe__define.pro)

## IMAGEFRAME::CLEANUP

[Previous Routine] [Next Routine] [List of Routines]

     NAME:
           ImageFrame::CLEANUP

     PURPOSE:

           This is the ImageFrame object class destructor method.

     SYNTAX:

           Called automatically when the object is destroyed thus:

               OBJ_DESTROY, imageObject

     ARGUMENTS:

           None.

     KEYWORDS:

           _EXTRA:  Any keyword appropriate for the DATAATOM::CLEANUP method.

(See C:\IDL\Catalyst\source\data\imageframe__define.pro)

## IMAGEFRAME::DRAW

[Previous Routine] [Next Routine] [List of Routines]

     NAME:
           ImageFrame::DRAW

     PURPOSE:

           This method draws the image to the display based on the current DISPLAY_MODE
           in effect for the widget.

     SYNTAX:

           imageObject -> Draw

     ARGUMENTS:

           None.

     KEYWORDS:

           None.

(See C:\IDL\Catalyst\source\data\imageframe__define.pro)

## IMAGEFRAME::DRAW_MODE_0

[Previous Routine] [Next Routine] [List of Routines]

     NAME:
           ImageFrame::DRAW_MODE_0

     PURPOSE:

           This display mode position's the image in the display window based
           on the POSITION of the image.

     SYNTAX:

           imageObject -> Draw_Mode_0

     ARGUMENTS:

           None.

     KEYWORDS:

           None.

(See C:\IDL\Catalyst\source\data\imageframe__define.pro)

## IMAGEFRAME::DRAW_MODE_1

[Previous Routine] [Next Routine] [List of Routines]

     NAME:
           ImageFrame::DRAW_MODE_1

     PURPOSE:

           This display mode position's the image in the display window based
           on the lower-left corner of the image.

     SYNTAX:

           imageObject -> Draw_Mode_1

     ARGUMENTS:

           None.

     KEYWORDS:

           None.

(See C:\IDL\Catalyst\source\data\imageframe__define.pro)

## IMAGEFRAME::DRAW_MODE_2

[Previous Routine] [Next Routine] [List of Routines]

     NAME:
           ImageFrame::DRAW_MODE_2

     PURPOSE:

           This display mode position's the image in the display window based
           on a window position parameter.

     SYNTAX:

           imageObject -> Draw_Mode_2

     ARGUMENTS:

           None.

     KEYWORDS:

           None.

(See C:\IDL\Catalyst\source\data\imageframe__define.pro)

## IMAGEFRAME::GETPROPERTY

[Previous Routine] [Next Routine] [List of Routines]

     NAME:
           ImageFrame::GETPROPERTY

     PURPOSE:

           This method is used to get properties of the ImageFrame object

     SYNTAX:

           imageObject -> GETPROPERTY, XSIZE=xsize, YSIZE=ysize

     ARGUMENTS:

           None.

     KEYWORDS:

           AXES:             The image axes object for this image. If not available, a null object.

           DIMENSIONS:       A three-element array containing the dimensions of the imageStack object.

           IMAGE:            The image data.

           INVERSE:          If this keyword is set, the image is drawn in inverse color (255-image).

           KEEP_ASPECT:      The keep aspect ratio flag.

           LOCATION:         A 6-by-2 floating array containing information about the position of the
                             "displayed" image, which is updated after every image DRAW. The first two
                             elements (location[0:1,0] contain the X and Y positions of the
                             lower-left corner of the image (device units), the next two elements
                             (location[2:3,0]) the X and Y positions of the upper-right corner of the
                             image (device units)), and the last two elements contain the X and Y size of
                             the display window (device units). The location[*,1] elements are
                             exactly the same as the location[*,0] elements, except they are
                             expressed in normalized (0 to 1) coordinates.

           NOINTERPOLATE:    The nointerpolate flag.

           OUT_XSIZE:        The X size of the image on the display.

           OUT_YSIZE:        The Y size of the image on the display.

           ORIENTATION:      The current orientation of the slice.

           POSITION:         A four-element vector giving the position of the image in the
                             display window in normalized coordinates: [x0, y0, x1, y1].

           FRAMENUMBER:      The current index number of the slice.

           THICK:            The current slice "thickness".

           XSIZE:            The X size of the image.

           XSTART:           The X location (in pixels) of the lower-left corner of the image. Used only
                             in DISPLAY_MODE=1.

           YSIZE:            The Y size of the image.

           YSTART:           The Y location (in pixels) of the lower-left corner of the image. Used only
                             in DISPLAY_MODE=1.
           WID:              The window object where this image will be displayed.

           WINDOW_POSITION:  A single number that gives a "window position" for displaying the image.
                             The same as calling the TV command with a single positional parameter other
                             than the image.

           _REF_EXTRA:       Any keyword appropriate for the DATAATOM::GETPROPERTY method.

(See C:\IDL\Catalyst\source\data\imageframe__define.pro)

## IMAGEFRAME::INIT

[Previous Routine] [Next Routine] [List of Routines]

     NAME:
           ImageFrame::INIT

     PURPOSE:

           This method is used upon object creation.

     SYNTAX:

           Called automatically when the object is created thus:

               imageObject = OBJ_NEW ('ImageFrame', imageStackObject)

     ARGUMENTS:

           imageStack       The object reference to an IMAGESTACK object.

     KEYWORDS:

         AXES:             Set this keyword to add axes to the image display. Or, set this
                           keyword to an axis object.

         DISPLAY_MODE:     Images can be displayed in any of three display "modes". Display Mode 0 is
                           the default and allows images to be positioned in the window using the
                           POSITION keyword. Display Mode 1 is the standard "TV" display mode in which
                           the image is positioned with respect to its lower-left corner in the
                           display window. Display Mode 2 is the standard "TV" display mode in which
                           the image is positioned in the window according to the WINDOW_POSITION.

         INVERSE:          If this keyword is set, the image is drawn in inverse color (255-image).

         KEEP_ASPECT:      If this keyword is set, the POSITION of the image in the window
                           is always adjusted to preserve the image aspect ratio (ratio of height
                           divided by width). Otherwise, the image is resized arbitrarily. Applies
                           only to DISPLAY_MODE=0.

         NO_COPY:          If this keyword is set, the image data is transfered directly to the object
                           and not copied. The image parameter will become undefined if this keyword is set.

         NOINTERPOLATE:    If the image is resized to fit the window, this keyword, if set, will
                           cause nearest neighbor interpolation of image values to be used. The
                           default is to use  bilinear interpolation. Applies only to DISPLAY_MODE=0.

         ORIENTATION:      Slices can be taken in the X, Y, and Z directions. This keyword accepts
                           a single character string that selects the directions. "Z": the slice is taken
                           from the XY plane (the default). "X" the slice is taken from the YZ plane. "Y" the
                           slice is taken from the XZ plane.

         POSITION:         The position of the image in the display window. The position is given
                           as a four-element array in normalized (0 to 1) coordinates of the form
                           [x0, y0, x1, y1], where (x0,y0) is the lower-left corner of the image and
                           (x1,y1) is the upper-right corner of the image. If the KEEP_ASPECT keyword
                           is set, the image will be located within the specified POSITION in a way
                           that preserves the aspect ratio of the image. For the image's exact location
                           in the window after it has been displayed, use the LOCATION keyword to the
                           GetProperty method.

         FRAMENUMBER:      The index number of the slice desired from the image cube. By default, 0.

         THICK:            Normally, a slice one image frame thick is returned. If this keyword is
                           set to a value greater than 1, then THICK number of image frames are averaged
                           together to produce the slice that is returned. The slice will go from number
                           to (number + thick - 1). If there are not enough image frames to produce a slice
                           with a particular thickness, then as many frames as possible will be averaged.

         XSIZE:            The desired X size of the image upon output. This is used only for DISPLAY_MODE=1
                           and DISPLAY_MODE=2.

         XSTART:           The X location (in pixels) of the lower-left corner of the image. Used only
                           in DISPLAY_MODE=1.

         YSIZE:            The desired Y size of the image upon output. This is used only for DISPLAY_MODE=1
                           and DISPLAY_MODE=2.

         YSTART:           The Y location (in pixels) of the lower-left corner of the image. Used only
                           in DISPLAY_MODE=1.

         WID:              The window object where this image is to be displayed.

         WINDOW_POSITION:  A single number that gives a "window position" for displaying the image.
                           The same as calling the TV command with a single positional parameter other
                           than the image.

         _EXTRA:           Any keyword appropriate for the INIT method of the superclass object.

(See C:\IDL\Catalyst\source\data\imageframe__define.pro)

## IMAGEFRAME::MESSAGEHANDLER

[Previous Routine] [Next Routine] [List of Routines]

     NAME:
           ImageFrame::MESSAGEHANDLER

     PURPOSE:

           This method responds to "messages" sent from other objects. It is called
           automatically by other objects. To receive messages, it is necessary to
           "register" with the messaging object.

     SYNTAX:

           None. Called by other objects.

     ARGUMENTS:

           TITLE:  The message title. This is the "name" of the message indicated when
                   the object registered for messages with the messaging object.

     KEYWORDS:

           DATA:   Information from the SENDER that may be relevant in processing the message.
                   Typically, an anonymous structure variable, although it could be anything at all.

           SENDER: An output keyword. This is the object reference of the object that is sending
                   the message.

(See C:\IDL\Catalyst\source\data\imageframe__define.pro)

## IMAGEFRAME::PIXEL_TO_VALUE

[Previous Routine] [Next Routine] [List of Routines]

     NAME:
           ImageFrame::PIXEL_TO_VALUE

     PURPOSE:

           This method calculates the original image value underneath a pixel location
           in the display window. To be accurate, the window that contains the image
           MUST BE the current graphics window. To be certain of this, use the WID
           keyword in the INIT or SetProperty methods to associate an image with its
           display window.

     SYNTAX:

           image_value = imageObject -> Pixel_to_Value(x, y)

     RETURN_VALUE:

           image_value:   The image value at image[x,y]. For 2D images, a single value. For
                          true-color images a three-element array representing the RGB values
                          at that image pixel.

     ARGUMENTS:

           X:             The x location in the display window (pixel coordinates).

           Y:             The y location in the display window (pixel coordinates).

     OUTPUT_KEYWORDS:

           INSIDE:        Returns a 1 if the (x,y) values are inside the image and 0 otherwise. No values
                          are returned in other keywords if the point is not inside the image.

           XDATA:         The x data value with respect to the image data coordinate system,

           XPIXEL:        The x pixel value in terms of image (rather than window) device coordinates.

           YDATA:         The y data value with respect to the image data coordinate system,

           YPIXEL:        The y pixel value in terms of image (rather than window) device coordinates.

(See C:\IDL\Catalyst\source\data\imageframe__define.pro)

## IMAGEFRAME::POINT_INSIDE

[Previous Routine] [Next Routine] [List of Routines]

     NAME:
           ImageFrame::POINT_INSIDE

     PURPOSE:

           This method returns a 1 if the specified point is inside the image, and a 0
           if the specified point is outside the image.

     SYNTAX:

           is_inside = imageObject -> Point_Inside(x, y)

     ARGUMENTS:

           x:      The X value of the point in window or pixel coordinates.

           y:      The Y value of the point in window or pixel coordinates.

     KEYWORDS:

           None

(See C:\IDL\Catalyst\source\data\imageframe__define.pro)

## IMAGEFRAME::SETPROPERTY

[Previous Routine] [Next Routine] [List of Routines]

     NAME:
           ImageFrame::SETPROPERTY

     PURPOSE:

           This method is used to set properties of the ImageFrame object

     SYNTAX:

           imageObject -> SETPROPERTY, XSIZE=xsize, YSIZE=ysize

     ARGUMENTS:

           None.

     KEYWORDS:

         AXES:             Set this keyword to add axes to the image display. Or, set this
                           keyword to an axes object that is added to the image.

         AXIS_PROPERTY:    Set this keyword to invoke the axes control panel (if there are axes)
                           in a separate window.

         DISPLAY_MODE:     Images can be displayed in any of three display "modes". Display Mode 0 is
                           the default and allows images to be positioned in the window using the
                           POSITION keyword. Display Mode 1 is the standard "TV" display mode in which
                           the image is positioned with respect to its lower-left corner in the
                           display window. Display Mode 2 is the standard "TV" display mode in which
                           the image is positioned in the window according to the WINDOW_POSITION.

         DRAW:             Set this keyword to DRAW the image after it's properties have been set.

         IMAGESTACK:        An object reference to an IMAGESTACK object.

         INVERSE:          If this keyword is set, the image is drawn in inverse color (255-image).

         KEEP_ASPECT:      If this keyword is set, the POSITION of the image in the window
                           is always adjusted to preserve the image aspect ratio (ratio of height
                           divided by width). Otherwise, the image is resized arbitrarily. Applies
                           only to DISPLAY_MODE=0.

         NO_COPY:          If this keyword is set, the image data is transfered directly to the object
                           and not copied. The image parameter will become undefined if this keyword is set.

         NOINTERPOLATE:    If the image is resized to fit the window, this keyword, if set, will
                           cause nearest neighbor interpolation of image values to be used. The
                           default is to use  bilinear interpolation. Applies only to DISPLAY_MODE=0.
                           Note: True-Color images *always* use bilinear interpolation no matter what
                           the value of this keyword.

         NULL_FOR_SAVE:    If this keyword is set, any object field in this object that will cause
                           unwanted object references to be saved in a save file are nulled out.

         ORIENTATION:      Slices can be taken in the X, Y, and Z directions. This keyword accepts
                           a single character string that selects the directions. "Z": the slice is taken
                           from the XY plane (the default). "X" the slice is taken from the YZ plane. "Y" the
                           slice is taken from the XZ plane.

         POSITION:         The position of the image in the display window. The position is given
                           as a four-element array in normalized (0 to 1) coordinates of the form
                           [x0, y0, x1, y1], where (x0,y0) is the lower-left corner of the image and
                           (x1,y1) is the upper-right corner of the image. If the KEEP_ASPECT keyword
                           is set, the image will be located within the specified POSITION in a way
                           that preserves the aspect ratio of the image. For the image's exact location
                           in the window after it has been displayed, use the LOCATION keyword to the
                           GetProperty method.

         FRAMENUMBER:      The index number of the slice desired from the image cube. By default, 0.

         THICK:            Normally, a slice one image frame thick is returned. If this keyword is
                           set to a value greater than 1, then THICK number of image frames are averaged
                           together to produce the slice that is returned. The slice will go from number
                           to (number + thick - 1). If there are not enough image frames to produce a slice
                           with a particular thickness, then as many frames as possible will be averaged.

         XSIZE:            The desired X size of the image upon output. This is used only for DISPLAY_MODE=1
                           and DISPLAY_MODE=2.

         XSTART:           The X location (in pixels) of the lower-left corner of the image. Used only
                           in DISPLAY_MODE=1.

         YSIZE:            The desired Y size of the image upon output. This is used only for DISPLAY_MODE=1
                           and DISPLAY_MODE=2.

         YSTART:           The Y location (in pixels) of the lower-left corner of the image. Used only
                           in DISPLAY_MODE=1.

         WID:              The window objectr where this image is to be displayed.

         WINDOW_POSITION:  A single number that gives a "window position" for displaying the image.
                           The same as calling the TV command with a single positional parameter other
                           than the image.

         _EXTRA:           Any keyword appropriate for the SETPROPERTY method of the superclass object.

(See C:\IDL\Catalyst\source\data\imageframe__define.pro)

## IMAGEFRAME::SHOW

[Previous Routine] [Next Routine] [List of Routines]

     NAME:
           ImageFrame::SHOW

     PURPOSE:

           This method attempts to pull the draw widget containing the image forward on
           the display, if possible.

     SYNTAX:

               imageObject -> SHOW

     ARGUMENTS:

           None.

     KEYWORDS:

           None.

(See C:\IDL\Catalyst\source\data\imageframe__define.pro)

## IMAGESTACK::CLEANUP

[Previous Routine] [Next Routine] [List of Routines]

     NAME:
           IMAGESTACK::CLEANUP

     PURPOSE:

           This is the IMAGESTACK object class destructor method.

     SYNTAX:

           Called automatically when the object is destroyed.

     ARGUMENTS:

           None.

     KEYWORDS:

          None.

(See C:\IDL\Catalyst\source\data\imagestack__define.pro)

## IMAGESTACK::DRAW

[Previous Routine] [Next Routine] [List of Routines]

     NAME:
           IMAGESTACK::DRAW

     PURPOSE:

           This method may or may not be needed by your object, depending
           upon whether a graphical representation of the object is required.
           If you wish the DRAW method to automatically propogates down to any
           objects contained in this object's container, call the superclass DRAW
           method.

     SYNTAX:

           theObject -> Draw

     ARGUMENTS:

           None.

     KEYWORDS:

           None.

(See C:\IDL\Catalyst\source\data\imagestack__define.pro)

## IMAGESTACK::GETFRAME

[Previous Routine] [Next Routine] [List of Routines]

     NAME:
           IMAGESTACK::GETFRAME

     PURPOSE:

           This function method returns the 2D image with the corresponding frame or slice number.
           By default, the slice is taken in the XY plane of the image stack, but slices in other
           planes can be returned by setting the appropriate keywords.

     SYNTAX:

           theFrame = theObject -> GetFrame(number)

     ARGUMENTS:

         number:      The frame or slice number of the image desired in the image stack.

     KEYWORDS:

         ORIENTATION: Slices can be taken in the X, Y, and Z directions. This keyword accepts
                      a single character string that selects the directions. "Z": the slice is taken
                      from the XY plane (the default). "X" the slice is taken from the YZ plane. "Y" the
                      slice is taken from the XZ plane.

         THICK:       Normally, a slice one image frame thick is returned. If this keyword is
                      set to a value greater than 1, then THICK number of image frames are averaged
                      together to produce the slice that is returned. The slice will go from number
                      to (number + thick - 1). If there are not enough image frames to produce a slice
                      with a particular thickness, then as many frames as possible will be averaged.
                      In other words, if there are 10 slices and you ask for slice number 8 with a
                      thickness of 3, frame indices 8, 9, and 10 should be averaged. In this case,
                      there is no frame index 10, so only two frames will be used in calculating
                      the average frame.

(See C:\IDL\Catalyst\source\data\imagestack__define.pro)

## IMAGESTACK::GETPROPERTY

[Previous Routine] [Next Routine] [List of Routines]

     NAME:
           IMAGESTACK::GETPROPERTY

     PURPOSE:

           This method allows the user to obtain IMAGESTACK properties. Be sure
           you ALWAYS call the superclass GETPROPERTY method if you have extra
           keywords!

     SYNTAX:

           theObject -> GetProperty ...

     ARGUMENTS:

         None.

     KEYWORDS:

         DIMENSIONS:     A three-element array containing the dimensions of the image stack.

         IMAGESTACK:     The image stack data.

         MAXVALUE:       The maximum value of the data in the stack.

         MINVALUE:       The minimum value of the data in the stack.

         XSIZE:          The X size of the data stack.

         YSIZE:          The Y size of the data stack.

         ZSIZE:          The Z size of the data stack.

         _REF_EXTRA:     Any keywords appropriate for the superclass GetProperty method.

(See C:\IDL\Catalyst\source\data\imagestack__define.pro)

## IMAGESTACK::INIT

[Previous Routine] [Next Routine] [List of Routines]

     NAME:
           IMAGESTACK::INIT

     PURPOSE:

           This is the IMAGESTACK object class initialization method

     SYNTAX:

           Called automatically when the object is created.

     ARGUMENTS:

         dataStack:   The 3D volume data set that is the image stack.

     KEYWORDS:

         _EXTRA:     Any keywords appropriate for the superclass INIT method.

(See C:\IDL\Catalyst\source\data\imagestack__define.pro)

## IMAGESTACK::SETPROPERTY

[Previous Routine] [Next Routine] [List of Routines]

     NAME:
           IMAGESTACK::SETPROPERTY

     PURPOSE:

           This method allows the user to set the IMAGESTACK object's properties.

     SYNTAX:

           theObject -> SetProperty ...

     ARGUMENTS:

         None.

     KEYWORDS:

         IMAGESTACK:  A 3D data set representing an image stack.

         _EXTRA:     Any keywords appropriate for the superclass SetProperty method.

(See C:\IDL\Catalyst\source\data\imagestack__define.pro)

## IMAGESTACK__DEFINE

[Previous Routine] [Next Routine] [List of Routines]

     NAME:
           IMAGESTACK__DEFINE

     PURPOSE:

           The purpose of this routine is to implement an object for manipulating
           an image cube or stack. An image stack is a 3D volume data set that can be
           sliced in three orthogonal planes to produce image slices or frames.

     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:

           Objects.

     SYNTAX:

           theObject = Obj_New("IMAGESTACK")

     SUPERCLASSES:

           CATDATAATOM
           CATATOM
           CATCONTAINER IDLITCOMPONENT
           IDL_CONTAINER

     CLASS_STRUCTURE:

       class = { IMAGESTACK, $
                 xsize: 0L, $
                 ysize: 0L, $
                 zsize: 0L, $
                 INHERITS CATDATAATOM $
               }

     MESSAGES:

       None.

     MODIFICATION_HISTORY:

           Written by: David W. Fanning, 25 February 2004.

(See C:\IDL\Catalyst\source\data\imagestack__define.pro)

## SCALEIMAGE::CLEANUP

[Previous Routine] [Next Routine] [List of Routines]

     NAME:
           SCALEIMAGE::CLEANUP

     PURPOSE:

           This is the SCALEIMAGE object class destructor method.

     SYNTAX:

           Called automatically when the object is destroyed.

     ARGUMENTS:

           None.

     KEYWORDS:

          None.

(See C:\IDL\Catalyst\source\data\scaleimage__define.pro)

## SCALEIMAGE::CONTROLPANEL

[Previous Routine] [Next Routine] [List of Routines]

     NAME:
           ScaleImage::CONTROLPANEL

     PURPOSE:

           This method creates a control panel for the CATIMAGE object. A
           control panel is a graphical user interface for setting object
           properties. If you create a control panel, the events are typically
           sent to the EVENTHANDLER method.

     SYNTAX:

           theObject -> ControlPanel, baseObject

     ARGUMENTS:

           baseObject:    The object reference of a base widget for this control to
                          be added to. If not supplied, the control panel will be in a
                          self contained window (i.e., a TOPLEVELBASE object).

     KEYWORDS:

           _EXTRA:       Any keywords appropriate for the CatControlPanel::INIT method.

(See C:\IDL\Catalyst\source\data\scaleimage__define.pro)

## SCALEIMAGE::CREATEDISPLAYIMAGE

[Previous Routine] [Next Routine] [List of Routines]

     NAME:
           ScaleImage::CREATEDISPLAYIMAGE

     PURPOSE:

           This method creates a display image for the object

     SYNTAX:

           imageObject -> CreateDisplayImage

     ARGUMENTS:

           None.

     KEYWORDS:

           None.

(See C:\IDL\Catalyst\source\data\scaleimage__define.pro)

## SCALEIMAGE::EVENT_HANDLER

[Previous Routine] [Next Routine] [List of Routines]

     NAME:
            ScaleImage::EVENT_HANDLER

     PURPOSE:

            This method is the event handler for the CATIMAGE object. It will typically
            be used to respond to events from widget objects created in the CONTROLPANEL
            method.

     SYNTAX:

            This method is called automatically by the event handling mechanism.

     ARGUMENTS:

           event: The event structure as described in the IDL help files, except
                  that the ID, TOP and HANDLER tags will be object references.

     KEYWORDS:

           None.

(See C:\IDL\Catalyst\source\data\scaleimage__define.pro)

## SCALEIMAGE::GETPROPERTY

[Previous Routine] [Next Routine] [List of Routines]

     NAME:
           SCALEIMAGE::GETPROPERTY

     PURPOSE:

           This method allows the user to obtain SCALEIMAGE properties. Be sure
           you ALWAYS call the CATIMAGE GETPROPERTY method if you have extra
           keywords!

     SYNTAX:

           theObject -> GetProperty ...

     ARGUMENTS:

         None.

     KEYWORDS:

         BETA:          The beta factor in a Hyperpolic Sine stretch.

         BOTTOM:         The lowest value of the image.

         EXPONENT:      The logarithm exponent in a logarithmic stretch.

         GAMMA:         The gamma factor in a gamma stretch.

         MEAN:          The mean factor in a logarithmic stretch. Default is 0.5.

         MISSING_COLOR:  The name of the missing color.

         MISSING_VALUE:  The number that represents missing value in the image.

         NCOLORS:        The number of colors the image is scaled into.

         NEGATIVE:       If set, the display is doing a negative or reverse stretch.

         SCALETYPE:     The type of scaling performed prior to display. Default is 0, linear scaling.
               Number   Type of Stretch
                 0         Linear         scaled = BytScl(image, MIN=minThresh, MAX=maxThresh)
                 1         Gamma          scaled = GmaScl(image, MIN=minThresh, MAX=maxThresh, Gamma=gamma)
                 2         Log            scaled = LogScl(image, MIN=minThresh, MAX=maxThresh, Mean=mean, Exponent=exponent)
                 3         Asinh          scaled = AsinhScl(image, MIN=minThresh, MAX=maxThresh, Beta=beta)
                 4         Linear 2%      A linear stretch, with 2 percent of pixels clipped at both the top and bottom
                 5         Square Root    A linear stretch of the square root histogram of the image values.
                 6         Equalization   A linear stretch of the histogram equalized image histogram.
                 7         Gaussian       A Gaussian normal function is applied to the image histogram.

         SCLMIN:         The image data is scaled between SCLMIN and SCLMAX before display. Default = 0.

         SCLMAX:         The image data is scaled between SCLMIN and SCLMAX before display. Default = 255.

         SIGMA:          The current value of the SIGMA scale factor in Gaussian stretches.

         _REF_EXTRA:     Any keywords appropriate for the CATIMAGE GetProperty method.

(See C:\IDL\Catalyst\source\data\scaleimage__define.pro)

## SCALEIMAGE::INIT

[Previous Routine] [Next Routine] [List of Routines]

     NAME:
           SCALEIMAGE::INIT

     PURPOSE:

           This is the SCALEIMAGE object class initialization method

     SYNTAX:

           Called automatically when the object is created.

     ARGUMENTS:

         image       The image to load into the object.

     KEYWORDS:

         BOTTOM:        The lowest value of the image.

         BETA:          The beta factor in a Hyperpolic Sine stretch. Default is 3.0.

         EXPONENT:      The logarithm exponent in a logarithmic stretch. Default is 4.0.

         GAMMA:         The gamma factor in a gamma stretch. Default is 1.5.

         MEAN:          The mean factor in a logarithmic stretch. Default is 0.5.

         MISSING_COLOR: The name of the missing color. By default, "ivory".

         MISSING_VALUE: The number that represents missing value in the image.

         NCOLORS:       The number of colors to scale the data into, as in this: (Default: 256)

         NEGATIVE:      Set this keyword if you want to display the image with a negative or reverse stretch.

         SCALETYPE:     The type of scaling performed prior to display. Default is 0, linear scaling.
                        May be specified as a number or as a string (e.g, 3 or "ASIGH").

               Number   Type of Stretch
                 0         Linear         scaled = BytScl(image, MIN=minThresh, MAX=maxThresh)
                 1         Gamma          scaled = GmaScl(image, MIN=minThresh, MAX=maxThresh, Gamma=gamma)
                 2         Log            scaled = LogScl(image, MIN=minThresh, MAX=maxThresh, Mean=mean, Exponent=exponent)
                 3         Asinh          scaled = AsinhScl(image, MIN=minThresh, MAX=maxThresh, Beta=beta)
                 4         Linear 2%      A linear stretch, with 2 percent of pixels clipped at both the top and bottom
                 5         Square Root    A linear stretch of the square root histogram of the image values.
                 6         Equalization   A linear stretch of the histogram equalized image histogram.
                 7         Gaussian       A Gaussian normal function is applied to the image histogram.
                 8         None           No scaling whatsoever is done.

         SCLMIN:        The image data is scaled between SCLMIN and SCLMAX before display. Default is MIN(image).

         SCLMAX:        The image data is scaled between SCLMIN and SCLMAX before display. Default is MAX(image).

         SIGMA:         The sigma scale factor in a Gaussian stretch. Default is 1.0.

         _EXTRA:        Any keywords appropriate for the CATIMAGE INIT method.

(See C:\IDL\Catalyst\source\data\scaleimage__define.pro)

## SCALEIMAGE::SCALETHEIMAGE

[Previous Routine] [Next Routine] [List of Routines]

     NAME:
           SCALEIMAGE::SCALEtheIMAGE

     PURPOSE:

           This method does the actual scaling of the image data.

     SYNTAX:

           scaledImage = theObject -> ScaleTheImage()

     RETURN_VALUE:

         scaledImage:  The scaled image.

     ARGUMENTS:

         image:        The image to be scaled. Must be a 2D image. A 24-bit image (a 3D image,
                       in which one of the dimensions is a 3) is immediately returned.

     KEYWORDS:

         None.

(See C:\IDL\Catalyst\source\data\scaleimage__define.pro)

## SCALEIMAGE::SETPROPERTY

[Previous Routine] [Next Routine] [List of Routines]

     NAME:
           SCALEIMAGE::SETPROPERTY

     PURPOSE:

           This method allows the user to set the SCALEIMAGE object's properties. Be sure
           you ALWAYS call the CATIMAGE SETPROPERTY method if you have extra keywords!

     SYNTAX:

           theObject -> SetProperty ...

     ARGUMENTS:

         None.

     KEYWORDS:

         BETA:          The beta factor in a Hyperpolic Sine stretch. Default is 3.0.

         BOTTOM:        The lowest value of the scaled image.

         EXPONENT:      The logarithm exponent in a logarithmic stretch. Default is 4.0.

         GAMMA:         The gamma factor in a gamma stretch. Default is 1.5.

         MEAN:          The mean factor in a logarithmic stretch. Default is 0.5.

         NEGATIVE:      Set this keyword to get a negative scaling (reverse).

         IMAGE:         The image data. If SCLMIN and SCLMAX are not used in conjunction with this
                        keyword, the image is scaled with a 2% linear scaling.

         MISSING_COLOR: The name of the missing color.

         MISSING_VALUE: The number that represents missing value in the image.

         NCOLORS:       The number of colors to scale the data into, as in this: (Default: 256)

                         displayImage = BYTSCL(image, MIN=self.sclmin, MAX=self.sclmax, TOP=self.ncolors-1)

         SCALETYPE:     The type of scaling performed prior to display. Default is 0, linear scaling.

               Number   Type of Stretch
                 0         Linear         scaled = BytScl(image, MIN=minThresh, MAX=maxThresh)
                 1         Gamma          scaled = GmaScl(image, MIN=minThresh, MAX=maxThresh, Gamma=gamma)
                 2         Log            scaled = LogScl(image, MIN=minThresh, MAX=maxThresh, Mean=mean, Exponent=exponent)
                 3         Asinh          scaled = AsinhScl(image, MIN=minThresh, MAX=maxThresh, Beta=beta)
                 4         Linear 2%      A linear stretch, with 2 percent of pixels clipped at both the top and bottom
                 5         Square Root    A linear stretch of the square root histogram of the image values.
                 6         Equalization   A linear stretch of the histogram equalized image histogram.
                 7         Gaussian       A Gaussian normal function is applied to the image histogram.

         SCLMIN:        The image data is scaled between SCLMIN and SCLMAX before display. Default = 0.

         SCLMAX:        The image data is scaled between SCLMIN and SCLMAX before display. Default = 255.

         SIGMA:         The sigma scale factor for Gaussian scaling. Default is 1.0.

         _EXTRA:        Any keywords appropriate for the CATIMAGE SetProperty method.

(See C:\IDL\Catalyst\source\data\scaleimage__define.pro)

## SCALEIMAGE__DEFINE

[Previous Routine] [List of Routines]

     NAME:
           SCALEIMAGE__DEFINE

     PURPOSE:

           The purpose of this routine is to provide a CATIMAGE object that can be scaled or
           stretched. The algorithm for scaling is similar to this (linear scaling is shown):

               image = ORIGINAL_IMAGE
               i = WHERE(image EQ MISSING_VALUE, count)
               IF count GT 0 THEN image[i] = MISSING_COLOR
               image = BytScl(image, MIN=SCLMIN, MAX=SCLMAX, TOP=NCOLORS-1) + BOTTOM

           Scaling or stretching types include: linear, 2% linear, gamma, log, hyperbolic sine,
           square-root, equilization, and gaussian. See this article for additional information:

               http://www.idlcoyote.com/ip_tips/xstretch.php

           Scaling only applies to 2D images. True-color images are not scaled and none
           of the scaling parameters apply to them. Supported methods of scaling are

     AUTHORS:

            FANNING SOFTWARE CONSULTING
            1645 Sheely Drive
            Fort Collins
            CO 80526 USA
            Phone: 970-221-0438
            E-mail: davidf@dfanning.com

     CATEGORY:

           Objects.

     SYNTAX:

           theObject = Obj_New("SCALEIMAGE")

     CATIMAGEES:

           CATIMAGE
           CATATOM
           CATCONTAINER IDLITCOMPONENT
           IDL_CONTAINER

     CLASS_STRUCTURE:

       class = { SCALEIMAGE, $
                 bottom: 0, $                    ; The lowest value in the image.
                 missing_value: Ptr_New(),  $    ; The missing value in the image.
                 missing_color: 0, $             ; The color index for missing colors.
                 ncolors: 0, $                   ; The number of colors to display.
                 sclmin: 0.0D, $                 ; The minimum scale value.
                 sclmax: 0.0D, $                 ; The maximun scale value.
                 gamma: 0.0D, $                  ; The gamma scale factor.
                 beta: 0.0D, $                   ; The beta scale factor.
                 mean: 0.0D, $                   ; The mean scale factor.
                 exponent: 0.0, $                ; The exponent scale factor.
                 scaletype: 0, $                 ; The type of scaling.
                 INHERITS CATIMAGE $
               }

     MESSAGES:

       None.

     MODIFICATION_HISTORY:

           Written by: David Fanning, 27 July 2006.

(See C:\IDL\Catalyst\source\data\scaleimage__define.pro)