Exemplo n.º 1
0
recs_to_remove = ['n24', 'n27', 'n28']

annotator_array = ws.dload_annotator_names(db_name)
for ann_name in annotator_array:
    print ann_name
    if ann_name == "qrs":
        annotation = ann_name
    if ann_name == "atr":
        annotation = ann_name
print("annotators for this database are: " + str(annotator_array) +
      " we are choosing " + str(annotation))
initial_rec_array = ws.dload_rec_names(db_name)

wo_continuation_recs = ws.rmv_continuation_rec(initial_rec_array)
rec_name_array = ws.rmv_test_rec(wo_continuation_recs)
#rec_name_array=ws.rmv_even_rec(wo_continuation_recs)

print str(rec_name_array)

#############################################################################
#### list of features (per record) that we want to extract ######
# global_mean
# global_std_dev
# nn50
# pnn50
# sdsd
# window_1_std_dev
# .
# .
# .
        annotation=ann_name;
    elif ann_name == "qrs":
        annotation=ann_name;
    elif ann_name=='ecg':
        annotation=ann_name;

# if db_name == 'afdb':
#     annotation='atr'
print("annotators for this database are: " + str(annotator_array) + " we are choosing " + str(annotation))


initial_rec_array=ws.dload_rec_names(db_name);
 
 
wo_continuation_recs=ws.rmv_continuation_rec(initial_rec_array)
rec_name_array=ws.rmv_test_rec(wo_continuation_recs)
#rec_name_array=ws.rmv_even_rec(wo_continuation_recs)
 
 
print str(rec_name_array)



db_name="afpdb";
initial_rec_array=[];
rec_name_array=[];
annotator_array=[];
wo_continuation_recs=[]
 
recs_to_remove=['n24','n27','n28'];
 
annotator_array=ws.dload_annotator_names(db_name);
for ann_name in annotator_array:
    print ann_name
    if ann_name == "qrs":
        annotation=ann_name;
    if ann_name == "atr":
        annotation=ann_name;
print("annotators for this database are: " + str(annotator_array) + " we are choosing " + str(annotation))
initial_rec_array=ws.dload_rec_names(db_name);
 
 
#wo_continuation_recs=ws.rmv_continuation_rec(initial_rec_array)



rec_name_array_temp=ws.rmv_test_rec(initial_rec_array)

#rec_name_array=ws.rmv_p_rec(rec_name_array_temp)
#rec_name_array=ws.rmv_even_rec(wo_continuation_recs)
rec_name_array=rec_name_array_temp
 
print str(rec_name_array)

#############################################################################

#############################################################################


#radius_array=[0.02,0.04,0.06,0.08,0.10,0.12,0.14,0.16,0.18,0.20,0.22,0.24,0.26,0.28,0.30,0.32,0.34,0.36,0.38, 0.40];
radius_array=[x / 1000.0 for x in range(0, 1020, 20)]
all_features=[]
        annotation = ann_name
    elif ann_name == "qrs":
        annotation = ann_name
    elif ann_name == "ecg":
        annotation = ann_name

# if db_name == 'afdb':
#     annotation='atr'
print ("annotators for this database are: " + str(annotator_array) + " we are choosing " + str(annotation))


initial_rec_array = ws.dload_rec_names(db_name)


wo_continuation_recs = ws.rmv_continuation_rec(initial_rec_array)
rec_name_array = ws.rmv_test_rec(wo_continuation_recs)
# rec_name_array=ws.rmv_even_rec(wo_continuation_recs)


print str(rec_name_array)


db_name = "afpdb"
initial_rec_array = []
rec_name_array = []
annotator_array = []
wo_continuation_recs = []

recs_to_remove = ["n24", "n27", "n28"]

annotator_array = ws.dload_annotator_names(db_name)
        annotation=ann_name;
    elif ann_name == "qrs":
        annotation=ann_name;
    elif ann_name=='ecg':
        annotation=ann_name;

# if db_name == 'afdb':
#     annotation='atr'
print("annotators for this database are: " + str(annotator_array) + " we are choosing " + str(annotation))


initial_rec_array=ws.dload_rec_names(db_name);
 
 
wo_continuation_recs=ws.rmv_continuation_rec(initial_rec_array)
rec_name_array=ws.rmv_test_rec(wo_continuation_recs)
#rec_name_array=ws.rmv_even_rec(wo_continuation_recs)
 
 
print str(rec_name_array)

#############################################################################



#dictionary to store indices of features
global_vocab_ecg={}; 
index_of_features_ecg=0;
all_features=[]

pwave_time_patient=[]# this is a list of list that will contain p wave values for all records