9.1. itom methods

This section shows the spezial itom methods.

9.1.1. Plotting and camera

Camera plugins have the special method liveImage.

itom.close(handle|'all') -> method to close any specific or all open figures (unless any figure-instance still keeps track of them)

This method closes and deletes any specific figure (given by handle) or all opened figures. This method always calls the static method figure.close.

Parameters

handle : {dataIO, str}

any figure handle (>0) or ‘all’ in order to close all opened figures

See also

figure.close

Notes

If any instance of class ‘figure’ still keeps a reference to any figure, it is only closed and will be deleted after that the last referencing instance has been deleted.

itom.liveImage(cam, className='', properties={}) → show a camera live image in a new figure

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

If no ‘className’ is given, the type of the plot is chosen depending on the type and the size of the object. The defaults for several plot classes can be adjusted in the property dialog of itom.

You can also set a class name of your preferred plot plugin (see also property dialog of itom). If your preferred plot is not able to display the given object, a warning is returned and the default plot type is used again. For dataObjects, it is also possible to simply set ‘className’ to ‘1D’ or ‘2D’ in order to choose the default plot type depending on these aliases.

Every plot has several properties that can be configured in the Qt Designer (if the plot is embedded in a GUI), or by the property toolbox in the plot itself or by using the info() method of the corresponding itom.uiItem instance.

Use the ‘properties’ argument to pass a dictionary with properties you want to set to a certain value.

Parameters

cam : {dataIO-Instance}

Camera grabber device from which images are acquired.

className : {str}, optional

class name of desired plot (if not indicated or if the className can not be found, the default plot will be used (see application settings)

properties : {dict}, optional

optional dictionary of properties that will be directly applied to the plot widget.

Returns

index : {int}

This index is the figure index of the plot figure that is opened by this command. Use figure(index) to get a reference to the figure window of this live image plot. The plot can be closed by ‘close(index)’.

plotHandle: {plotItem} :

Handle of the live image plot. This handle is used to control the properties of the plot, connect to its signals or call slots of the plot.

See also

plot, plotItem

itom.plot(data, className='', properties={}) → plots a dataObject, pointCloud or polygonMesh in a new figure

Plots an existing dataObject, pointCloud or polygonMesh in a dockable, not blocking window. The style of the plot depends on the object dimensions.

If no ‘className’ is given, the type of the plot is chosen depending on the type and the size of the object. The defaults for several plot classes can be adjusted in the property dialog of itom.

You can also set a class name of your preferred plot plugin (see also property dialog of itom). If your preffered plot is not able to display the given object, a warning is returned and the default plot type is used again. For dataObjects, it is also possible to simply set ‘className’ to ‘1D’, ‘2D’ or ‘2.5D’ in order to choose the default plot type depending on these aliases. For pointCloud and polygonMesh only the alias ‘2.5D’ is valid.

Every plot has several properties that can be configured in the Qt Designer (if the plot is embedded in a GUI), or by the property toolbox in the plot itself or by using the info() method of the corresponding itom.uiItem instance.

Use the ‘properties’ argument to pass a dictionary with properties you want to set.

Parameters

data : {DataObject, PointCloud, PolygonMesh}

Is the data object, point cloud or polygonal mesh, that will be plotted.

className : {str}, optional

class name of desired plot (if not indicated or if the className can not be found, the default plot will be used (see application settings))

Depending on the object, you can also use ‘1D’, ‘2D’ or ‘2.5D’ for displaying the object in the default plot of the indicated categories. If nothing is given, the plot category is guessed from ‘data’.

properties : {dict}, optional

optional dictionary of properties that will be directly applied to the plot widget.

Returns

index : {int}

This index is the figure index of the plot figure that is opened by this command. Use figure(index) to get a reference to the figure window of this plot. The plot can be closed by ‘close(index)’.

plotHandle: {plotItem} :

Handle of the plot. This handle is used to control the properties of the plot, connect to its signals or call slots of the plot.

itom.plot1(data, xData=None, className='', properties={}) → plots a dataObject as an 1d plot in a new figure

Plots an existing dataObject in a dockable, not blocking window.

If a xData is given, the plot uses this vector for the values of the x axis of the plot.

The plot type of this function is ‘1D’.

Every plot has several properties that can be configured in the Qt Designer (if the plot is embedded in a GUI), or by the property toolbox in the plot itself or by using the info() method of the corresponding itom.uiItem instance.

Use the ‘properties’ argument to pass a dictionary with properties you want to set.

Parameters

data : {DataObject}

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

xData : {DataObject}, optional

Is the data object whose values are used for the axis.

className : {str}, optional

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

properties : {dict}, optional

optional dictionary of properties that will be directly applied to the plot widget.

Returns

index : {int}

This index is the figure index of the plot figure that is opened by this command. Use figure(index) to get a reference to the figure window of this plot. The plot can be closed by ‘close(index)’.

plotHandle: {plotItem} :

Handle of the plot. This handle is used to control the properties of the plot, connect to its signals or call slots of the plot.

itom.plot2(data, properties={}) → plots a dataObject in a new figure

Plots an existing dataObject in a dockable, not blocking window. The style of the plot depends on the object dimensions.

The plot type of this function is ‘2D’.

Every plot has several properties that can be configured in the Qt Designer (if the plot is embedded in a GUI), or by the property toolbox in the plot itself or by using the info() method of the corresponding itom.uiItem instance.

Use the ‘properties’ argument to pass a dictionary with properties you want to set to a certain value.

Parameters

data : {DataObject}

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

className : {str}, optional

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

properties : {dict}, optional

optional dictionary of properties that will be directly applied to the plot widget.

Returns

index : {int}

This index is the figure index of the plot figure that is opened by this command. Use figure(index) to get a reference to the figure window of this plot. The plot can be closed by ‘close(index)’.

plotHandle: {plotItem} :

Handle of the plot. This handle is used to control the properties of the plot, connect to its signals or call slots of the plot.

itom.plot25()

plot2(data, properties = {}) -> plots a dataObject in a new figure

Plots an existing dataObject in a dockable, not blocking window. The style of the plot depends on the object dimensions.

The plot type of this function is ‘2D’.

Every plot has several properties that can be configured in the Qt Designer (if the plot is embedded in a GUI), or by the property toolbox in the plot itself or by using the info() method of the corresponding itom.uiItem instance.

Use the ‘properties’ argument to pass a dictionary with properties you want to set to a certain value.

Parameters

data : {DataObject}

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

className : {str}, optional

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

properties : {dict}, optional

optional dictionary of properties that will be directly applied to the plot widget.

Returns

index : {int}

This index is the figure index of the plot figure that is opened by this command. Use figure(index) to get a reference to the figure window of this plot. The plot can be closed by ‘close(index)’.

plotHandle: {plotItem} :

Handle of the plot. This handle is used to control the properties of the plot, connect to its signals or call slots of the plot.

9.1.2. Using algorithms and filters

Algorithms and filters are called by the method filter.

itom.filter(name : str, *args, **kwds, _observer : progressObserver = None) → invoke a filter (or algorithm) function from an algorithm-plugin.

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.

Parameters

name : {str}

The name of the filter

*args : {variant}

positional arguments for the specific filter-method

**kwds : {variant}

keyword-based arguments for the specific filter-method. The argument name ‘observer’ is reserved for special use.

_observer : {progressObserver, optional}

if the called filter implements the extended interface with progress and status information, an optional itom.progressObserver object can be given (only as keyword-based parameter) which is then used as observer for the current progress of the filter execution. It is then also possible to interrupt the execution earlier (depending on the implementation of the filter). The observer object is reset() before passed to the called filter function (using the slot reset()).

Returns

out : {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.

See also

filterHelp

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

You can get the help string in the itom command line for plugins, widgets, filters, …

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

This method prints information about one specific filter (algorithm) or a list of filters to the console output. If one specific filter, defined in an algorithm plugin can be found that case-sensitively fits the given filterName its full documentation is printed. Else, a list of filters is printed whose name contains the given filterName.

Parameters

filterName : {str}, optional

is the fullname or a part of any filter-name which should be displayed. If filterName is empty or no filter matches filterName (case sensitive) a list with all suitable filters is given.

dictionary : {dict}, optional

if dictionary == 1, a dictionary with all relevant components of the filter’s documentation is returned and nothing is printed to the command line [default: 0]

furtherInfos : {int}, optional

Usually, filters or algorithms whose name only contains the given filterName are only listed at the end of the information text. If this parameter is set to 1 [default: 0], the full information for all these filters is printed as well.

Returns

out : {None or dict}

In its default parameterization this method returns None. Depending on the parameter dictionary it is also possible that this method returns a dictionary with the single components of the information text.

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 == True, a dict with all plugin parameters is returned and nothing is printed to the console.

Parameters

pluginName : {str}

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

dictionary : {bool}, optional

if dictionary == True, function returns a dict with plugin parameters and does not print anything to the console (default: False)

Returns

out : {None or dict}

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

itom.pluginLoaded(pluginName) → check if a certain plugin could be successfully 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

result : {bool}

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

itom.version(returnDict=False, addPluginInfos=False) → 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.

addPluginInfos : {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.

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

This method prints information about one specific widget or a list of widgets to the console output. If one specific widget, defined in an algorithm plugin can be found that case-sensitively fits the given widgetName its full documentation is printed. Else, a list of widgets is printed whose name contains the given widgetName.

Parameters

widgetName : {str}, optional

is the fullname or a part of any widget-name which should be displayed. If widgetName is empty or no widget matches widgetName (case sensitive) a list with all suitable widgets is given.

dictionary : {dict}, optional

if dictionary == 1, a dictionary with all relevant components of the widget’s documentation is returned and nothing is printed to the command line [default: 0]

furtherInfos : {int}, optional

Usually, widgets whose name only contains the given widgetName are only listed at the end of the information text. If this parameter is set to 1 [default: 0], the full information for all these widgets is printed as well.

Returns

out : {None or dict}

In its default parameterization this method returns None. Depending on the parameter dictionary it is also possible that this method returns a dictionary with the single components of the information text.

9.1.4. Adding elements to the GUI

You can add buttons and menus to the itom GUI.

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

This function adds a button to a toolbar in the main window. If the button is pressed the given code, function or method is executed. If the toolbar specified by ‘toolbarName’ does not exist, it is created. The button will show the optional icon, or if not given or not loadable, ‘buttonName’ is displayed as text.

itom comes with basic icons addressable by ‘:/../iconname.png’, e.g. ‘:/gui/icons/close.png’. These natively available icons are listed in the icon-browser in the menu ‘edit >> iconbrowser’ of any script window. Furthermore you can give a relative or absolute path to any allowed icon file (the preferred file format is png).

Parameters

toolbarName : {str}

The name of the toolbar.

buttonName : {str}

The name and identifier of the button to create.

code : {str, method, function}

The code to be executed if the 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 the method (in order to avoid cyclic references try to only use basic element types).

Returns

handle : {int}

handle to the newly created button (pass it to removeButton to delete exactly this button)

Raises

RuntimeError : :

if the main window is not available

See also

removeButton

itom.addMenu(type, key, name = <last_section_of_key>, code = '', icon = '', argtuple = []) → adds an element to the menu bar of itom.

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’. These natively available icons are listed in the icon-browser in the menu ‘edit >> iconbrowser’ of any script window. Furthermore you can give a relative or absolute path to any allowed icon file (the preferred file format is png).

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).

Returns

handle : {int}

Handle to the recently added leaf node (action, separator or menu item). Use this handle to delete the item including its child items (for type ‘menu’).

Raises

RuntimeError : :

if the main window is not available or the given button could not be found.

See also

removeMenu

itom.dumpButtonsAndMenus() → returns a dictionary with the set of user-defined toolbars, buttons, menus and actions.
itom.removeButton(handle | toolbarName, buttonName = '') → removes a button from a given toolbar.

This method removes an existing button from a toolbar in the main window of ‘itom’. This button must have been created using addButton. If the toolbar is empty after the removal, it is finally deleted.

Pass either the ‘handle’ parameter of both ‘toolbarName’ and ‘buttonName’. It is more precise to use the handle in order to exactly delete the button that has been created by a call to addButton. Using the names of the toolbar and the button always delete any button that has been created using this data.

Parameters

handle : {int}

The handle returned by addButton().

toolbarName : {str}

The name of the toolbar.

buttonName : {str}

The name (str, identifier) of the button to remove (only necessary, if toolbarName is given instead of handle).

Raises

RuntimeError : :

if the main window is not available or the given button could not be found.

See also

addButton

itom.removeMenu(key | menuHandle) → remove a menu element with the given key or handle.

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

Alternatively, it is possible to pass the handle obtained by addMenu.

Parameters

key : {str}, optional

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

handle : {int}, optional

The handle of the menu entry that should be removed (including its possible child items).

Raises

RuntimeError : :

if the main window is not available or the given button could not be found.

See also

addMenu

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

9.1.5. Save and load dataObjects to or from file

Dataobject can be save as IDC files.

itom.loadDataObject(filename, dataObject, doNotAppendIDO=False) → load a dataObject from the harddrive.

This function reads a dataObject from the file specified by filename. MetaData saveType (string, binary) are extracted from the file and restored within the object.

Parameters

filename : {str}

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

dataObject : {dataObject}

A pre-allocated dataObject (empty dataObject is allowed).

doNotAppendIDO : {bool}, optional

False[default]: file suffix .ido will not be appended to filename, True: it will be added.

Notes

The value of string-Tags must be encoded to avoid XML-conflics. Tagnames which contains special characters leads to XML-conflics.

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

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

Parameters

filename : {String}

absolute filename or filename relative to the current directory.

Returns

content : {dict}

dictionary with loaded content

See also

pickle.load, saveIDC

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

This function 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

mat : {dict}

dictionary with content of file

See also

saveMatlabMat

itom.saveDataObject(filename, dataObject, tagsAsBinary=False) → save a dataObject to harddrive in a xml-based file format.

This method writes a dataObject into the file specified by ‘filename’. The data is stored in a binary format within a xml-based structure. All string-tags of the dataObject are encoded in order to avoid xml-errors, the value of numerical tags are converted to string with 15 significant digits (>32bit, tagsAsBinary = False [default]) or in a binary format (tagsAsBinary = True).

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 toggle if numeric-tags should be saved (metaData) as binary or by default as string.

See also

loadDataObject

Notes

Tagnames which contains special characters leads to XML-conflics.

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

This method saves the given dictionary as pickled idc-file using the method dump from the builtin module pickle. The file will be saved with the pickle protocol version 3 (default for Python 3).

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, loadIDC

itom.saveMatlabMat(filename, values, matrixName='matrix') → save strings, numbers, arrays or combinations into a Matlab mat file.

Save one or multiple objects (strings, numbers, arrays, dataObject, numpy.ndarray…) to a Matlab mat file. There are the following possibilites for saving:

  • One given value is saved under one given ‘matrixName’ or ‘matrix’ if ‘matrixName’ is not given.

  • A list or tuple of objects is given. If no ‘matrixName’ is given, the items get the names ‘matrix1’, ‘matrix2’… Else, ‘matrixName’ must be a sequence of value names with the same length than ‘values’.

  • A dictionary is given, such that each value is stored under its corresponding key.

Parameters

filename : {str}

Filename under which the file should be saved (.mat will be appended if not available)

values : {dictionary, list, tuple, variant}

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

matrix-name : {str, list, tuple}, optional

if ‘values’ is a single value, this parameter must be one single str, if ‘values’ is a sequence it must be a sequence of strings with the same length, if ‘values’ is a dictionary this argument is ignored.

See also

loadMatlabMat

9.1.6. Debug-Tools

These are some 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

9.1.7. Request user rights

These are some methods to get user informations.

itom.userGetInfo() → return a dictionary with the current user management information.

This method returns a dictionary which contains the current user concerning system configuration.

Returns

isUser : {dict}

dictionary with the following content is returned:

  • Name (string): The name of the current user

  • Type (string): The user type as string [user, administrator, developer]

  • ID (string): The user ID as a string

  • File (string): The location and name of the corresponding initialization file.

itom.userIsAdmin() → return True if USER has administrator status.

This method returns a boolean expression. If the USER defined by the user managment has administrator status it is true, in other cases it is False.

Returns

isRequestedType : {boolean}

Boolean return value

itom.userIsDeveloper() → return True if USER has developer status.

This method returns a boolean expression. If the USER defined by the user managment has developer status it is true, in other cases it is False.

Returns

isRequestedType : {boolean}

Boolean return value

itom.userIsUser() → return True if USER has only user status.

This method returns a boolean expression. If the USER defined by the user managment has only user status it is true, in other cases it is False.

Returns

isRequestedType : {boolean}

Boolean return value

9.1.8. Further commands

Some further commands.

itom.autoReloader(enabled, checkFileExec=True, checkCmdExec=True, checkFctExec=False) → dis-/enables the module to automatically reload changed modules

Use this method to enable or disable (and configure) a tool that automatically tries to reload imported modules and their submodules if they have changed since the last run.

Returns

enable : {bool}

The auto-reload tool is loaded if it is enabled for the first time. If it is disabled, it does not check changes of any imported modules.

checkFileExec : {bool}

If True (default) and auto-reload enabled, a check for modifications is executed whenever a script is executed

checkCmdExec : {bool}

If True (default) and auto-reload enabled, a check for modifications is executed whenever a command in the command line is executed

checkFctExec : {bool}

If True and auto-reload enabled, a check for modifications is executed whenever a function or method is run (e.g. by an event or button click) (default: False)

Notes

This tool is inspired by and based on the IPython extension ‘autoreload’.

Reloading Python modules in a reliable way is in general difficult, and unexpected things may occur. autoReloader tries to work around common pitfalls by replacing function code objects and parts of classes previously in the module with new versions. This makes the following things to work:

  • Functions and classes imported via ‘from xxx import foo’ are upgraded to new versions when ‘xxx’ is reloaded.

  • Methods and properties of classes are upgraded on reload, so that calling ‘c.foo()’ on an object ‘c’ created before the reload causes the new code for ‘foo’ to be executed.

Some of the known remaining caveats are:

  • Replacing code objects does not always succeed: changing a @property in a class to an ordinary method or a method to a member variable can cause problems (but in old objects only).

  • Functions that are removed (eg. via monkey-patching) from a module before it is reloaded are not upgraded.

  • C extension modules cannot be reloaded, and so cannot be autoreloaded.

itom.clc() -> clears the itom command line (if available)
itom.clearAll()

clears all variables in workspace (holds variables created by any startup skript)

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

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

Returns

path : {str}

absolute path of this application’s base directory

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

Path : {str}

absolute path of current working directory

See also

setCurrentPath

itom.getDefaultScaleableUnits() → Get a list with the strings of the standard scalable units.

The unit strings returned as a list by this method can be transformed into each other using scaleValueAndUnit.

Returns

units : {list}

List with strings containing all scaleable units

itom.getPalette(name) → get the color palette used in color bars defined by name.

If a color palette with this name is given, a tuple is returned whose length corresponds to the number of color stops. Every item is a tuple with two elements, where the first element denotes the normalized index position of the color stop [0,1] and the second element is of type itom.rgba32 and indicates the color at the stop position.

Parameters

name : {string}

name of the new palette.

Returns

palette : {dict}

Dictionary with the following entries:

name{str}

name of palette

colorStops{tuple}

tuple with all color stops, each element is another tuple whose first value is the float position [0.0,1.0] and the 2nd value is the color (itom.rgba32)

inverseColor1{itom.rgba32}

first defined inverse color

inverseColor2{itom.rgba32}

2nd defined inverse color

invalidColor{itom.rgba32}

color used for NaN or Inf values

Raises

RuntimeError : :

if no color palette with the given name is available.

itom.getPaletteList(typefilter=0) → returns a tuple of all currently available names of color palettes.
Parameters

typefilter : {int}

currently unused parameter

itom.getQtToolPath(toolname) → get the absolute path of the Qt tool
Parameters

toolname : {str}

The filename of the tool that should be searched (e.g. qcollectiongenerator; suffix is not required)

Returns

path : {str}

Absolute path to the Qt tool

Raises

FileExistsError : :

if the given toolname could not be found

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

This method returns a dictionary with information about the current screen configuration of this computer.

Returns

screenInfo : {dict}

dictionary with the following content is returned:

  • 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)

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

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

itom.openScript(filename) → open the given script in current script window.

Open the python script indicated by filename in a new tab in the current, latest opened editor window. Filename can be either a string with a relative or absolute filename to the script to open or any object with a __file__ attribute. This attribute is then read and used as path.

The relative filename is relative with respect to the current directory.

Parameters

filename : {str} or {obj}

Relative or absolute filename to a python script that is then opened (in the current editor window). Alternatively an object with a __file__ attribute is allowed.

itom.scaleValueAndUnit()

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()

itom.scriptEditor() -> opens new, empty script editor window (undocked)
itom.setApplicationCursor(cursorIndex=- 1) → changes the itom cursor or restores the previously set cursor if -1

This methods changes the overall cursor icon of itom where cursorIndex corresponds to the Qt enumeration Qt::CursorShape. e.g.:

  • 0: Arrow

  • 2: Cross Cursor

  • 3: Wait Curson

  • 13: Pointing Hand Cursor

  • 14: Forbidden Cursor

  • 16: Busy Cursor

Parameters

cursorIndex : {int} optional

The cursor enumeration value of the desired cursor shape (Qt::CursorShape) or -1 if the previous cursor should be restored (default)

itom.setCurrentPath(newPath) → set current working directory to given absolute newPath

sets the absolute path of the current working directory to ‘newPath’. The current working directory is the base directory for all subsequent relative pathes of icon-files, script-files, ui-files, relative import statements…

The current directory is always indicated in the right corner of the status bar of the main window.

Parameters

newPath : {str}

The new working path of this application

Returns

success : {bool}

True in case of success else False

See also

getCurrentPath

itom.setPalette(name, entries) → set the palette for color bars defined by name.

This methods sets a palette defined by entries within the palette organizer. If the palette does not exist, a new one is created. If the palette already exists and is not write protected, the palette is overwritten. If any of the optional values is not given, default values (from the ‘gray’ color palette) are used or, if the color palette already exists, these values are left unchanged

If a palette is available in terms of a dictionary, returned by itom.getPalette, the use the star-operator, to unpack this dictionary as keyword-arguments, used as parameters for this method.

Parameters

name : {str}

name of palette

colorStops : {tuple}

tuple with all color stops, each element is another tuple whose first value is the float position [0.0,1.0] and the 2nd value is the color (itom.rgba32). The position of the first color stop has to be 0.0, the one of the last stop 1.0. There must be at least two colorStops.

inverseColor1 : {itom.rgba32}, optional

first defined inverse color

inverseColor2 : {itom.rgba32}, optional

2nd defined inverse color

invalidColor : {itom.rgba32}, optional

color used for NaN or Inf values

itom.showHelpViewer(collectionFile='') → open the user documentation in the help viewer.

The user documentation is shown in an external help viewer. Optionally, it is possible to load a user-defined collection file in this help viewer.

Parameters

collectionFile : {str}

If given, the indicated collectionFile will be loaded in the help viewer. Per default, the user documentation is loaded (pass an empty string or nothing).

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: