CImageView Class


The CImageView class wraps a Mira image view window that displays images. The Image View window uses an image set to work with a group of images. This class encloses a pointer to the view window and provides methods for displaying and adjusting images and for working with the image cursor.

Executing Scripts from Image Windows

The Execute Script menu command may be used to open and execute a script directly from a Mira Image Window. When a script is executed from the Execute Script command, it is automatically sent a CImageView object named ParentImageView and a CImage object named ParentImage. The ParentImageView is a CImageView object that provides access to the window's CImageSet member and other class members. The ParentImage is a CImage object attached to the current image in the Image Window. You can use these names directly in the script or you can rename them, like V = ParentImageView andI = ParentImage. A sample script call to be called from an Image Window is provided named Execute from Image Window test.lua.

Usage

Construction

Object = new_imageview()

Object = attach_imageview()

Object = attachlist_imageview()

Object = CImageView:new()

Object = CImageView:Attach()

Object = CImageView:AttachFromList()

Destruction

Object:delete()

Creation - Non-class Functions

These functions are normally used to create and attach a new CImageView object as an alternative to the class-based construction methods.

new_imageview

Creates a new instance of the CImageView class.

attach_imageview

Creates a new CImageView object attached to the top-most image window on the Mira desktop. This is equivalent to the Attach class method.

attachlist_imageview

Creates a new CImageView object attached to a image editor window selected from a list of windows on the Mira desktop. This is equivalent to the AttachFromList class method.

Construction and Destruction - Class Methods

new

Creates a new CImageView object. This is the global script counterpart of the GetParent method.

delete

Deletes the CImageView object.

Attach

Creates a new CImageView object attached to the top-most image window on the Mira desktop. This is equivalent to the Attach class method.

AttachFromList

Creates a new CImageView object attached to a image editor window selected from a list of windows on the Mira desktop. This is equivalent to the AttachFromList class method.

Close

Closes the CImageView window

Image Display Methods

Append

Appends the CImage object to the image view window's image set, making it the last image in the image set. Creates a new image view window if necessary.

Display

Creates a new image view window and displays a CImage object in it.

Insert

Inserts the CImage object into the image set at a specified index and displays the image. Creates a new window if necessary.

SaveUndo

Saves an "undo" copy of the image before making changes.

Undo

Restores the "undo" copy of the image.

SaveUndoAll

Saves an "undo" copy of the entire image set before changes.

UndoAll

Restores the "undo" copy of the entire image set.

Update

update the display after changing an image.

UpdateAll

update the display of all images in the window.

Image Set Operations

Count

Returns the number of images in the image set used by the image view window.

First

Indexes the image set to the first image.

GetImage

Creates and returns a CImage object for the view image at a specified index.

GetImageSet

Returns a copy of the CImageView's image set as a new CImageSet object.

GetIndex

Returns the image set index of the CImage object in the image set of the image view window.

Last

Indexes the image set to the last image.

Next

Indexes the image set to the next image.

Prev

Indexes the image set to the previous image.

Remove

Removes the CImage from the image set and deletes it from memory.

SetIndex

Indexes the image set to a specified position.

SwapNext

Swaps the CImage object with the next image in the image set of the view window.

SwapPrev

Swaps the CImage object with the previous image in the image set of the view window.

Image Cursor

GetCursorPos

Returns the cursor center position in pixel coordinates.

GetCursorRect

Returns a CRect object that describes the image cursor.

SetCursorExtent

Sets the image cursor rectangle using (left, top, right, bottom) in pixel coordinates.

SetCursorHeight

Sets the height of the image cursor, in pixels.

SetCursorPos

Centers the image cursor to pixel coordinate x,y.

SetCursorPosWcs

Centers the image cursor at world coordinate x,y.

SetCursorRect

Sets the image cursor using a CRect object in pixel coordinates.

SetCursorStyle

Sets the image cursor style.

SetCursorWidth

Sets the width of the image cursor, in pixels.

Window Operations

CenterAt

Centers the image at pixel coordinate x,y.

CenterAtWcs

Centers the image at world coordinate x,y.

GetGraphSet

Returns the graph one/all flag for the image set of the image view window.

GetMeasureSet

Returns the measure one/all flag for the image set of the image view window.

GetProcessSet

Returns the process one/all flag for the image set of the image view window.

GetZoom

Returns the image zoom value.

GraphSet

Sets the graph one/all flag for the image set in the image view window.

MeasureSet

Sets the measure one/all flag for the image set in the image view window.

ProcessSet

Sets the process one/all flag for the image set in the image view window.

SetZoom

Sets the image zoom value.

SetFlipFITS

Sets the option for flipping FITS image display.

GetFlipFITS

Gets the current state of the FITS flip flag.

GetPlotAvgMode

Returns the column/row averaging flag for making cursor plots.

SetPlotAvgMode

Sets the cursor plot averaging mode to mean, median, or sum.

Related Topics

Script Classes, Contents, CImage class, CRect class, CLabels class, CPlotView


Mira Pro x64 Script User's Guide, Copyright Ⓒ 2023 Mirametrics, Inc. All Rights Reserved.