itom methods

Plotting and camera

itom.liveImage(cam[, className]) → shows a camera live image in a newly created figure

Creates a plot-image (2D) and automatically grabs images into this window. This function is not blocking.

Parameters :

cam : {dataIO-Instance}

Camera grabber device from which images are acquired.

className : {str}, optional

class name of desired plot (if not indicated default plot will be used (see application settings)

itom.plot(data[, className]) → plots a dataObject in a newly created figure

Plot an existing dataObject in not dockable, not blocking window. The style of the plot will depend on the object dimensions. If x-dim or y-dim are equal to 1, plot will be a lineplot else a 2D-plot.

Parameters :

data : {DataObject}

Is the data object whose region of interest will be plotted.

className : {str}, optional

class name of desired plot (if not indicated default plot will be used (see application settings)

Using algorithms and filters

itom.filter(name[, furtherParameters, ...]) → invoke a filter (or algorithm) function within an algorithm-plugin.
Parameters :

name : {str}

The name of the filter

furtherParameters : {variant}

Further parameters depend on the filter-methods itself (give the mandatory and then optional parameters in their defined order).

Returns :

output parameters : {variant}

The returned values depend on the definition of each filter. In general it is a tuple of all output parameters that are defined by the filter function.

Notes

This function is used to invoke itom filter-functions or algorithms, declared within itom-algorithm plugins. The parameters (arguments) depends on the specific filter function (see filterHelp(name)), By filterHelp() a list of available filter functions is retrieved.

Methods for getting help and information about filters, plugins, ui-elements, ...

itom.pluginHelp(pluginName[, dictionary = False]) → generates an online help for the specified plugin.

Gets (also print to console) the initialisation parameters of the plugin specified pluginName (str, as specified in the plugin window). If dictionary is True, a dict with all plugin parameters is returned.

Parameters :

pluginName : {str}

is the fullname of a plugin as specified in the plugin window.

dictionary : {bool}, optional

if dictionary == True, function returns an dict with plugin parameters (default: False)

Returns :

Returns None or a dict depending on the value of parameter dictionary. :

itom.widgetHelp([widgetName, dictionary = 0, furtherInfos = 0]) → generates an online help for the given widget(s).

Generates an online help for the given widget or returns a list of available widgets.

Parameters :

widgetName : {str}, optional

is the fullname or a part of any widget-name which should be displayed. If widgetName is none or no widget matches widgetName casesensitiv a list with all suitable widgets is given.

dictionary : {dict}, optional

if dictionary == 1, function returns an Py_Dictionary with parameters Default value is 0.

furtherInfos : {int}, optional

defines if a complete parameter-list of name-related widgets to the given widgetName should be displayed (1)

Returns :

Returns none or a PyDictionary depending on the value of dictionary. :

itom.filterHelp([filterName, dictionary = 0, furtherInfos = 0]) → generates an online help for the given filter(s).

Generates an online help for the given widget or returns a list of available filter.

Parameters :

filterName : {str}, optional

is the fullname or a part of any filter-name which should be displayed. If filterName is none or no filter matches filterName casesensitiv a list with all suitable filters is given.

dictionary : {dict}, optional

if dictionary == 1, function returns an Py_Dictionary with parameters Default value is 0.

furtherInfos : {int}, optional

defines if a complete parameter-list of name-related filters to the given filterName should be displayed (1)

Returns :

Returns none or a PyDictionary depending on the value of dictionary. :

itom.pluginLoaded(pluginname) → checks if a certain plugin was loaded.

Checks if a specified plugin is loaded and returns the result as a boolean expression.

Parameters :

pluginname : {str}

The name of a specified plugin as usually displayed in the plugin window.

Returns :

True, if the plugin has been loaded and can be used, else False. :

itom.version([toggle-output [, include-plugins]])) → retrieve complete information about itom version numbers
Parameters :

toggle-output : {bool}, optional

default = false if true, output will be written to a dictionary else to console.

dictionary : {bool}, optional

default = false if true, add informations about plugIn versions.

Returns :

None (display outPut) or PyDictionary with version information. :

Notes

Retrieve complete version information of ITOM and if specified version information of loaded plugins and print it either to the console or to a PyDictionary.

Adding elements to the GUI

itom.addButton(toolbarName, buttonName, code[, icon, argtuple]) → adds a button to a toolbar in the main window
Parameters :

toolbarName : {str}

The name of the toolbar.

buttonName : {str}

The name (str, identifier) of the button to create.

code : {str, Method, Function}

The code to be executed if button is pressed.

icon : {str}, optional

The filename of an icon-file. This can also be relative to the application directory of ‘itom’.

argtuple : {tuple}, optional

Arguments, which will be passed to method (in order to avoid cyclic references try to only use basic element types).

Notes

This function adds a button to a toolbar in the main window. If the button is pressed the simple python command specified by python-code is executed. If the toolbar specified by toolbarName do not exist, the toolbar is created. The button representation will be the optional icon or if icon is not loadable ‘buttonName’ will be displayed.

ITOM comes with basic icons addressable by ‘:/.../iconname.png’, e.g. ‘:/gui/icons/close.png’. Find available via iconbrower under ‘Editor-Menu/Edit/iconbrower’ or crtl-b

itom.removeButton(toolbarName, buttonName) → removes a button from a given toolbar.
Parameters :

toolbarName : {str}

The name of the toolbar.

buttonName : {str}

The name (str, identifier) of the button to remove.

Notes

This function removes a button from a toolbar in the main window. If the toolbar is empty after removal, it is deleted.

itom.addMenu(type, key[, name, code, icon, argtuple]) → adds an element to the menu bar.
Parameters :

type : {Int}

The type of the menu-element (BUTTON:0 [default], SEPARATOR:1, MENU:2). Use the corresponding constans in module ‘itom’.

key : {str}

A slash-separated string where every sub-element is the key-name for the menu-element in the specific level.

name : {str}, optional

The text of the menu-element. If not indicated, the last sub-element of key is taken.

code : {str, Method, Function}, optional

The code to be executed if menu element is pressed.

icon : {str}, optional

The filename of an icon-file. This can also be relative to the application directory of ‘itom’.

argtuple : {tuple}, optional

Arguments, which will be passed to method (in order to avoid cyclic references try to only use basic element types).

Notes

This function adds an element to the main window menu bar. The root element of every menu-list must be a MENU-element. Such a MENU-element can contain sub-elements. The following sub-elements can be either another MENU, a SEPARATOR or a BUTTON. Only the BUTTON itself triggers a signal, which then executes the code, given by a string or a reference to a callable python method or function. Remember, that this reference is only stored as a weak pointer. If you want to directly add a sub-element, you can give a slash-separated string in the key-parameter. Every sub-component of this string then represents the menu-element in its specific level. Only the element in the last can be something else than MENU.

ITOM comes with basic icons addressable by ‘:/.../iconname.png’, e.g. ‘:/gui/icons/close.png’. Find available via iconbrower under ‘Editor-Menu/Edit/iconbrower’ or crtl-b

itom.removeMenu(key) → remove a menu element with the given key.
Parameters :

key : {str}

The name (str, identifier) of the menu entry to remove.

Notes

This function remove a menu element with the given key. key is a slash separated list. The sub-components then lead the way to the final element, which should be removed.

For more information about using these methods, see Customize the menu and toolbars of itom.

Disk-IO

itom.loadDataObject(filename, dataObject[, doNotAppendIDO]) → load a dataObject from the harddrive to an existing dataObject.
Parameters :

filename : {str}

Filename and Path of the destination (.ido will be added if not available)

dataObject : {DataObject}

A pre-allocated dataObject (empty Objects are allowed).

doNotAppendIDO : {bool}, optional

Optional tag to avoid adding -ido-Tag, default is False.

Notes

This function reads an ito::dataObject from the file specified by filename. MetaData saveType (string, binary) are extracted from the file and restored within the object. The value of string-Tags must be encoded to avoid XML-conflics. Tagnames which contains special characters leads to XML-conflics.

itom.saveDataObject(filename, dataObject[, tagsAsBinary]) → save a dataObject to harddrive.
Parameters :

filename : {str}

Filename and Path of the destination (.ido will be added if no .*-ending is available)

dataObject : {DataObject}

An allocated dataObject of n-Dimensions.

tagsAsBinary : {bool}, optional

Optional tag to toogle if numeric-tags should be saved (metaData) as binary or by default as string.

Notes

This function writes an ito::dataObject to the file specified by filename. The data is stored as binary. The value of string-Tags is encoded to avoid XML-conflics. The value of numerical-Tags are saved as string with 15 significat digits (>32bit, tagsAsBinary == False, default) or as binary (tagsAsBinary == True). Tagnames which contains special characters leads to XML-conflics.

itom.loadMatlabMat(filename) → loads matlab mat-file by using scipy methods and returns the loaded dictionary.
Parameters :

filename : {str}

Filename from which the data will be imported (.mat will be added if not available)

Returns :

PyDictionary with content of the Matlab-file :

Notes

This function loads matlab mat-file by using scipy methods and returns the loaded dictionary.

itom.saveMatlabMat(filename, dictionary[, matrixName]) → saves strings, numbers, arrays or combinations to a Matlab matrix.
Parameters :

filename : {str}

Filename to which the data will be written (.mat will be added if not available)

dictionary : {dictionary, list, tuple}

dictionary, list or tuple with elements of type number, string, array (dataObject, numpy.ndarray, npDataObject...)

matrix-name : {string or list or tuple of strings}, optional

string or list or tuple of string (same length than object-sequence)

Notes

This function saves strings, numbers, arrays or combinations to a Matlab matrix (file). List or Tuples will be included to new dictionary (element-wise entry with name matrix1,...,matrixN or names given by last optional matrix-name sequence).

itom.loadIDC(filename) → loads a pickled idc-file and returns the content as dictionary

This methods loads the given idc-file using the method load from the python-buildin module pickle and returns the loaded dictionary.

Parameters :

filename : {String}

absolute filename or filename relative to the current directory.

See also

pickle.load

itom.saveIDC(filename, dict[, overwriteIfExists = True]) → saves the given dictionary as pickled idc-file.

This method saves the given dictionary as pickled icd-file using the method dump from the builtin module pickle.

Parameters :

filename : {string}

absolute filename or filename relative to the current directory.

dict : {dict}

dictionary which should be pickled.

overwriteIfExists : {bool}, default: True

if True, an existing file will be overwritten.

See also

pickle.dump

Debug-Tools

itom.gcEndTracking() → compares the current object list of the garbage collector with the recently saved list.
itom.gcStartTracking() → stores the current object list of the garbage collector.
itom.getDebugger() → returns new reference to debugger instance

Further commands

itom.scriptEditor() -> opens new, empty script editor window (undocked)

Notes

Opens a new and empty itom script editor window. The window is undocked and non blocking.

itom.openScript(filename) → opens the given script in current script window.
Parameters :

filename : {str}

Path and File of the file to open. Unter windows not case sensitiv.

Notes

Open an existing itom script from the harddrive into the latest opened editor window.

itom.newScript() → opens an empty, new script in the current script window.

Notes

Creates a new itom script in the latest opened editor window.

itom.setCurrentPath(newPath) → sets absolute path of current working directory
Parameters :

newPath : {str}

The new working path of this application

Returns :

Success : {bool}

True in case of success else False

Notes

sets absolute path of current working directory returns True if currentPath could be changed, else False.

itom.getAppPath() → returns absolute path of application base directory.
Returns :

Path : {str}

string with absolute path of this application

Notes

This function returns the absolute path of application base directory. The return value is independent of the current working diractory

itom.getCurrentPath() → returns absolute path of current working directory.
Returns :

Path : {str}

string with current working path

Notes

This function returns the current working path of the application.

itom.getScreenInfo() → returns dictionary with information about all available screens.
Returns :

ScreenInfo : {PyDict}

Returns a PyDictionary containing:

screenCount : {int}

number of available screens

primaryScreen : {int}

index (0-based) of primary screen

geometry : {tuple}

tuple with dictionaries for each screen containing data for width (w), height (h) and its top-left-position (x, y)

Notes

This function returns a PyDictionary which contains informations about the current screen configuration of this PC.

itom.getDefaultScaleableUnits()

getDefaultScaleAbleUnits() -> Get a PythonList with standard scaleable units.

Returns :List with strings containing all scaleable units : {PyList}

Notes

Get a PythonList with standard scaleable units. Used together with itom.ScaleValueAndUnit(...)

itom.scaleDoubleUnit()

ScaleValueAndUnit(ScaleableUnits, value, valueUnit) -> Scale a value and its unit and returns [value, ‘Unit’]

Parameters :

ScaleableUnits : {PyList of Strings}

A string list with all scaleable units

value : {double}

The value to be scaled

valueUnit : {str}

The value unit to be scaled

Returns :

PyTuple with scaled value and scaled unit :

Notes

Rescale a value with SI-unit (e.g. 0.01 mm to 10 micrometer). Used together with itom.getDefaultScaleAbleUnits()

Another possibility to add methods to this page is to use the auto-summary function. Since, the default-role property in conf.py is set to ‘autolink’ and the auto-summary module is included, small pages will be automatically created for each method in the following list and a hyperlink to this site is created:

With method signature:

itom.widgetHelp(([widgetName, ...) Generates an online help for the given widget or returns a list of available widgets.
itom.pluginHelp((pluginName [, ...) Gets (also print to console) the initialisation parameters of the plugin specified pluginName (str, as specified in the plugin window).
itom.filterHelp(([filterName, ...) Generates an online help for the given widget or returns a list of available filter.

Without method signature:

itom.liveImage((cam, ...) Creates a plot-image (2D) and automatically grabs images into this window.
itom.plot((data, ...) Plot an existing dataObject in not dockable, not blocking window.