Getting Started | Documentation | Glish | Learn More | Programming | Contact Us |
Version 1.9 Build 1488 |
|
Package | general | |
Module | images | |
Tool | image |
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 |
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.
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
You just specify the window directly with the cursor.
Same as the automatic method except that you do the fit interactively.
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.
Thus
- im := image('myimage') - g := im.momentsgui() # Click Dismiss on GUI - g := im.momentsgui() # Get GUI back with some reset
- 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.