GUI namespace

Dialogs, image display, ROI picking, trackbars and user interaction.

Symbols in this namespace: 46

SymbolKindCategoryDescription
GUI.CLEAR_ROICommandGUI interaction statementsClears the current ROI from the selected image/stack window.
GUI.CLOSECommandGUI interaction statementsCloses an image or stack window in the GUI MDI area. Without arguments it closes the active image/stack window.
GUI.CONFIRMFunctionHybrid GUI functionsShows a Yes/No confirmation dialog and returns TRUE for Yes, FALSE for No.
GUI.CREATE_TRACKBARCommandGUI interaction statementsCreates or updates a Qt slider similar in spirit to OpenCV createTrackbar. Read it with GUI.TRACKBAR_POS().
GUI.DRAWINGFunctionHybrid GUI functionsGeneric drawing query. RECT/ROI/BOX returns [x,y,w,h]; POINT/CENTER/TOPLEFT/BOTTOMRIGHT returns [x,y].
GUI.GET_COLORFunctionHybrid GUI functionsShows a QColorDialog::getColor-style dialog and returns the chosen color as #RRGGBB. Returns an empty string if the user cancels.
GUI.GET_DRAWINGFunctionHybrid GUI functionsGeneric drawing query. RECT/ROI/BOX returns [x,y,w,h]; POINT/CENTER/TOPLEFT/BOTTOMRIGHT returns [x,y].
GUI.GET_EXISTING_DIRECTORYFunctionHybrid GUI functionsShows a QFileDialog::getExistingDirectory-style dialog and returns the selected directory. Returns an empty string if the user cancels.
GUI.GET_OPEN_FILE_NAMEFunctionHybrid GUI functionsShows a QFileDialog::getOpenFileName-style dialog and returns one selected file path. Returns an empty string if the user cancels.
GUI.GET_OPEN_FILE_NAMESFunctionHybrid GUI functionsShows a QFileDialog::getOpenFileNames-style dialog and returns selected file paths separated by newline characters. Returns an empty string if the user cancels.
GUI.GET_POINTFunctionHybrid GUI functionsReturns a picked point as [x,y], derived from the current ROI. mode can be CENTER, TOPLEFT or BOTTOMRIGHT.
GUI.GET_RECTFunctionHybrid GUI functionsReturns the current interactive ROI rectangle from a GUI image/stack window as an array [x,y,w,h].
GUI.GET_ROI_RECTFunctionHybrid GUI functionsReturns the current interactive ROI rectangle from a GUI image/stack window as an array [x,y,w,h].
GUI.GET_SAVE_FILE_NAMEFunctionHybrid GUI functionsShows a QFileDialog::getSaveFileName-style dialog and returns the destination path. Returns an empty string if the user cancels.
GUI.GET_TRACKBAR_POSFunctionHybrid GUI functionsReturns the current integer value of a GUI trackbar.
GUI.GETCOLORFunctionHybrid GUI functionsShows a QColorDialog::getColor-style dialog and returns the chosen color as #RRGGBB. Returns an empty string if the user cancels.
GUI.GETEXISTINGDIRECTORYFunctionHybrid GUI functionsShows a QFileDialog::getExistingDirectory-style dialog and returns the selected directory. Returns an empty string if the user cancels.
GUI.GETOPENFILENAMEFunctionHybrid GUI functionsShows a QFileDialog::getOpenFileName-style dialog and returns one selected file path. Returns an empty string if the user cancels.
GUI.GETOPENFILENAMESFunctionHybrid GUI functionsShows a QFileDialog::getOpenFileNames-style dialog and returns selected file paths separated by newline characters. Returns an empty string if the user cancels.
GUI.GETSAVEFILENAMEFunctionHybrid GUI functionsShows a QFileDialog::getSaveFileName-style dialog and returns the destination path. Returns an empty string if the user cancels.
GUI.HISTOGRAMFunctionHybrid GUI functionsCreates an interactive DataPlot histogram from an image. Modes include GRAY, RGB, BGR, R, G, B and A.
GUI.INPUTFunctionHybrid GUI functionsShows a modal text input dialog and returns the entered string.
GUI.INPUT_NUMBERFunctionHybrid GUI functionsShows a numeric input dialog. Returns the selected number, or an empty string if the user cancels.
GUI.INPUT_TEXTFunctionHybrid GUI functionsShows a text input dialog and returns the entered string. Returns an empty string if the user cancels.
GUI.MESSAGECommandGUI interaction statementsAlias of GUI.MSGBOX with a clearer name for script-driven user messages.
GUI.MSGBOXCommandGUI interaction statementsShows a Qt information message box.
GUI.NUMBER_INPUTFunctionHybrid GUI functionsShows a numeric input dialog. Returns the selected number, or an empty string if the user cancels.
GUI.POINTFunctionHybrid GUI functionsReturns a picked point as [x,y], derived from the current ROI. mode can be CENTER, TOPLEFT or BOTTOMRIGHT.
GUI.PROFILEFunctionHybrid GUI functionsCreates an interactive DataPlot profile from an image. Modes: H row profile, V column profile, XY arbitrary line profile with bilinear sampling.
GUI.RECTFunctionHybrid GUI functionsReturns the current interactive ROI rectangle from a GUI image/stack window as an array [x,y,w,h].
GUI.RELEASE_TRACKBARSCommandGUI interaction statementsRemoves all trackbars, or only those belonging to the selected panel.
GUI.ROI_HISTOGRAMFunctionHybrid GUI functionsCreates an interactive DataPlot histogram from a ROI using x,y,w,h and the selected histogram mode.
GUI.ROI_PROFILEFunctionHybrid GUI functionsCreates an interactive DataPlot profile from a ROI using x,y,w,h. H averages vertically per column; V averages horizontally per row.
GUI.SET_TRACKBAR_POSCommandGUI interaction statementsSets an existing trackbar position from script.
GUI.SHOWCommandGUI interaction statementsDisplays an image or stack in the GUI MDI area. If a title is provided and an image window with the same title already exists, that window is updated instead of opening a new one.
GUI.TEXT_INPUTFunctionHybrid GUI functionsShows a text input dialog and returns the entered string. Returns an empty string if the user cancels.
GUI.TRACKBARCommandGUI interaction statementsCreates or updates a Qt slider similar in spirit to OpenCV createTrackbar. Read it with GUI.TRACKBAR_POS().
GUI.TRACKBAR_POSFunctionHybrid GUI functionsReturns the current integer value of a GUI trackbar.
GUI.TRACKBAR_VALUEFunctionHybrid GUI functionsReturns the current integer value of a GUI trackbar.
GUI.WAIT_DRAWINGFunctionHybrid GUI functionsGeneric interactive drawing wait. It waits for a GUI ROI change and returns either a rectangle array or point array.
GUI.WAIT_KEYFunctionHybrid GUI functionsProcesses GUI events for delayMs milliseconds and returns the last pressed key as uppercase text, or an empty string when no key was pressed. delayMs=0 waits indefinitely.
GUI.WAIT_POINTFunctionHybrid GUI functionsWaits for a ROI/pick and returns the selected point as [x,y]. The default point is the ROI center.
GUI.WAIT_RECTFunctionHybrid GUI functionsWaits until the user draws/changes a ROI, then returns the rectangle as [x,y,w,h].
GUI.WAIT_ROICommandGUI interaction statementsWaits until the user creates, moves or resizes a ROI in the selected image/stack window.
GUI.WAIT_ROI_CHANGECommandGUI interaction statementsWaits for any committed desktop ROI change. Use ROI.FROM_DESKTOP(img,title) to copy it into an image object, or ROI.CHANGE(title)/ROI.REVISION(title) to inspect the GUI state.
GUI.WAIT_ROI_RECTFunctionHybrid GUI functionsWaits until the user draws/changes a ROI, then returns the rectangle as [x,y,w,h].

GUI.CLEAR_ROI

STATEMENTGUIGUI / INTERACTIVEROI
Kind: Command   Category: GUI interaction statements   Namespace: GUI

GUI.CLEAR_ROI windowTitle

Clears the current ROI from the selected image/stack window.

Minimal example

GUI.CLEAR_ROI "Input image"

GUI.CLOSE

STATEMENTGUIGUI / INTERACTIVE
Kind: Command   Category: GUI interaction statements   Namespace: GUI

GUI.CLOSE [windowTitle]

Closes an image or stack window in the GUI MDI area. Without arguments it closes the active image/stack window.

Optional parameters

Parameters enclosed in [...] may be omitted. Nested brackets mean that the later parameter is available only when the previous optional level is also supplied.

ParameterMeaning
windowTitleOptional parameter. If omitted, the command uses its internal default.

Minimal example

GUI.CLOSE "Preview"
GUI.CLOSE

GUI.CONFIRM

FUNCTIONGUIGUI / INTERACTIVE
Kind: Function   Category: Hybrid GUI functions   Namespace: GUI

GUI.CONFIRM(text [, title])

Shows a Yes/No confirmation dialog and returns TRUE for Yes, FALSE for No.

Optional parameters

Parameters enclosed in [...] may be omitted. Nested brackets mean that the later parameter is available only when the previous optional level is also supplied.

ParameterMeaning
titleOptional GUI/DataPlot window title.

Minimal example

IF NOT GUI.CONFIRM("Continue?", "Confirm") THEN
    EXIT
ENDIF

GUI.CREATE_TRACKBAR

STATEMENTGUIGUI / INTERACTIVE
Kind: Command   Category: GUI interaction statements   Namespace: GUI

GUI.TRACKBAR name, panelTitle, min, max [, value]

Creates or updates a Qt slider similar in spirit to OpenCV createTrackbar. Read it with GUI.TRACKBAR_POS().

Optional parameters

Parameters enclosed in [...] may be omitted. Nested brackets mean that the later parameter is available only when the previous optional level is also supplied.

ParameterMeaning
valueScalar value written, drawn, or used as foreground/background according to the command.

Minimal example

GUI.CREATE_TRACKBAR

GUI.DRAWING

FUNCTIONGUIGUI / INTERACTIVE
Kind: Function   Category: Hybrid GUI functions   Namespace: GUI

GUI.GET_DRAWING(windowTitle [, shape [, pointMode]])

Generic drawing query. RECT/ROI/BOX returns [x,y,w,h]; POINT/CENTER/TOPLEFT/BOTTOMRIGHT returns [x,y].

Optional parameters

Parameters enclosed in [...] may be omitted. Nested brackets mean that the later parameter is available only when the previous optional level is also supplied.

ParameterMeaning
shapeOptional parameter. If omitted, the command uses its internal default.
pointModeOptional parameter. If omitted, the command uses its internal default.

Minimal example

value = GUI.GET_DRAWING(windowTitle [, shape [, pointMode]])

GUI.GET_COLOR

FUNCTIONGUIGUI / INTERACTIVE
Kind: Function   Category: Hybrid GUI functions   Namespace: GUI

GUI.GET_COLOR([initialColor [, title]])

Shows a QColorDialog::getColor-style dialog and returns the chosen color as #RRGGBB. Returns an empty string if the user cancels.

Optional parameters

Parameters enclosed in [...] may be omitted. Nested brackets mean that the later parameter is available only when the previous optional level is also supplied.

ParameterMeaning
initialColorOptional parameter. If omitted, the command uses its internal default.
titleOptional GUI/DataPlot window title.

Minimal example

color = GUI.GET_COLOR("#FF8000", "Pick overlay color")
IF color = "" THEN
    EXIT
ENDIF

GUI.GET_DRAWING

FUNCTIONGUIGUI / INTERACTIVE
Kind: Function   Category: Hybrid GUI functions   Namespace: GUI

GUI.GET_DRAWING(windowTitle [, shape [, pointMode]])

Generic drawing query. RECT/ROI/BOX returns [x,y,w,h]; POINT/CENTER/TOPLEFT/BOTTOMRIGHT returns [x,y].

Optional parameters

Parameters enclosed in [...] may be omitted. Nested brackets mean that the later parameter is available only when the previous optional level is also supplied.

ParameterMeaning
shapeOptional parameter. If omitted, the command uses its internal default.
pointModeOptional parameter. If omitted, the command uses its internal default.

Minimal example

rect = GUI.GET_DRAWING("Source", "RECT")
p = GUI.GET_DRAWING("Source", "POINT")

GUI.GET_EXISTING_DIRECTORY

FUNCTIONGUIGUI / INTERACTIVE
Kind: Function   Category: Hybrid GUI functions   Namespace: GUI

GUI.GET_EXISTING_DIRECTORY([title [, dir]])

Shows a QFileDialog::getExistingDirectory-style dialog and returns the selected directory. Returns an empty string if the user cancels.

Optional parameters

Parameters enclosed in [...] may be omitted. Nested brackets mean that the later parameter is available only when the previous optional level is also supplied.

ParameterMeaning
titleOptional GUI/DataPlot window title.
dirOptional parameter. If omitted, the command uses its internal default.

Minimal example

dir = GUI.GET_EXISTING_DIRECTORY("Select dataset folder")
IF dir = "" THEN
    EXIT
ENDIF

GUI.GET_OPEN_FILE_NAME

FUNCTIONGUIGUI / INTERACTIVEFILE I/O
Kind: Function   Category: Hybrid GUI functions   Namespace: GUI

GUI.GET_OPEN_FILE_NAME([title [, dir [, filter]]])

Shows a QFileDialog::getOpenFileName-style dialog and returns one selected file path. Returns an empty string if the user cancels.

Optional parameters

Parameters enclosed in [...] may be omitted. Nested brackets mean that the later parameter is available only when the previous optional level is also supplied.

ParameterMeaning
titleOptional GUI/DataPlot window title.
dirOptional parameter. If omitted, the command uses its internal default.
filterOptional parameter. If omitted, the command uses its internal default.

Minimal example

file = GUI.GET_OPEN_FILE_NAME("Open image", "", "Images (*.png *.jpg *.tif *.tiff *.fit *.fits *.fts);;All files (*)")
IF file = "" THEN
    EXIT
ENDIF

GUI.GET_OPEN_FILE_NAMES

FUNCTIONGUIGUI / INTERACTIVEFILE I/O
Kind: Function   Category: Hybrid GUI functions   Namespace: GUI

GUI.GET_OPEN_FILE_NAMES([title [, dir [, filter]]])

Shows a QFileDialog::getOpenFileNames-style dialog and returns selected file paths separated by newline characters. Returns an empty string if the user cancels.

Optional parameters

Parameters enclosed in [...] may be omitted. Nested brackets mean that the later parameter is available only when the previous optional level is also supplied.

ParameterMeaning
titleOptional GUI/DataPlot window title.
dirOptional parameter. If omitted, the command uses its internal default.
filterOptional parameter. If omitted, the command uses its internal default.

Minimal example

files = GUI.GET_OPEN_FILE_NAMES("Open images", "", "Images (*.png *.jpg *.tif *.tiff *.fit *.fits *.fts);;All files (*)")
PRINT files

GUI.GET_POINT

FUNCTIONGUIGUI / INTERACTIVE
Kind: Function   Category: Hybrid GUI functions   Namespace: GUI

GUI.GET_POINT(windowTitle [, mode])

Returns a picked point as [x,y], derived from the current ROI. mode can be CENTER, TOPLEFT or BOTTOMRIGHT.

Optional parameters

Parameters enclosed in [...] may be omitted. Nested brackets mean that the later parameter is available only when the previous optional level is also supplied.

ParameterMeaning
modeMode selector; accepted values are described in the command text.

Minimal example

p = GUI.GET_POINT("Source")
PRINT ARRAY.GET(p,0), ARRAY.GET(p,1)

GUI.GET_RECT

FUNCTIONGUIGUI / INTERACTIVE
Kind: Function   Category: Hybrid GUI functions   Namespace: GUI

GUI.GET_RECT(windowTitle)

Returns the current interactive ROI rectangle from a GUI image/stack window as an array [x,y,w,h].

Minimal example

rect = GUI.GET_RECT("Source")
PRINT ARRAY.GET(rect,0), ARRAY.GET(rect,1)

GUI.GET_ROI_RECT

FUNCTIONGUIGUI / INTERACTIVEROI
Kind: Function   Category: Hybrid GUI functions   Namespace: GUI

GUI.GET_RECT(windowTitle)

Returns the current interactive ROI rectangle from a GUI image/stack window as an array [x,y,w,h].

Minimal example

value = GUI.GET_RECT(windowTitle)

GUI.GET_SAVE_FILE_NAME

FUNCTIONGUIGUI / INTERACTIVEFILE I/O
Kind: Function   Category: Hybrid GUI functions   Namespace: GUI

GUI.GET_SAVE_FILE_NAME([title [, dir [, filter]]])

Shows a QFileDialog::getSaveFileName-style dialog and returns the destination path. Returns an empty string if the user cancels.

Optional parameters

Parameters enclosed in [...] may be omitted. Nested brackets mean that the later parameter is available only when the previous optional level is also supplied.

ParameterMeaning
titleOptional GUI/DataPlot window title.
dirOptional parameter. If omitted, the command uses its internal default.
filterOptional parameter. If omitted, the command uses its internal default.

Minimal example

outPath = GUI.GET_SAVE_FILE_NAME("Save result", "result.png", "PNG (*.png);;All files (*)")
IF outPath = "" THEN
    EXIT
ENDIF

GUI.GET_TRACKBAR_POS

FUNCTIONGUIGUI / INTERACTIVE
Kind: Function   Category: Hybrid GUI functions   Namespace: GUI

GUI.TRACKBAR_POS(name, panelTitle)

Returns the current integer value of a GUI trackbar.

Minimal example

value = GUI.TRACKBAR_POS(name, panelTitle)

GUI.GETCOLOR

FUNCTIONGUIGUI / INTERACTIVE
Kind: Function   Category: Hybrid GUI functions   Namespace: GUI

GUI.GET_COLOR([initialColor [, title]])

Shows a QColorDialog::getColor-style dialog and returns the chosen color as #RRGGBB. Returns an empty string if the user cancels.

Optional parameters

Parameters enclosed in [...] may be omitted. Nested brackets mean that the later parameter is available only when the previous optional level is also supplied.

ParameterMeaning
initialColorOptional parameter. If omitted, the command uses its internal default.
titleOptional GUI/DataPlot window title.

Minimal example

value = GUI.GET_COLOR([initialColor [, title]])

GUI.GETEXISTINGDIRECTORY

FUNCTIONGUIGUI / INTERACTIVE
Kind: Function   Category: Hybrid GUI functions   Namespace: GUI

GUI.GET_EXISTING_DIRECTORY([title [, dir]])

Shows a QFileDialog::getExistingDirectory-style dialog and returns the selected directory. Returns an empty string if the user cancels.

Optional parameters

Parameters enclosed in [...] may be omitted. Nested brackets mean that the later parameter is available only when the previous optional level is also supplied.

ParameterMeaning
titleOptional GUI/DataPlot window title.
dirOptional parameter. If omitted, the command uses its internal default.

Minimal example

value = GUI.GET_EXISTING_DIRECTORY([title [, dir]])

GUI.GETOPENFILENAME

FUNCTIONGUIGUI / INTERACTIVEFILE I/O
Kind: Function   Category: Hybrid GUI functions   Namespace: GUI

GUI.GET_OPEN_FILE_NAME([title [, dir [, filter]]])

Shows a QFileDialog::getOpenFileName-style dialog and returns one selected file path. Returns an empty string if the user cancels.

Optional parameters

Parameters enclosed in [...] may be omitted. Nested brackets mean that the later parameter is available only when the previous optional level is also supplied.

ParameterMeaning
titleOptional GUI/DataPlot window title.
dirOptional parameter. If omitted, the command uses its internal default.
filterOptional parameter. If omitted, the command uses its internal default.

Minimal example

value = GUI.GET_OPEN_FILE_NAME([title [, dir [, filter]]])

GUI.GETOPENFILENAMES

FUNCTIONGUIGUI / INTERACTIVEFILE I/O
Kind: Function   Category: Hybrid GUI functions   Namespace: GUI

GUI.GET_OPEN_FILE_NAMES([title [, dir [, filter]]])

Shows a QFileDialog::getOpenFileNames-style dialog and returns selected file paths separated by newline characters. Returns an empty string if the user cancels.

Optional parameters

Parameters enclosed in [...] may be omitted. Nested brackets mean that the later parameter is available only when the previous optional level is also supplied.

ParameterMeaning
titleOptional GUI/DataPlot window title.
dirOptional parameter. If omitted, the command uses its internal default.
filterOptional parameter. If omitted, the command uses its internal default.

Minimal example

value = GUI.GET_OPEN_FILE_NAMES([title [, dir [, filter]]])

GUI.GETSAVEFILENAME

FUNCTIONGUIGUI / INTERACTIVEFILE I/O
Kind: Function   Category: Hybrid GUI functions   Namespace: GUI

GUI.GET_SAVE_FILE_NAME([title [, dir [, filter]]])

Shows a QFileDialog::getSaveFileName-style dialog and returns the destination path. Returns an empty string if the user cancels.

Optional parameters

Parameters enclosed in [...] may be omitted. Nested brackets mean that the later parameter is available only when the previous optional level is also supplied.

ParameterMeaning
titleOptional GUI/DataPlot window title.
dirOptional parameter. If omitted, the command uses its internal default.
filterOptional parameter. If omitted, the command uses its internal default.

Minimal example

value = GUI.GET_SAVE_FILE_NAME([title [, dir [, filter]]])

GUI.HISTOGRAM

FUNCTIONGUIGUI / INTERACTIVE
Kind: Function   Category: Hybrid GUI functions   Namespace: GUI

GUI.HISTOGRAM mode, image, bins [, title]

Creates an interactive DataPlot histogram from an image. Modes include GRAY, RGB, BGR, R, G, B and A.

Optional parameters

Parameters enclosed in [...] may be omitted. Nested brackets mean that the later parameter is available only when the previous optional level is also supplied.

ParameterMeaning
titleOptional GUI/DataPlot window title.

Minimal example

p = GUI.HISTOGRAM "GRAY", img, 256
pRgb = GUI.HISTOGRAM "RGB", img, 256

GUI.INPUT

FUNCTIONGUIGUI / INTERACTIVE
Kind: Function   Category: Hybrid GUI functions   Namespace: GUI

GUI.INPUT(prompt [, defaultText [, title]])

Shows a modal text input dialog and returns the entered string.

Optional parameters

Parameters enclosed in [...] may be omitted. Nested brackets mean that the later parameter is available only when the previous optional level is also supplied.

ParameterMeaning
defaultTextDefault text shown by the input dialog.
titleOptional GUI/DataPlot window title.

Minimal example

name = GUI.INPUT("Dataset name", "test", "Input")

GUI.INPUT_NUMBER

FUNCTIONGUIGUI / INTERACTIVE
Kind: Function   Category: Hybrid GUI functions   Namespace: GUI

GUI.INPUT_NUMBER(prompt [, defaultValue [, minValue [, maxValue [, decimals [, title]]]]])

Shows a numeric input dialog. Returns the selected number, or an empty string if the user cancels.

Optional parameters

Parameters enclosed in [...] may be omitted. Nested brackets mean that the later parameter is available only when the previous optional level is also supplied.

ParameterMeaning
defaultValueOptional parameter. If omitted, the command uses its internal default.
minValueLower numeric range limit.
maxValueUpper numeric range limit.
decimalsOptional parameter. If omitted, the command uses its internal default.
titleOptional GUI/DataPlot window title.

Minimal example

thr = GUI.INPUT_NUMBER("Threshold", 128, 0, 255, 0, "Input")
IF thr = "" THEN
    EXIT
ENDIF

GUI.INPUT_TEXT

FUNCTIONGUIGUI / INTERACTIVE
Kind: Function   Category: Hybrid GUI functions   Namespace: GUI

GUI.INPUT_TEXT(prompt [, defaultText [, title]])

Shows a text input dialog and returns the entered string. Returns an empty string if the user cancels.

Optional parameters

Parameters enclosed in [...] may be omitted. Nested brackets mean that the later parameter is available only when the previous optional level is also supplied.

ParameterMeaning
defaultTextDefault text shown by the input dialog.
titleOptional GUI/DataPlot window title.

Minimal example

name = GUI.INPUT_TEXT("Operator name", "Manuele", "Input")
IF name = "" THEN
    EXIT
ENDIF

GUI.MESSAGE

STATEMENTGUIGUI / INTERACTIVE
Kind: Command   Category: GUI interaction statements   Namespace: GUI

GUI.MESSAGE text [, title]

Alias of GUI.MSGBOX with a clearer name for script-driven user messages.

Optional parameters

Parameters enclosed in [...] may be omitted. Nested brackets mean that the later parameter is available only when the previous optional level is also supplied.

ParameterMeaning
titleOptional GUI/DataPlot window title.

Minimal example

GUI.MESSAGE "Processing complete", "cvBasic"

GUI.MSGBOX

STATEMENTGUIGUI / INTERACTIVE
Kind: Command   Category: GUI interaction statements   Namespace: GUI

GUI.MSGBOX text [, title]

Shows a Qt information message box.

Optional parameters

Parameters enclosed in [...] may be omitted. Nested brackets mean that the later parameter is available only when the previous optional level is also supplied.

ParameterMeaning
titleOptional GUI/DataPlot window title.

Minimal example

GUI.MSGBOX "Processing complete", "cvBasic"

GUI.NUMBER_INPUT

FUNCTIONGUIGUI / INTERACTIVE
Kind: Function   Category: Hybrid GUI functions   Namespace: GUI

GUI.INPUT_NUMBER(prompt [, defaultValue [, minValue [, maxValue [, decimals [, title]]]]])

Shows a numeric input dialog. Returns the selected number, or an empty string if the user cancels.

Optional parameters

Parameters enclosed in [...] may be omitted. Nested brackets mean that the later parameter is available only when the previous optional level is also supplied.

ParameterMeaning
defaultValueOptional parameter. If omitted, the command uses its internal default.
minValueLower numeric range limit.
maxValueUpper numeric range limit.
decimalsOptional parameter. If omitted, the command uses its internal default.
titleOptional GUI/DataPlot window title.

Minimal example

value = GUI.INPUT_NUMBER(prompt [, defaultValue [, minValue [, maxValue [, decimals [, title]]]]])

GUI.POINT

FUNCTIONGUIGUI / INTERACTIVE
Kind: Function   Category: Hybrid GUI functions   Namespace: GUI

GUI.GET_POINT(windowTitle [, mode])

Returns a picked point as [x,y], derived from the current ROI. mode can be CENTER, TOPLEFT or BOTTOMRIGHT.

Optional parameters

Parameters enclosed in [...] may be omitted. Nested brackets mean that the later parameter is available only when the previous optional level is also supplied.

ParameterMeaning
modeMode selector; accepted values are described in the command text.

Minimal example

value = GUI.GET_POINT(windowTitle [, mode])

GUI.PROFILE

FUNCTIONGUIGUI / INTERACTIVEFILE I/O
Kind: Function   Category: Hybrid GUI functions   Namespace: GUI

GUI.PROFILE mode, image, coord OR GUI.PROFILE mode, image, sx, sy, dx, dy [, title]

Creates an interactive DataPlot profile from an image. Modes: H row profile, V column profile, XY arbitrary line profile with bilinear sampling.

Optional parameters

Parameters enclosed in [...] may be omitted. Nested brackets mean that the later parameter is available only when the previous optional level is also supplied.

ParameterMeaning
titleOptional GUI/DataPlot window title.

Minimal example

p = GUI.PROFILE "H", img, 120
pLine = GUI.PROFILE "XY", img, 10, 10, 250, 180

GUI.RECT

FUNCTIONGUIGUI / INTERACTIVE
Kind: Function   Category: Hybrid GUI functions   Namespace: GUI

GUI.GET_RECT(windowTitle)

Returns the current interactive ROI rectangle from a GUI image/stack window as an array [x,y,w,h].

Minimal example

value = GUI.GET_RECT(windowTitle)

GUI.RELEASE_TRACKBARS

STATEMENTGUIGUI / INTERACTIVE
Kind: Command   Category: GUI interaction statements   Namespace: GUI

GUI.RELEASE_TRACKBARS [panelTitle]

Removes all trackbars, or only those belonging to the selected panel.

Optional parameters

Parameters enclosed in [...] may be omitted. Nested brackets mean that the later parameter is available only when the previous optional level is also supplied.

ParameterMeaning
panelTitleOptional parameter. If omitted, the command uses its internal default.

Minimal example

GUI.RELEASE_TRACKBARS "Controls"

GUI.ROI_HISTOGRAM

FUNCTIONGUIGUI / INTERACTIVEROI
Kind: Function   Category: Hybrid GUI functions   Namespace: GUI

GUI.ROI_HISTOGRAM mode, image, x, y, w, h, bins [, title]

Creates an interactive DataPlot histogram from a ROI using x,y,w,h and the selected histogram mode.

Optional parameters

Parameters enclosed in [...] may be omitted. Nested brackets mean that the later parameter is available only when the previous optional level is also supplied.

ParameterMeaning
titleOptional GUI/DataPlot window title.

Minimal example

p = GUI.ROI_HISTOGRAM "GRAY", img, 100, 80, 200, 120, 256

GUI.ROI_PROFILE

FUNCTIONGUIGUI / INTERACTIVEFILE I/OROI
Kind: Function   Category: Hybrid GUI functions   Namespace: GUI

GUI.ROI_PROFILE mode, image, x, y, w, h [, title]

Creates an interactive DataPlot profile from a ROI using x,y,w,h. H averages vertically per column; V averages horizontally per row.

Optional parameters

Parameters enclosed in [...] may be omitted. Nested brackets mean that the later parameter is available only when the previous optional level is also supplied.

ParameterMeaning
titleOptional GUI/DataPlot window title.

Minimal example

p = GUI.ROI_PROFILE "H", img, 100, 80, 200, 40

GUI.SET_TRACKBAR_POS

STATEMENTGUIGUI / INTERACTIVE
Kind: Command   Category: GUI interaction statements   Namespace: GUI

GUI.SET_TRACKBAR_POS name, panelTitle, value

Sets an existing trackbar position from script.

Minimal example

GUI.SET_TRACKBAR_POS "Brightness", "Controls", 0

GUI.SHOW

STATEMENTGUIGUI / INTERACTIVE
Kind: Command   Category: GUI interaction statements   Namespace: GUI

GUI.SHOW imageOrStack [, title]

Displays an image or stack in the GUI MDI area. If a title is provided and an image window with the same title already exists, that window is updated instead of opening a new one.

Optional parameters

Parameters enclosed in [...] may be omitted. Nested brackets mean that the later parameter is available only when the previous optional level is also supplied.

ParameterMeaning
titleOptional GUI/DataPlot window title.

Minimal example

GUI.SHOW img, "Preview"

GUI.TEXT_INPUT

FUNCTIONGUIGUI / INTERACTIVE
Kind: Function   Category: Hybrid GUI functions   Namespace: GUI

GUI.INPUT_TEXT(prompt [, defaultText [, title]])

Shows a text input dialog and returns the entered string. Returns an empty string if the user cancels.

Optional parameters

Parameters enclosed in [...] may be omitted. Nested brackets mean that the later parameter is available only when the previous optional level is also supplied.

ParameterMeaning
defaultTextDefault text shown by the input dialog.
titleOptional GUI/DataPlot window title.

Minimal example

value = GUI.INPUT_TEXT(prompt [, defaultText [, title]])

GUI.TRACKBAR

STATEMENTGUIGUI / INTERACTIVE
Kind: Command   Category: GUI interaction statements   Namespace: GUI

GUI.TRACKBAR name, panelTitle, min, max [, value]

Creates or updates a Qt slider similar in spirit to OpenCV createTrackbar. Read it with GUI.TRACKBAR_POS().

Optional parameters

Parameters enclosed in [...] may be omitted. Nested brackets mean that the later parameter is available only when the previous optional level is also supplied.

ParameterMeaning
valueScalar value written, drawn, or used as foreground/background according to the command.

Minimal example

GUI.TRACKBAR "Brightness", "Controls", -100, 100, 0

GUI.TRACKBAR_POS

FUNCTIONGUIGUI / INTERACTIVE
Kind: Function   Category: Hybrid GUI functions   Namespace: GUI

GUI.TRACKBAR_POS(name, panelTitle)

Returns the current integer value of a GUI trackbar.

Minimal example

b = GUI.TRACKBAR_POS("Brightness", "Controls")

GUI.TRACKBAR_VALUE

FUNCTIONGUIGUI / INTERACTIVE
Kind: Function   Category: Hybrid GUI functions   Namespace: GUI

GUI.TRACKBAR_POS(name, panelTitle)

Returns the current integer value of a GUI trackbar.

Minimal example

value = GUI.TRACKBAR_POS(name, panelTitle)

GUI.WAIT_DRAWING

FUNCTIONGUIGUI / INTERACTIVE
Kind: Function   Category: Hybrid GUI functions   Namespace: GUI

GUI.WAIT_DRAWING(windowTitle [, shape [, pointMode]])

Generic interactive drawing wait. It waits for a GUI ROI change and returns either a rectangle array or point array.

Optional parameters

Parameters enclosed in [...] may be omitted. Nested brackets mean that the later parameter is available only when the previous optional level is also supplied.

ParameterMeaning
shapeOptional parameter. If omitted, the command uses its internal default.
pointModeOptional parameter. If omitted, the command uses its internal default.

Minimal example

rect = GUI.WAIT_DRAWING("Source", "RECT")

GUI.WAIT_KEY

FUNCTIONGUIGUI / INTERACTIVE
Kind: Function   Category: Hybrid GUI functions   Namespace: GUI

GUI.WAIT_KEY([delayMs])

Processes GUI events for delayMs milliseconds and returns the last pressed key as uppercase text, or an empty string when no key was pressed. delayMs=0 waits indefinitely.

Optional parameters

Parameters enclosed in [...] may be omitted. Nested brackets mean that the later parameter is available only when the previous optional level is also supplied.

ParameterMeaning
delayMsOptional parameter. If omitted, the command uses its internal default.

Minimal example

key = GUI.WAIT_KEY(10)
IF key = "Q" OR key = "X" THEN
    running = FALSE
ENDIF

GUI.WAIT_POINT

FUNCTIONGUIGUI / INTERACTIVE
Kind: Function   Category: Hybrid GUI functions   Namespace: GUI

GUI.WAIT_POINT(windowTitle [, mode])

Waits for a ROI/pick and returns the selected point as [x,y]. The default point is the ROI center.

Optional parameters

Parameters enclosed in [...] may be omitted. Nested brackets mean that the later parameter is available only when the previous optional level is also supplied.

ParameterMeaning
modeMode selector; accepted values are described in the command text.

Minimal example

p = GUI.WAIT_POINT("Source", "CENTER")

GUI.WAIT_RECT

FUNCTIONGUIGUI / INTERACTIVE
Kind: Function   Category: Hybrid GUI functions   Namespace: GUI

GUI.WAIT_RECT(windowTitle)

Waits until the user draws/changes a ROI, then returns the rectangle as [x,y,w,h].

Minimal example

rect = GUI.WAIT_RECT("Source")
patch = ROI.EXTRACT(img, rect)

GUI.WAIT_ROI

STATEMENTGUIGUI / INTERACTIVEROI
Kind: Command   Category: GUI interaction statements   Namespace: GUI

GUI.WAIT_ROI windowTitle

Waits until the user creates, moves or resizes a ROI in the selected image/stack window.

Minimal example

GUI.WAIT_ROI "Input image"

GUI.WAIT_ROI_CHANGE

STATEMENTGUIGUI / INTERACTIVEROI
Kind: Command   Category: GUI interaction statements   Namespace: GUI

GUI.WAIT_ROI_CHANGE windowTitle

Waits for any committed desktop ROI change. Use ROI.FROM_DESKTOP(img,title) to copy it into an image object, or ROI.CHANGE(title)/ROI.REVISION(title) to inspect the GUI state.

Minimal example

GUI.WAIT_ROI_CHANGE "Input image"
PRINT ROI.CHANGE("Input image"), ROI.REVISION("Input image")

GUI.WAIT_ROI_RECT

FUNCTIONGUIGUI / INTERACTIVEROI
Kind: Function   Category: Hybrid GUI functions   Namespace: GUI

GUI.WAIT_RECT(windowTitle)

Waits until the user draws/changes a ROI, then returns the rectangle as [x,y,w,h].

Minimal example

value = GUI.WAIT_RECT(windowTitle)