Visually select a part of the recording.
The area can be selected based on the reference signal or based on the
mean EMG signal. The selection can be performed with any letter or number
in the keyboard, wrong points can be removed by pressing the right mouse
button. Once finished, press enter to continue.
This function does not check whether the selected points are within the
effective file duration. This should be done based on user's need.
PARAMETER |
DESCRIPTION |
emgfile
|
The dictionary containing the emgfile.
TYPE:
dict
|
how
|
What to display in the figure used to visually select the area to
resize.
ref_signal
Visualise the reference signal to select the area to resize.
mean_emg
Visualise the mean EMG signal to select the area to resize.
TYPE:
str {"ref_signal", "mean_emg"}
DEFAULT:
"ref_signal"
|
title
|
The title of the plot. It is optional but strongly recommended.
It should describe the task to do.
TYPE:
str
DEFAULT:
''
|
titlesize
|
The font size of the title.
TYPE:
int
DEFAULT:
12
|
nclic
|
The number of clics to be collected. If nclic < 1, all the clicks are
collected.
DEFAULT:
2
|
RETURNS |
DESCRIPTION |
points
|
A list containing the selected points sorted in ascending order.
TYPE:
list
|
RAISES |
DESCRIPTION |
ValueError
|
When the user clicked a wrong number of inputs in the GUI.
|
Examples:
Load the EMG file and select the points based on the reference signal.
>>> import openhdemg.library as emg
>>> emgfile = emg.askopenfile(filesource="OTB_REFSIG")
>>> points = emg.showselect(
... emgfile,
... how="ref_signal",
... title="Select 2 points",
... nclic=2,
... )
>>> points
[16115, 40473]
Load the EMG file and select the points based on the mean EMG signal.
>>> import openhdemg.library as emg
>>> emgfile = emg.askopenfile(filesource="OPENHDEMG")
>>> points = emg.showselect(
... emgfile,
... how="mean_emg",
... title="Select 2 points",
... nclic=2,
... )
>>> points
[135, 26598]