DBConfig.root = 'pyecgdel' DBConfig.data_catalogue = 'Data' DBConfig.config_params = 'properties.txt' DBConfig.p_params = 'p_params.txt' DBConfig.qrs_params = 'qrs_params.txt' DBConfig.t_params = 't_params.txt' DBConfig.filter_params = 'filter_params.txt' init_params(params_type=ParamsType.config_params) init_params(params_type=ParamsType.p_params) init_params(params_type=ParamsType.qrs_params) init_params(params_type=ParamsType.t_params) init_params(params_type=ParamsType.filter_params) cb = Cardiobase() cb.connect() hash_data_config_params = ConfigParams hash_data_p_params = PParams hash_data_qrs_params = QRSParams hash_data_t_params = TParams hash_data_filter_params = FilterParams id_hash_params = 24 num_inserted_rows_config_params = cb.update_hash_row_data(id_hash_params, 0, hash_data_config_params) num_inserted_rows_p_params = cb.update_hash_row_data(id_hash_params, 1, hash_data_p_params) num_inserted_rows_qrs_params = cb.update_hash_row_data(id_hash_params, 2, hash_data_qrs_params) num_inserted_rows_t_params = cb.update_hash_row_data(id_hash_params, 3, hash_data_t_params) num_inserted_rows_filter_params = cb.update_hash_row_data(id_hash_params, 4, hash_data_filter_params) cb.commit()
from Source.CardioBase.cardiobase import Cardiobase id_file = 703 cb = Cardiobase() cb.connect() cb.cardio_event("SIGNALS", "PARSE_EDF_DONE", id_file) cb.disconnect()
DBConfig.config_params = 'properties.txt' DBConfig.p_params = 'p_params.txt' DBConfig.qrs_params = 'qrs_params.txt' DBConfig.t_params = 't_params.txt' DBConfig.filter_params = 'filter_params.txt' init_params(params_type=ParamsType.config_params) init_params(params_type=ParamsType.p_params) init_params(params_type=ParamsType.qrs_params) init_params(params_type=ParamsType.t_params) init_params(params_type=ParamsType.filter_params) id_file = 703 cb = Cardiobase() cb.connect() leads_names = ConfigParams['LEADS_NAMES'] columns_names = [] for lead_name in leads_names: columns_names.append(lead_name + "_filtrated") columns_names.append(lead_name + "_p_delineation") columns_names.append(lead_name + "_qrs_delineation") columns_names.append(lead_name + "_t_delineation") columns_names.append(lead_name + "_characteristics") data = cb.bulk_data_get(columns_names, "id_file=" + str(id_file))
from Source.Model.main.ecg.ecg import * from Source.CardioBase.cardiobase import Cardiobase id_file = 1007 cb = Cardiobase() cb.connect() params_hash = cb.get_hash(24) config_params_from_hash = params_hash['data'][0] p_params_from_hash = params_hash['data'][1] qrs_params_from_hash = params_hash['data'][2] t_params_from_hash = params_hash['data'][3] filter_params_from_hash = params_hash['data'][4] leads_names = ConfigParams['LEADS_NAMES']
DBConfig.root = 'pyecgdel' DBConfig.data_catalogue = 'Data' DBConfig.config_params = 'properties.txt' DBConfig.p_params = 'p_params.txt' DBConfig.qrs_params = 'qrs_params.txt' DBConfig.t_params = 't_params.txt' DBConfig.filter_params = 'filter_params.txt' init_params(params_type=ParamsType.config_params) init_params(params_type=ParamsType.p_params) init_params(params_type=ParamsType.qrs_params) init_params(params_type=ParamsType.t_params) init_params(params_type=ParamsType.filter_params) cb = Cardiobase() cb.connect() leads_names = ConfigParams['LEADS_NAMES'] columns_names = [] for lead_name in leads_names: columns_names.append(lead_name + "_filtrated") columns_names.append(lead_name + "_p_delineation") columns_names.append(lead_name + "_qrs_delineation") columns_names.append(lead_name + "_t_delineation") columns_names.append(lead_name + "_characteristics") record_name = 'record_1007'
from Source.CardioBase.cardiobase import Cardiobase from Source.Model.main.ecg.ecg import * DBConfig.name = 'shiller' DBConfig.root = 'pyecgdel' DBConfig.data_catalogue = 'Data' DBConfig.config_params = 'properties.txt' DBConfig.p_params = 'p_params.txt' DBConfig.qrs_params = 'qrs_params.txt' DBConfig.t_params = 't_params.txt' DBConfig.filter_params = 'filter_params.txt' db_path = DBConfig.get_db_path() cb = Cardiobase() cb.connect() max_id_file = 0 columns = ["json_R_QRS_ON", "json_R_QRS_OFF", "json_R_P_ON", "json_R_T_OFF"] for column_id in range(0, len(columns)): column = columns[column_id] #data = cb.bulk_data_get([column], "device_model='AT-101' AND id_file>" + str(max_id_file)) data = cb.bulk_data_get([column], "device_model='AT-101'") records_ids = data['id'] ecg_data = data['data']
# -*- coding: utf-8 -*- import os import numpy as np from Source.CardioBase.cardiobase import Cardiobase cb = Cardiobase() cb.connect() col = cb.get_columns() patients = np.loadtxt( 'C:/Study/CyberHeart/trunk/diagnostics/database/ptbdb/patients.txt', dtype=np.int64) path = 'C:/Study/CyberHeart/trunk/diagnostics/database/ptbdb/patient_' for i in range(1, 1): for x in os.listdir(path + str(i)): d = {} rec_path = path + str(i) + '/' + x id_file = cb.create_file(int(patients[i - 1]), str(patients[i - 1]) + '_' + x) cb.close_file(id_file) for lead in cb.leads: original = np.loadtxt(rec_path + '/lead_' + lead + '/original.txt') filtrated = np.loadtxt(rec_path + '/lead_' + lead + '/filtrated.txt') p_delineation = np.loadtxt(rec_path + '/lead_' + lead +