コード例 #1
0
if is_plotHB_filt:
	study1.gen_filt()
	sig_filt = study1.dfbp_mva_sm 
	plt.figure(2)
	plt.subplot(211), study1.plot_Hb(sig_filt, 'oxyHb', marker=marker)
	plt.subplot(212), study1.plot_Hb(sig_filt, 'deoHb', marker=marker)


# Plot 2 levels of mental workload
Hbtype = 'oxyHb'
if is_plot2lvl:
	fig = plt.figure()
	fig.suptitle(subject + ' - ' + Hbtype, fontsize=14, fontweight='bold')
	for i in range(1, study1.dataset.numchan + 1):
		print '+++ Processing channel ', str(i)
		plt.subplot(3, 5, i*2), study1.plot_mean_2lvl('Channel ' + str(i), 
				Hbtype, lvl1_trials, lvl2_trials, lvllegend)

plt.show()


# Save file
if is_savefile:
	study1.split2trials() 	# make sure dfmi_Hbsorted has been created
	for i in ('oxyHb', 'deoHb'):
		filename = subject + date + i + '.TXT'
		study1.write_matrix(filename, i)

	# 
	np.savetxt(subject + date + 'label.TXT', study1.dataset.label, fmt='%s')
コード例 #2
0
ファイル: run_study.py プロジェクト: quangNguyen122/pyMental

# Just plot something
if is_plotHB_raw:
	df = study1.dataset.df
	plt.figure(1)
	plt.subplot(211), study1.plot_Hb(df.T, 'oxyHb', marker=marker)
	plt.subplot(212), study1.plot_Hb(df.T, 'deoHb', marker=marker)

# Plot 2 levels of mental workload
Hbtype = 'deoHb'
if is_plot2lvl:
	lvl1_trials = ['Trial 1', 'Trial 4'] # exe
	lvl2_trials = ['Trial 2', 'Trial 3'] # ima
	plt.figure()
	plt.subplot(352), study1.plot_mean_2lvl('Channel 1', Hbtype, lvl1_trials, lvl2_trials)
	plt.subplot(354), study1.plot_mean_2lvl('Channel 2', Hbtype, lvl1_trials, lvl2_trials)
	plt.subplot(356), study1.plot_mean_2lvl('Channel 3', Hbtype, lvl1_trials, lvl2_trials)
	plt.subplot(358), study1.plot_mean_2lvl('Channel 4', Hbtype, lvl1_trials, lvl2_trials)
	plt.subplot(3,5,10), study1.plot_mean_2lvl('Channel 5', Hbtype, lvl1_trials, lvl2_trials)
	plt.subplot(3,5,12), study1.plot_mean_2lvl('Channel 6', Hbtype, lvl1_trials, lvl2_trials)
	plt.subplot(3,5,14), study1.plot_mean_2lvl('Channel 7', Hbtype, lvl1_trials, lvl2_trials)


# Plot filtered signal
if is_plotHB_filt:
	study1.gen_filt()
	sig_filt = study1.dfbp_mva_sm 
	plt.figure(2)
	plt.subplot(211), study1.plot_Hb(sig_filt, 'oxyHb', marker=marker)
	plt.subplot(212), study1.plot_Hb(sig_filt, 'deoHb', marker=marker)