Getting Started Documentation Glish Learn More Programming Contact Us
Version 1.9 Build 1488
News FAQ
Search Home


next up previous contents index
Next: image.name - Function Up: image - Tool Previous: image.moments - Function


image.momentsgui - Function



Package general
Module images
Tool image


Compute moments from image via custom GUI interface


Synopsis
momentsgui(parent, widgetset)


Arguments

parent in Parent frame to embed GUI in
    Allowed: GlishTk agent
    Default: Create stand alone
widgetset in The widgetset to use for the GUI
    Allowed: A widgetserver tool
    Default: dws


Returns
Agent or fail



Description


General

The moments function takes rather a lot of inputs, and the need for some of them is context dependent. This makes the command-line interface rather cumbersome to use. Therefore, this function provides a GUI interface to the moments function. This interface constrains your actions by disabling appropriate parts of the GUI depending upon what you choose to do. When you invoke this function, it will need to find the minimum and maximum values in your image, so function statistics is automatically run (this may cause you to see a progress meter).

Here is an example of the GUI.

Figure 1.2: The moments GUI
\begin{figure}
\begin{center}
\epsfig{file=imagemomentsgui.ps, width=4.5in}\end{center}\end{figure}

The GUI is arranged into several `rollups'. The first one, `basic settings', contains the basic parameters you need to set. Other rollups are `convolution', `data selection' and `plotting'. See moments for descriptions of the parameters contained in these.

If you don't provide a parent frame (the parent argument), the GUI is made in a standalone mode. This means it creates go, reset and dismiss buttons. If you provide the parent frame, you must also provide the buttons and act on them.

The primary mechanism for the context dependent disabling and enabling is the choice of method found in the `basic settings' rollup. This presents all of the possible method choices via a multi-level menu (this is different from the moments function where you give a string containing up to three substrings, the combination of which dictates the method). Although this menu has several levels, it makes it unamibiguous as to what you are doing.

The methods are

  • Basic method. This means the pixels are simply selected via a pixel inclusion or exclusion (or all) range. Optionally, you may apply the pixel range to the smoothed image. This produces a mask which is applied to the unsmoothed data.

  • Window methods. The window method selects pixels in a coordinate range which surrounds the spectral feature of interest. The window can be found from the smoothed or unsmoothed data, but the moments are always computed from the unsmoothed data.

    • Automatic methods. The automatic methods do not allow you to interact with the process.

      • Window, automatic, converging mean method. This is Albert Bosma's algorithm. An initial guess for a range of pixels surrounding a spectral feature is refined by widening until the mean of the pixels outside of the range converges (to the noise).

      • Window, automatic, fit gaussian method. The window is found by fitting a Gaussian to the spectral feature and by taking a coordinate range of $ \pm$3$ \sigma$ around the centre of the line.

    • Interactive methods. The interactive methods allow you to interact with the process. They are very user intensive !

      • Window, interactive, direct method.

        You just specify the window directly with the cursor.

      • Window, interactive, fit gaussian method.

        Same as the automatic method except that you do the fit interactively.

  • Fit methods. The fit methods fit a model to the spectrum. The moments are worked out from the fit, not the actual data.

    • Fit gaussian, automatic method. The fits are done without user interaction.

    • Fit gaussian, interactive method. The user interacts with the fitting process.

You will also find context dependent disabling and enabling when you select some of the convolution parameters; this interacts with parameters in ``data selection''. In particular, the idea of the convolution is to make a mask by selecting pixels from the convolved data. Therefore you must make a pixel inclusion or exclusion selection. Also, the median coordinate moment is only available with the basic method, so it is disabled for other methods.

The combination of a context dependent GUI and as much error checking as possible in the GUI, means you should not often have the underlying C++ application complain to you that you have not set some parameter.


Recovering the GUI

When you run this function, it returns an agent which is actually a reference to the underlying GUI. In addition, the GUI is left on the screen. You can explicitly dismiss it by pressing the Dismiss button or selecting Dismiss from the File menu. To recover the GUI you can do one of two things.

1.
Run the command momentsgui again. This will return another reference of the GUI to you. However, it will reset some parts of the GUI because it is possible that the image changed since you last ran this function (the pixel values might have changed, it might even be a different image file attached to this tool).

Thus

- im := image('myimage')
- g := im.momentsgui()             # Click Dismiss on GUI
- g := im.momentsgui()             # Get GUI back with some reset

2.
Apply the gui function to the reference returned when you ran the momentsgui function. This simply recovers the GUI with no resetting. If the image has changed, this will not reflect it.

- im := image('myimage')
- g := im.momentsgui()             # Click Dismiss on GUI
- g.gui()                          # Get GUI back with no change

If you destroy the GUI (by selecting Done from the File menu) then you must run the momentsgui function again to regenerate it.





next up previous contents index
Next: image.name - Function Up: image - Tool Previous: image.moments - Function   Contents   Index
Please send questions or comments about AIPS++ to aips2-request@nrao.edu.
Copyright © 1995-2000 Associated Universities Inc., Washington, D.C.

Return to AIPS++ Home Page
2006-08-01