Go up one levelGo to Previous Go to Next

RtdImage(n)

NAME

 
 RtdImage - itcl widget wrapper for the rtdimage type extension

NAMESPACE

 
 rtd

PARENT CLASS

 
 util::FrameWidget

SYNOPSIS

 
 RtdImage <path> ?options?

DESCRIPTION

 
 The RtdImage widget is an [incr Tk] interface to the rtdimage extended
 Tk image type. The widget creates a canvas window with optional
 scrollbars and a canvas image item to hold the image. An optional
 canvas line graphics editor is also created by default, to manage
 drawing on the image.  The RtdImage widget can be treated pretty much
 like any standard Tk widget and can be inserted in a Tk frame with the
 pack(n) command. Applications using the RtdImage widget, can access the
 underlying image object and the canvas window to overlay graphics on
 the image.

 In addition to the methods below, this class also forwards methods
 implemented in the C++ rtdimage code. It is, however, usually more
 efficient to use the "get_image" method to get a handle for the
 internal rtdimage object and use it directly.


ITK COMPONENTS

 
 canvas
        Tk canvas containing the image.

 draw
        CanvasDraw(n) object, used to manage the canvas graphics.

 hscroll
        Optional horizontal scrollbar.

 hscrollf
        Horizontal scrollbar frame.

 imagef
        Frame to hold image and scrollbars.

 vscrollf
        Vertical scrollbar frame.

STANDARD OPTIONS

 
 -borderwidth -canvasbackground -canvasborderwidth -canvasheight
 -canvasrelief -canvaswidth -relief

WIDGET OPTIONS

 
 -cmap_dir
        Colormap initialization and directory for colormap and ITT files.

 -cmap_suffix
        Suffix for colormap files.

 -color_scale
        Set the default color scale algorithm to one of: {linear log sqrt
        histeq}.

 -cursor
        Default cursor.

 -debug
        Debugging flag.

 -default_cmap
        Default cmap file.

 -default_itt
        Default ITT file.

 -displaymode
        Set displaymode flag 0 to optimize for smooth scrolling, 1 for
        faster updates and less memory (works best for main image).

 -drag_scroll
        Flag: if true, set bindings to scroll with the middle mouse
        button.

 -file
        Fits image file to display.

 -fitheight
        If non-zero, shrink image to fit height.

 -fits
        For compatibility with saoimage.

 -fitwidth
        If non-zero, shrink image to fit width.

 -graphics
        Flag: if true, create a CanvasDraw object to manage the canvas
        graphics.

 -itt_suffix
        Suffix for ITT files.

 -max_colors
        Specify the max number of colors to allocate before using a
        private colormap. Note: this option is currently ignored.

 -max_scale
        Maximum allowed scale value.

 -min_colors
        Specify the min number of colors to allocate before using a
        private colormap. Note: this option is currently ignored.

 -min_scale
        Minimum allowed scale value.

 -name
        -name option.

 -newimagecmd
        Command to eval when a new image is loaded.

 -pickobjectorient
        -orient option for Pick Object window.

 -rapid_frame_command
        Optional tcl command to be evaluated when a rapid frame is
        created, moved, resized or deleted: 6 args will be appended:

         name = unique name for the frame op  = {move,resize or delete},
         x, y = coords of upper left corner of frame in image width,
         height = dimensions of frame.

 -regioncommand
        Tcl command to evaluate whenever a "region" of the image is
        selected via the graphic toolbox "region" selection item. Can be
        used to select graphic items or a section of the image for an
        operation.

 -scrollbars
        Flag: if true, display horizontal and vertical scrollbars.

 -shelp
        Short help text.

 -shm_data
        This flag controls whether the FITS image data is kept in SysV
        shared memory (see the rtdRemote interface for use of this).

 -shm_header
        This flag controls whether the FITS image header is kept in SysV
        shared memory (see the rtdRemote interface for use of this).

 -shorthelpwin
        Optionally specify TopLevelWidget to display short help messages.

 -show_object_menu
        Flag: if true, display menus over graphic objects when selected
        with <3>.

 -subsample
        Flag: if true, use quick and dirty algorithm to shrink images.

 -usexshm
        X shared memory option.

 -usexsync
        X synchronisation option.

 -verbose
        Flag: if true, print diagnostic messages.

 -with_warp
        Option to warp the mouse pointer.

 -withtoolbox
        If true (default) create the GUI interface (toolbox), otherwise
        don't.

 -zoomwin
        Name of zoom window to update when mouse enters this window.

PUBLIC METHODS

 
 attach_camera {camera}
        Attach the named camera. .

 center {}
        Center the image in the canvas window.

 clear {}
        Clear the current image display and remove an windows that access
        it.

 delete_rapid_frame {}
        Delete the rapid frame.

 detach_camera {}
        Stop the camera.  note: race conditions might cause display to lag
        behind the socket data.  force an update here.

 flip {xy bool}
        Flip or unflip the image and canvas items about the x or y axis,
        as given by $xy.

 get_canvas {}
        Return the name of the underlying canvas widget.

 get_image {}
        Return the name of the underlying rtdimage object.

 get_imageId {}
        Return the canvas Id for the image.

 hide_graphics {variable}
        Toggle the visibility of the line graphics (The trace variable
        name is passed here, if 1, hide the graphics...).

 maybe_center {}
        If the image is smaller than the canvas window, center it .

 perftest {}
        Set the performance test mode on or off.

 pick_dialog {{command ""}}
        Display a dialog for selecting objects in the image and displaying
        information about the selected area of the image.

 pixel_table {nrows ncols}
        Popup a window to display a table of nrows x ncols pixel values
        from the image.

 preview {var}
        Set preview mode on or off in the image. In this case, the arg is
        the "name" of a global variable controlling the preview mode. It
        will be kept up to date by this class.

 print {}
        Make a hard copy of the image display.

 rapid_frame {popup}
        Arrange to interactively create a rapid frame to display a section
        of the image.  If popup is 1, the frame is displayed in a popup
        window, otherwise at the selected position in the canvas.

 record {camera}
        Methods for the playing and recording of images.

 reopen {}
        Reload the image file, if there is one.

 rotate {bool}
        Toggle rotation of the image and canvas items.

 save_as {{dir "."} {pattern "*"} {x0 ""} {y0 ""} {x1 ""} {y1 ""}}
        Save the current image or a section of the current image to a file
        in FITS format chosen from a file name dialog. If dir and pattern
        are specified, they are used as defaults for the file selection
        dialog.  If x0, y0, x1 and y1 are specified (canvas coordinates),
        then a section of the image is saved.

        The return value is the name of the new file, if any, or an empty
        string.

 save_region_as {}
        Save a section of the current image to a file in FITS format
        chosen from a file name dialog.

 scale {x y}
        Resize the image and the canvas graphics by the given integer
        factors (1 is no scale, -2 = 50%, 2 = 200% etc...) - deselect
        canvas graphics (so handles don't get scaled).

 set_rtd_wcs_info {frameid}
        Set up world coordinate info for an image received from the
        rtdServer.

 show_toolbox {}
        Display the toolbox window.

 spectrum {}
        Arrange to interactively create a spectrum line to display a graph
        of the image values along a given line.

PROTECTED METHODS

 
 camera_post_command {frameid}
        This method is called whenever a new image has been received from
        the camera and displayed.  Update the widgets that need to display
        new values The frameid will be 0 for the main image and non-zero
        for a rapid frame.

 camera_pre_command {frameid}
        This method is called when a new image has been received from the
        camera and before it is displayed.  The frameid will be 0 for the
        main image and non-zero for a rapid frame.

 focus_ {way}
        Control the focussing of the canvas. Only take focus if the
        top-level window associated with this canvas has the focus (i.e.
        it's not in another toplevel somewhere). If this isn't done then
        mysterious raises of the main image window can occur with some
        window managers (mainly CDE, with click-to-focus).

        allan: 19.6.98: disabled the above behavior, since it causes
        problems with mouse warping and confuses people. Can't verify the
        CDE behavior...

 imageconfig_ {option}
        Utility to update an option in the image Note: this works
        automatically with "widgets", but itk doesn't work with
        "images"...

 init {}
        This method is called from the base class (TopLevelWidget) after
        all the options have been evaluated.

 load_fits_ {}
        Load a FITS file (internal version: use -file option/public
        variable).

 make_rapid_frame {popup region_id x0 y0 x1 y1}
        Create a rapid frame to display a section of the image.  If popup
        is 1, the frame is displayed in a popup window, otherwise at the
        selected position in the canvas "region_id" is the canvas id of
        the object used to position and resize the image.

 make_spectrum {line_id x0 y0 x1 y1}
        Create a graph to display the image data values along the line
        just created.  "line_id" is the canvas id of the line.

 make_toolbox {}
        Make the graphics toolbox and menu.

 new_image_cmd {}
        This method is called by the image code whenever a new image is
        loaded (for updates, see camera command).

 picked_wcs_object {x y ra dec {equinox J2000} {fwhmX ""} {fwhmY ""}
            \ {angle ""} {object ""} {background ""}}
        This method can be used in bindings to cause a selection in the
        image (to pick an object/star) to return the given position rather
        than the calculated center pos. If the optional args are not
        specified, they are calculated.

 restore_scroll_pos_ {}
        Restore the relative scrolling positions.

 save_region {canvas_id x0 y0 x1 y1}
        Save the given section of the current image to a file in FITS
        format chosen from a file name dialog. The canvas_id is the id if
        the canvas object used to select the region . The canvas
        coordinates of the region are also passed as arguments.

 save_scroll_pos_ {}
        Save the current scrolling positions.

 set_drawing_area {}
        Update the allowed interactive drawing area in the canvas.

 set_scrollregion {x0 y0 x1 y1}
        Set the canvas scrollregion .

PROTECTED VARIABLES

 
 canvas_
        Canvas widget.

 imageId_
        Canvas Id for image.

 image_
        Internal rtd image .

 perftest_var_
        Name of a global variable controlling performance test mode.

 preview_var_
        Name of a global variable controlling preview mode.

 xScroll0_
        Saved x0 relative scrolling position.

 xScroll1_
        Saved x1 relative scrolling position.

 yScroll0_
        Saved y0 relative scrolling position.

 yScroll1_
        Saved y1 relative scrolling position.

COMMON CLASS VARIABLES

 
 colormap_initialized_
        Flag: true if the colormap has been initialized.

SEE ALSO

 
 FrameWidget(n)

 


- - - - - -
Last change: 07 May 99

 


Go up one levelGo to Previous Go to Next

Please send questions or comments to abrighto@eso.org.
Copyright © 1998 ESO - European Southern Observatory