Reference
MainWindow
The MainWindow module is the main class that provides interaction between GUI and the user.
This class integrates all the other functionality.
Reference
-
class MainWindow.Main(args=['/usr/bin/sphinx-build', '-b', 'html', '-d', '_build/doctrees', '.', '_build/html'])
-
_create_connections()
Creates connections in MainWindow
-
_dock_clin_info_toggle()
Set clinical information dock widget visible or invisible
-
_dock_clin_info_visibility()
Clinical information dock visibility has changed, set the property of checkbox
-
_dock_databrowse_toggle()
Set docks widget visible or invisible
-
_dock_databrowse_visibility()
Visibility of data browser has changed, set the property of checkbox.
-
_get_paper_format()
Returns: | paper format |
Return type: | str |
-
_open_file()
Open file in gui. Files are filtered based on extension
-
_open_folder_data_browser(sdir)
Open folder in gui.
-
_toolbar_ann_changed()
Annotations were changed. Enable saving button.
-
_toolbar_ann_toogle()
Set toolbar visible or invisible
-
plot_file(sfile)
Plot physionet or matlab file
Parameters: | sfile (str) – input file |
-
plot_matlab_file(sfile)
Obsolete function - use plot file instead
Parameters: | sfile – |
Returns: | |
-
plot_physionet_file(sfile)
Obsolete function - use plot file instead
Parameters: | sfile – |
Returns: | |
LoadWriteData
- Load and write data in several formats.
- text files
- matlab files
- csv files
- txt: mb: loading csv directly from TXT/CSV file generated from BDI
Reference
-
class LoadWriteData.EnumVariableName
Class EnumVariableName contains description and names of variables in a matlab file that can be used in python
Examples of variables in mat-file (others not supported yet):
Parameters: |
- fhr (numeric vector) – fetal heart rate signal
- uc (numeric vector) – uterine contractions signal
- timestamp (numeric vector) – time stamp giving samples that are valid
|
Example of matlab file:
fhr = [150,150,151,152,150]
uc = [7,10,10,9,8]
timestamp = [1,2,3,10,11] % timestamp represents timesamples; that is during time: 4,5,6,7,8,9 there is no recording.
Do not substitute with artifacts! The timestamp is used for situations when the recording was stopped and started again.
save(‘temp.mat’,’fhr’,’uc’,’timestamp’)
View file in ctgViewerLite
1) open via menu bar in ctgViewerLite
2) call ctgViewerLite from command prompt, see REFERENCE NEEDED: for details
3) call ctgViewerLite from matlab, see REFERENCE NEEDED: for details
-
class LoadWriteData.LoadData
Load data from various types of files
-
read_bdi_txtfile(infile)
load data from txt file (generated from BDI file), the structure of csv is expected as:
timestamp, fhr, uc (fields: 1, 4, 11)
:param: infile: input file
:type: infile: str()
-
read_csv_file(infile)
load data from csv file, the structure of csv is expected as:
timestamp, fhr, uc
-
read_data(infile)
Interface function for reading data
:param infile: input file dat, mat, hea
:return:
-
read_matlab_file(sfile)
read a signal in matlab format, for specification of matlab file see EnumVariableName
Read a file header in physionet format
Parameters: | infile (string) – filename to read |
Return lheader: | |
Rtype lheader: | list of dict |
Read a physionet header when the name of signal is provided.
Parameters: | infile (string) – filename of signal, which header is desired |
Returns: | list of parameters |
-
read_physionet_signal16(in_file, l_header=None)
read a signal in physionet format, only format 16 is supported
-
transform_lyon_info(cdata, n)
Transform loaded matlab file into compatible format for CTGViewerLite
Parameters: |
- cdata (loaded matlab structure) – metainfo from Lyon database
- n – length of the FHR data
|
Returns: | datadict: diconary with clinical information to be displayed
|
-
write_csv_file(infile, data, sheader=None)
write data into csv file.
the function is not using the python csv module because of unable to setup float precision
PyQwtNavigationPlot
The navigation plot shows overview of complete signals. By clicking on this
plot the controled plots are moved to the clicked position. The area of visible signal
is highlighted using py:class:´PyQwtNavigationPlotHighlight´
Reference
-
class PyQwtNavigationPlot.PyQwtNavigationPlot(parent=None, l_controled_plots=None)
The navigation plot shows overview of complete signals. By clicking on this
plot a signal is emitted with clicked point position.
Parameters: |
- parent (QWidget) –
- l_controled_plots (PyQwtWidgetGui) – list of controled plots
|
-
change_selected_pointleft(step=None)
-
change_selected_pointright(step=None)
-
clear_selected_point()
-
correct_point_boundaries()
If a point is inside boundaries. Point is restricted to be within r = (xmax - xmin)/2, [r, max_view - r]
-
get_selected_point()
When user clicked on the plot, this variable holds x-coordinate of a point
-
get_toco_offset()
-
reinit()
-
setXAxis(center_point=None, breplot=True)
-
setYAxis(height=None, bReplot=True)
-
set_selected_point(point)
Set point clicked by a user.
Parameters: | point (QPointF) – clicked point |
-
class PyQwtNavigationPlot.PyQwtNavigationPlotHighlight(p_navplot)
The navigation plot highlight is used for highlighting area where
user clicked with mouse. This class is inherited from Qwt.QwtPlotCurve.
-
drawFromTo(painter, xmap, ymap, start, stop)
Draws rectangles around a point where user clicked
Parameters: |
- painter (QPainter) –
- xmap –
- ymap –
- start –
- stop –
|