添加命令行事件选择
This commit is contained in:
parent
ce06ffd5b8
commit
f04f8a9e03
@ -29,7 +29,7 @@ all_path = [PSG_Data_Path, PSG_Label_Path, BCG_Data_Path, BCG_Label_Path]
|
||||
|
||||
# 要遍历的事件
|
||||
# 可选一个或多个 "Hypopnea" "Central apnea" "Obstructive apnea" "Mixed apnea"
|
||||
focus_event_list = ["Obstructive apnea"]
|
||||
focus_event_list = ["OSA"]
|
||||
# 信号显示事件前多少秒
|
||||
front_add_second = 60
|
||||
# 信号显示事件后多少秒
|
||||
@ -43,7 +43,8 @@ start_bcg_index = 0
|
||||
if __name__ == '__main__':
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument('-n', '--sampNo', nargs='?', type=int, default=sampNo, help='samp number')
|
||||
parser.add_argument('-e', '--event', nargs='*', type=list, default='OSA', choices=['OSA', 'CSA', 'MAS', 'HPY'],
|
||||
parser.add_argument('-e', '--event', nargs='*', type=str, default=focus_event_list,
|
||||
choices=['OSA', 'CSA', 'MSA', 'HPY'],
|
||||
help='focus_event')
|
||||
parser.add_argument('-i', '--start_bcg_index', nargs='?', type=int, default=start_bcg_index, help='samp number')
|
||||
parser.add_argument('-f', '--front_add_second', nargs='?', type=int, default=front_add_second,
|
||||
@ -52,6 +53,16 @@ if __name__ == '__main__':
|
||||
help='Add x second signal after the event')
|
||||
opt = parser.parse_args()
|
||||
|
||||
focus_event_list = []
|
||||
if 'OSA' in opt.focus_event_list:
|
||||
focus_event_list.append("Obstructive apnea")
|
||||
if 'CSA' in opt.focus_event_list:
|
||||
focus_event_list.append("Central apnea")
|
||||
if 'MSA' in opt.focus_event_list:
|
||||
focus_event_list.append("Mixed apnea")
|
||||
if 'HPY' in opt.focus_event_list:
|
||||
focus_event_list.append("Hypopnea")
|
||||
|
||||
qualityRelabel = Quality_Relabel(all_path=all_path, sampNo=opt.sampNo, frequency=frequency,
|
||||
bcg_frequency=bcg_frequency,
|
||||
focus_event_list=focus_event_list)
|
||||
|
Loading…
Reference in New Issue
Block a user