improvement and stability

This commit is contained in:
adamr 2023-07-03 13:04:38 +02:00
parent a7ba4360b2
commit c274dae725
13 changed files with 16 additions and 12 deletions

View file

@ -5,6 +5,9 @@ Created on Tue Nov 23 11:11:41 2021
@author: adamr @author: adamr
""" """
import sys, os
sys.path.append(os.path.dirname(os.path.abspath(__file__)))
from connection import NeurOne, RDA from connection import NeurOne, RDA
# import RDA # import RDA
@ -215,7 +218,7 @@ def acquire_data(q, size, run, speed, downsample, sleep_time, ip = '192.168.200.
run: Value class from multiprocessing library. That value can be changed in main process run: Value class from multiprocessing library. That value can be changed in main process
downsample: boolean value. Says if data will be downsampled to 1000 Hz downsample: boolean value. Says if data will be downsampled to 1000 Hz
sleep_time: int, set how often function should refresh. Usually it takes a bit more that that""" sleep_time: int, set how often function should refresh. Usually it takes a bit more that that"""
offline = 'offline' # offline = 'offline'
#import NeurOne_v3 #import NeurOne_v3
if offline=="offline": if offline=="offline":
NO = NeurOneOffline() NO = NeurOneOffline()
@ -247,7 +250,7 @@ class AppForm(QMainWindow):
def __init__(self, passed_params = None, parent=None): def __init__(self, passed_params = None, parent=None):
super().__init__() super().__init__()
#self.setStyleSheet("background: whitesmoke") #self.setStyleSheet("background: whitesmoke")
self.offline = "offline" #'NeurOne' #"BrainProducts"#False self.offline = None #"offline" #'NeurOne' #"BrainProducts"#False
self.time_start = time.time() self.time_start = time.time()
QMainWindow.__init__(self, parent) QMainWindow.__init__(self, parent)
self.montage_file_path = 'montage_18ch.csv' self.montage_file_path = 'montage_18ch.csv'
@ -416,12 +419,13 @@ class AppForm(QMainWindow):
self.remove_outliers = passed_params['remove_outliers'] self.remove_outliers = passed_params['remove_outliers']
self.ip = passed_params['ip'] self.ip = passed_params['ip']
self.port = passed_params['port'] self.port = passed_params['port']
self.offline = self.offline if not None else passed_params['offline'] self.offline = self.offline if not self.offline==None else passed_params['offline']
self.exp_trig = passed_params['exp_trig'] self.exp_trig = passed_params['exp_trig']
self.exp_time = passed_params['exp_time'] self.exp_time = passed_params['exp_time']
self.if_percentage = passed_params['percentages'] self.if_percentage = passed_params['percentages']
self.received_thr_values = passed_params['thr_values'] self.received_thr_values = passed_params['thr_values']
self.plot_len = passed_params['plot_len'] self.plot_len = passed_params['plot_len']
print(self.offline)
else: else:
self.montage_file_path = 'montage_18ch.csv' self.montage_file_path = 'montage_18ch.csv'
self.time_between_bursts = int(settings_file[settings_file[0]=='time_between_trains'].values[0][1]) self.time_between_bursts = int(settings_file[settings_file[0]=='time_between_trains'].values[0][1])
@ -445,6 +449,7 @@ class AppForm(QMainWindow):
self.offline = False self.offline = False
self.plot_len = 4 #length of data to plot (last seconds of data array) self.plot_len = 4 #length of data to plot (last seconds of data array)
self.unit_label = np.array(self.unit_label)[self.used_features] self.unit_label = np.array(self.unit_label)[self.used_features]
self.log_file_writer.writerow(['time', 'state', self.used_features]) self.log_file_writer.writerow(['time', 'state', self.used_features])
@ -743,7 +748,7 @@ class AppForm(QMainWindow):
self.timer.setInterval(int(self.speed_general*1.03)) self.timer.setInterval(int(self.speed_general*1.03))
times = time.time() times = time.time()
self.offline='offline' #remove this! # self.offline='offline' #remove this!
if self.offline=="offline": if self.offline=="offline":
incl = [0,2,6,7,8,10,13,16,18,22,25,28,31,34,41,43,-3,-2,-1] # For offline only incl = [0,2,6,7,8,10,13,16,18,22,25,28,31,34,41,43,-3,-2,-1] # For offline only
loaded_temp = self.q.get()[incl]/10 # Load data loaded_temp = self.q.get()[incl]/10 # Load data

2
Electrode_selection.txt Normal file
View file

@ -0,0 +1,2 @@
full_cap_file_path: C:/Users/Basics/Desktop/new_super_important_study/TMS Trains/Up to date version/estimo-master (1)/estimo-master/settings/easycap-M10_63_NO.txt
cap_file_path: C:/Users/Basics/Desktop/new_super_important_study/TMS Trains/Up to date version/estimo-master (1)/estimo-master/settings/easycap-M10_16_NO.txt

View file

@ -2,12 +2,6 @@
EStiMo is a sophisticated software developed for the purpose of real-time monitoring during Transcranial Magnetic Stimulation (TMS) sessions. This is accomplished by conducting a real-time analysis of Electroencephalography (EEG) signals. Its operational mechanics are contingent on a suite of features that are computed online and visually represented on the display interface. The computation of these values takes place in between the trains of TMS. EStiMo is a sophisticated software developed for the purpose of real-time monitoring during Transcranial Magnetic Stimulation (TMS) sessions. This is accomplished by conducting a real-time analysis of Electroencephalography (EEG) signals. Its operational mechanics are contingent on a suite of features that are computed online and visually represented on the display interface. The computation of these values takes place in between the trains of TMS.
## Installation ## Installation
To install all required library use:
```
pip install -r requirements.txt
```
EStiMo is designed to be conveniently portable and as such, does not necessitate a typical installation procedure. However, the pre-requisite for running this software smoothly is a Python 3 environment, ideally version 3.8. Alongside Python, several other libraries are necessary for full functionality, including: time, matplotlib, mne, inspect, sys, os, random, scipy, PyQt5, multiprocessing, pandas, json, cycler, traceback, and csv. EStiMo is designed to be conveniently portable and as such, does not necessitate a typical installation procedure. However, the pre-requisite for running this software smoothly is a Python 3 environment, ideally version 3.8. Alongside Python, several other libraries are necessary for full functionality, including: time, matplotlib, mne, inspect, sys, os, random, scipy, PyQt5, multiprocessing, pandas, json, cycler, traceback, and csv.
The EStiMo package is comprised of 6 distinct Python script files namely: FirstWindow.py, Functions.py, NeurOne.py, RDA.py, and EStiMo_GUI.py. Additionally, there are certain auxiliary files that facilitate the running of the software. The 'TMS_protocol.txt' file includes the default settings for the application. The 'electrode_selection.txt' file contains the directories for files related to electrode placement. Lastly, the package also includes a csv file that possesses a square matrix, which is integral for defining the relationships between the various channels. The EStiMo package is comprised of 6 distinct Python script files namely: FirstWindow.py, Functions.py, NeurOne.py, RDA.py, and EStiMo_GUI.py. Additionally, there are certain auxiliary files that facilitate the running of the software. The 'TMS_protocol.txt' file includes the default settings for the application. The 'electrode_selection.txt' file contains the directories for files related to electrode placement. Lastly, the package also includes a csv file that possesses a square matrix, which is integral for defining the relationships between the various channels.

View file

@ -0,0 +1,3 @@
import sys, os
# sys.path.append("..")
sys.path.append(os.path.dirname(os.path.abspath(__file__)))

View file

@ -1,2 +1,2 @@
full_cap_file_path: /home/adamr/Documents/PYTHON/TMS TV/EStiMo/settings/easycap-M10_63_NO.txt full_cap_file_path: settings/easycap-M10_63_NO.txt
cap_file_path: /home/adamr/Documents/PYTHON/TMS TV/EStiMo/settings/easycap-M10_16_NO.txt cap_file_path: settings/easycap-M10_16_NO.txt

0
utils/features.py Executable file → Normal file
View file