顯示具有 Topic 標籤的文章。 顯示所有文章
顯示具有 Topic 標籤的文章。 顯示所有文章

星期四, 1月 04, 2007

Topic: 人體受外力牽拉後引發之姿勢反應_肌肉活化情形_finale



(Horak et al., 1992)













前言:
當人體在站立姿勢下接受一外在的平衡干擾時,下肢與軀幹肌肉的活化程度可以反映人體受到外在干擾後引發之姿勢反應。而當人體在站姿下受到外力干擾而產生前向的身體擺盪時,背側的肌肉主要負責活化以維持或回復平衡,避免跌倒發生。過去文獻指出,當站立於一塊會產生水平後向移動之力板上時,隨著干擾強度增加(力板移動速度加快或移動位移增加),受試者肌肉活化程度亦會隨之增加。但,由腳底板所接受之干擾與從腰間承受之外在干擾對於受試者的姿勢干擾程度與形式是有所不同的,因此,當受試者由腰間接受干擾後,其肌肉活化情形是否亦會隨著干擾強度增加而增加則值得探討。


實驗目的:
探討人體在站姿下從腰部位置受到之前向牽拉干擾時背側肌肉之活化情形,且比較在不同牽拉強度干擾下,人體反應是否會隨之變化。



實驗流程:
在受試者肚臍位置穿戴一腰帶,將三牽拉軸之牽拉線固定於受試者腰帶上(如上圖),由三牽拉軸產生之合力提供為干擾受試者站立平衡之牽拉力量。受試者在受到牽拉之後必須在不跨步的前提下盡可能地維持平衡不跌倒。牽拉強度共有4種 (固定牽拉速度為9cm/s,牽拉位移則依序增加:3,5,7,9cm),每個牽拉強度情境各進行3次測試。以肌電圖所量測到的肌肉活化情形作為受試者受牽拉後的姿勢反應依據,受測肌肉包括:腓腸肌 (MG)、膕旁肌(HAM)、臀中肌(GM),以及脊旁肌(PARA)。



牽拉位移 (cm)牽拉速度 (cm/s)
V139
V259
V379
V499


MATLAB程式目的:
由既訂之檔案途徑擷取資料:一為原始檔案(包括時間與肌肉活化大小(以voltage表示)),一為選取後之onset時間(牽拉開始以及各肌肉開始活化時間)。

功能一(mode 1):
(1) 同時計算各個受試者在不同牽拉強度所引發之integral EMG大小,IEMG計算方式為"肌肉開始活化後150~500毫秒減去牽拉開始前150~500毫秒時間內之IEMG大小做標準化"(總共12次測試)。並計算各個牽拉強度下各受測肌肉IEMG之平均值與標準差(共分為四個強度),以.xls檔案形式儲存於特定資料夾中。
(2) Missing data的處理
a. 當原始EMG資料中任一塊肌肉訊號有所遺漏時,其計算出來的IEMG數值會以NaN顯示,程式可判斷'如果同一次測試中,有任一塊肌肉IEMG數值缺乏時,則該次測試所有肌肉的IEMG數值以-99表示,且皆不列入最後的平均值與標準差之計算'。
b. 另外,程式亦可判斷'當某次測試的原始EMG資料檔案不存在時,則該次測試所有肌肉的IEMG數值以-99表示,且皆不列入最後的平均值與標準差之計算'。
(3) 計算所有受試者在各個牽拉強度下IEMG數值之平均值(group mean),以繪出牽拉強度與肌肉反應之關係圖,並將圖形儲存於特定資料夾中。

功能二(mode 2):畫出各個牽拉強度下EMG活化情形(各以其中一個具代表性的trial呈現),並儲存於既定之資料夾內。

Flowchart


程式內容:
% IEMG7.m
% function: IEMG calculation (including mean and std of the value of each perturbation amplitude) for all trials of each subject
% onset data were retrived automatically
% if the file of raw data is not existed or the data of the measurments of a trial is not recorded, print all the IEMG data of that trial '-99'
% the IEMG results were output and saved as .xls
% print out figures of the selected trials and saved as .jpg
% raw_data: 1_Time(ms) 2_Fy 3_Mx 4_MGr 5_HAMr 6_PARAr 7_GMr 8_Pullonset
% range from (600ms prior to the pull onset) to (5000ms after the pull onset)
% baseline EMG:time interval between (500ms prior to the pull onset) to (150ms priot to the pull onset)
% IEMG:time interval between (150ms after the burst onset) to (500ms after the burst onset)

fclose('all');
clear all;
clc;
global EMGdata_path;
EMGdata_path = input('Please input the folder of the EMG data: [e.g.: D:\\Physical Therapy\\Graduate School\\Thesis\\Pilot study for Thesis\\Data\\Processed data for Matlab]','s');

if isempty(EMGdata_path)
EMGdata_path = 'D:\Physical Therapy\Graduate School\Thesis\Pilot study for Thesis\Data\Processed data for Matlab';
end

cd(EMGdata_path);
Subject_information = textread('Subject_information.txt','%s');
Subject_amount = size(Subject_information,1);
EMGfig_information = textread('EMGfig_information.txt','%s');
EMGfig_amount = size(EMGfig_information,1);

EMGoutput_path = ['D:\Physical Therapy\Graduate School\Thesis\Pilot study for Thesis\Results\Data output from Matlab'];
if ~exist(EMGoutput_path,'dir')
mkdir('D:\Physical Therapy\Graduate School\Thesis\Pilot study for Thesis\Results\Data output from Matlab');
end

mod_choice = input('Please Choose the Mode: [1] Integrated EMG Analysis and Correlation Figure Print-out. [2] EMG Figure Print-out. [e.g. 1 or 2]');

switch mod_choice
case 1
for i = 1:Subject_amount
subjectoutput_folder = ['D:\Physical Therapy\Graduate School\Thesis\Pilot study for Thesis\Results\Data output from Matlab\Results for IEMG calculation'];
if ~exist(subjectoutput_folder,'dir')
mkdir('D:\Physical Therapy\Graduate School\Thesis\Pilot study for Thesis\Results\Data output from Matlab\Results for IEMG calculation');
end

Onsetdata_xls = xlsread([EMGdata_path,'\',Subject_information{i}(1:4),'\','Time events for EMG and pullonset signials.xls'],'B3:F14'); % [pullonset,MGronset,HAMronset,PARAronset,GMronset]

data_name=0;
Onsetdata=0;
IEMG=0;

fprintf('\n %s\t\t rMG (V*ms)\t rHAM (V*ms)\t rPARA (V*ms)\t rGM (V*ms)\n',Subject_information{i}(1:4))

IEMG_fid = fopen([subjectoutput_folder,'\',Subject_information{i},'Integrated EMG','.xls'],'w');
fprintf(IEMG_fid,' \t rMG (V*ms)\t rHAM (V*ms)\t rPARA (V*ms)\t rGM (V*ms)\n');

for j = 1:4 % 4 perturbation amplitudes
for k = 1:3 % 3 trials
data_name = [Subject_information{i}(1:4),'C',num2str(1),'V',num2str(j),'R',num2str(k)];
Onsetdata = Onsetdata_xls((j-1)*3+k,:);
rawdata_file = [EMGdata_path,'\',Subject_information{i}(1:4),'\',data_name,'.xls'];
if exist(rawdata_file)
raw_data = xlsread([EMGdata_path,'\',Subject_information{i}(1:4),'\',data_name,'.xls'],'C19:J5618');
baseline = mean(raw_data(101:451,4:7));

rawIEMG(1) = (1/2*(raw_data((Onsetdata(2)-Onsetdata(1)+749),4)+raw_data((Onsetdata(2)-Onsetdata(1)+1099),4))+sum(raw_data((Onsetdata(2)-Onsetdata(1)+750):(Onsetdata(2)-Onsetdata(1)+1098),4))); % unit:V*ms
rawIEMG(2) = (1/2*(raw_data((Onsetdata(3)-Onsetdata(1)+749),5)+raw_data((Onsetdata(3)-Onsetdata(1)+1099),5))+sum(raw_data((Onsetdata(3)-Onsetdata(1)+750):(Onsetdata(3)-Onsetdata(1)+1098),5))); % unit:V*ms
rawIEMG(3) = (1/2*(raw_data((Onsetdata(4)-Onsetdata(1)+749),6)+raw_data((Onsetdata(4)-Onsetdata(1)+1099),6))+sum(raw_data((Onsetdata(4)-Onsetdata(1)+750):(Onsetdata(4)-Onsetdata(1)+1098),6))); % unit:V*ms
rawIEMG(4) = (1/2*(raw_data((Onsetdata(5)-Onsetdata(1)+749),7)+raw_data((Onsetdata(5)-Onsetdata(1)+1099),7))+sum(raw_data((Onsetdata(5)-Onsetdata(1)+750):(Onsetdata(5)-Onsetdata(1)+1098),7))); % unit:V*ms

IEMG = rawIEMG-baseline; % [rMG rHAM rPARA rGM]
if ~isempty(find(isnan(IEMG)))
IEMG(1,1:4) = -99;
end
else
IEMG(1,1:4) = -99;
end

IEMG_command = ['IEMG_cell(',num2str(k),',:) ={IEMG};'];
eval(IEMG_command)

fprintf(' %s\t %f\t %f\t %f\t %f\n',data_name,IEMG)

fprintf(IEMG_fid,' %s\t %.3f\t %.3f\t %.3f\t %.3f\n',data_name,IEMG);
end % for k loop

IEMG_array = reshape([IEMG_cell{:}],4,3)';
for l = 1:4
if ~isempty((find(IEMG_array(:,l) ~= -99)))
mean_IEMG(1,l) = mean(IEMG_array(find(IEMG_array(:,l) ~= -99),l));
std_IEMG(1,l) = std(IEMG_array(find(IEMG_array(:,l) ~= -99),l));
else
mean_IEMG(1,1:4) = -99;
std_IEMG(1,1:4) = -99;
end
end

fprintf(IEMG_fid,' \n');
fprintf(IEMG_fid,' %s\t %.3f\t %.3f\t %.3f\t %.3f\n','Mean',mean_IEMG);
fprintf(IEMG_fid,' %s\t %.3f\t %.3f\t %.3f\t %.3f\n','Std',std_IEMG);
fprintf(IEMG_fid,' \n');

IEMGmean_command = ['IEMGmean_cell(',num2str(j),',:) ={mean_IEMG};'];
eval(IEMGmean_command)

end % for j loop

IEMGmean_array(:,:,i) = reshape([IEMGmean_cell{:}],4,4)';
for q = 1:4 % 4 perturbation amplitudes
sumEMG(q) = sum(IEMGmean_array(q,1,1:i));
GroupMean_cell{1} = sumEMG./Subject_amount;
end
for q = 1:4 % 4 perturbation amplitudes
sumEMG(q) = sum(IEMGmean_array(q,2,1:i));
GroupMean_cell{2} = sumEMG./Subject_amount;
end
for q = 1:4 % 4 perturbation amplitudes
sumEMG(q) = sum(IEMGmean_array(q,3,1:i));
GroupMean_cell{3} = sumEMG./Subject_amount;
end
for q = 1:4 % 4 perturbation amplitudes
sumEMG(q) = sum(IEMGmean_array(q,4,1:i));
GroupMean_cell{4} = sumEMG./Subject_amount;
end

fclose(IEMG_fid);
end % for i loop

GroupMean = reshape([GroupMean_cell{:}],4,4);
x = 1:4;
amp = ['V1';'V2';'V3';'V4'];
cor_IEMG = plot(x,GroupMean,'linewidth',2);xlabel('Perturbation cnodition');ylabel('Mean IEMG (V*ms)');title('Correaltion between muscle responses and perturbation amplitude');legend('MG','HAM','PARA','GM');box off;
set(gca,'xtick',1:4,'xticklabel',amp);
saveas(gcf,'D:\Physical Therapy\Graduate School\Thesis\Pilot study for Thesis\Results\Data output from Matlab\Results for IEMG calculation\IEMGScalingFig','jpg')

case 2
for m = 1:EMGfig_amount
Onsetdata_xls = xlsread([EMGdata_path,'\',EMGfig_information{m}(1:4),'\','Time events for EMG and pullonset signials.xls'],'B3:F14'); % [pullonset,MGronset,HAMronset,PARAronset,GMronset]
data_name = [EMGfig_information{m}(1:10)];
Onsetdata = Onsetdata_xls((str2num(EMGfig_information{m}(8))-1)*3+str2num(EMGfig_information{m}(10)),:);
raw_data = xlsread([EMGdata_path,'\',EMGfig_information{m}(1:4),'\',data_name,'.xls'],'C19:J5618');

muscle_name = {'MG (V)' 'HAM (V)' 'PARA (V)' 'GM (V)'};
linecolor = ['b' 'r' 'g' 'm'];
for n=1:4
subplot(4,1,n),fig_EMG = plot((raw_data(:,1)),(raw_data(:,n+3)),linecolor(n));xlabel('Time (ms)');box off;hold on;onsetline=plot(Onsetdata(1)*ones(100,1),0:max(raw_data(:,n+3))/99:max(raw_data(:,n+3)),'k');text(Onsetdata(1),max(raw_data(:,n+3)),'pull onset');
ylabel_command = ['ylabel(''',muscle_name{n},''')'];
eval(ylabel_command)
end % for n loop

subjectoutput_folder = ['D:\Physical Therapy\Graduate School\Thesis\Pilot study for Thesis\Results\Data output from Matlab\EMG figures'];
if ~exist(subjectoutput_folder,'dir')
mkdir('D:\Physical Therapy\Graduate School\Thesis\Pilot study for Thesis\Results\Data output from Matlab\EMG figures');
end

IEMG_fig_command = ['saveas(gcf,''D:\Physical Therapy\Graduate School\Thesis\Pilot study for Thesis\Results\Data output from Matlab\EMG figures\',data_name,'_fig'',','''jpg'')'];
eval(IEMG_fig_command)
clf;

fprintf('figure print-out: %s\n',data_name)

end % for m loop
end
raw_path = 'C:\MATLAB701\work';
cd(raw_path);

執行結果:

IEMG數值 (以He01為例)
   
rMG (V*ms) rHAM (V*ms) rPARA (V*ms) rGM (V*ms)
He01C1V1R1 2.356 2.288 1.054 5.551
He01C1V1R2 1.641 2.368 0.907 5.878
He01C1V1R3 2.089 2.423 0.927 5.477

Mean 2.029 2.36 0.963 5.636
Std 0.361 0.068 0.08 0.213

He01C1V2R1 2.072 1.916 1.222 5.586
He01C1V2R2 1.198 1.862 1.34 5.578
He01C1V2R3 2.608 1.998 1.614 5.718

Mean 1.959 1.926 1.392 5.627
Std 0.712 0.068 0.201 0.078

He01C1V3R1 2.816 2.233 0.766 5.599
He01C1V3R2 1.951 1.883 3.109 5.227
He01C1V3R3 2.678 2.139 1.792 5.382

Mean 2.482 2.085 1.889 5.403
Std 0.465 0.181 1.175 0.187

He01C1V4R1 2.252 2.067 2.343 5.017
He01C1V4R2 1.52 2.334 0.745 2.722
He01C1V4R3 1.588 1.777 0.967 4.878

Mean 1.787 2.059 1.352 4.206
Std 0.404 0.279 0.866 1.287

牽拉強度與肌肉反應之關係圖


EMG圖形

星期四, 12月 28, 2006

Topic: 人體受外力牽拉後引發之姿勢反應_肌肉活化情形_rev.2

程式更新描述:
1. 加入各個牽拉強度下3次測試IEMG平均值及標準差計算,並將每位受試者各個測試以及各個牽拉強度(平均值與標準差)的IEMG計算結果輸出於同一檔案中,並以.xls檔案形式儲存於特定資料夾中。
2. Missing data的處理
(1)當原始EMG資料中任一塊肌肉訊號有所遺漏時,其計算出來的IEMG數值會以NaN顯示,程式可判斷'如果同一次測試中,有任一塊肌肉IEMG數值缺乏時,則該次測試所有肌肉的IEMG數值以-99表示,且皆不列入最後的平均值與標準差之計算'。
(2)另外,程式亦可判斷'當某次測試的原始EMG資料檔案不存在時,則該次測試所有肌肉的IEMG數值以-99表示,且皆不列入最後的平均值與標準差之計算'。

程式內容:

% IEMG6.m
% function: IEMG calculation (including mean and std of the value of each
% perturbation amplitude) for all trials of each subject
% onset data were retrived automatically
% if the file of raw data is not existed or the data of the measurments of a trial is not recorded, print all the IEMG data of that trial '-99'
% the IEMG results were output and saved as .xls
% raw_data: 1_Time(ms) 2_Fy 3_Mx 4_MGr 5_HAMr 6_PARAr 7_GMr 8_Pullonset
% range from (600ms prior to the pull onset) to (5000ms after the pull
% onset)
% baseline EMG:time interval between (500ms prior to the pull onset) to (150ms priot to the pull onset)
% IEMG:time interval between (150ms after the burst onset) to (500ms after the burst onset)

global EMGdata_path;
EMGdata_path = input('Please input the folder of the EMG data: [e.g.: D:\\Physical Therapy\\Graduate School\\Thesis\\Pilot study for Thesis\\Data\\Processed data for Matlab]','s');

if isempty(EMGdata_path)
EMGdata_path = 'D:\Physical Therapy\Graduate School\Thesis\Pilot study for Thesis\Data\Processed data for Matlab';
end

cd(EMGdata_path);
Subject_information = textread('Subject_information.txt','%s');
Subject_amount = size(Subject_information,1);

EMGoutput_path = ['D:\Physical Therapy\Graduate School\Thesis\Pilot study for Thesis\Results\Data output from Matlab'];
if ~exist(EMGoutput_path,'dir')
mkdir('D:\Physical Therapy\Graduate School\Thesis\Pilot study for Thesis\Results\Data output from Matlab'); % creates the directory dirname in the current directory, if dirname represents a relative path.
end

for i = 1:Subject_amount

subjectoutput_folder = ['D:\Physical Therapy\Graduate School\Thesis\Pilot study for Thesis\Results\Data output from Matlab','\',Subject_information{i}];
if ~exist(subjectoutput_folder,'dir') % dir 顯示目前目錄下的檔案名稱
mkdir('D:\Physical Therapy\Graduate School\Thesis\Pilot study for Thesis\Results\Data output from Matlab',Subject_information{i});
end

Onsetdata_xls = xlsread([EMGdata_path,'\',Subject_information{i}(1:4),'\','Time events for EMG and pullonset signials.xls'],'B3:F14'); % [pullonset,MGronset,HAMronset,PARAronset,GMronset]

data_name=0;
Onsetdata=0;
IEMG=0;

fprintf('\n %s\t\t rMG (V*ms)\t rHAM (V*ms)\t rPARA (V*ms)\t rGM (V*ms)\n',Subject_information{i}(1:4))

IEMG_fid = fopen([subjectoutput_folder,'\',Subject_information{i},'Integrated EMG','.xls'],'w');
fprintf(IEMG_fid,' \t rMG (V*ms)\t rHAM (V*ms)\t rPARA (V*ms)\t rGM (V*ms)\n');

for j = 1:4 % 4 perturbation amplitudes
for k = 1:3 % 3 trials
data_name = [Subject_information{i}(1:4),'C',num2str(1),'V',num2str(j),'R',num2str(k)];
Onsetdata = Onsetdata_xls((j-1)*3+k,:);
rawdata_file = [EMGdata_path,'\',Subject_information{i}(1:4),'\',data_name,'.xls'];
if exist(rawdata_file)
raw_data = xlsread([EMGdata_path,'\',Subject_information{i}(1:4),'\',data_name,'.xls'],'C19:J5618');
baseline = mean(raw_data(101:451,4:7));

rawIEMG(1) = (1/2*(raw_data((Onsetdata(2)-Onsetdata(1)+149),4)+raw_data((Onsetdata(2)-Onsetdata(1)+499),4))+sum(raw_data((Onsetdata(2)-Onsetdata(1)+150):(Onsetdata(2)-Onsetdata(1)+498),4))); % unit:V*ms
rawIEMG(2) = (1/2*(raw_data((Onsetdata(3)-Onsetdata(1)+149),5)+raw_data((Onsetdata(3)-Onsetdata(1)+499),5))+sum(raw_data((Onsetdata(3)-Onsetdata(1)+150):(Onsetdata(3)-Onsetdata(1)+498),5))); % unit:V*ms
rawIEMG(3) = (1/2*(raw_data((Onsetdata(4)-Onsetdata(1)+149),6)+raw_data((Onsetdata(4)-Onsetdata(1)+499),6))+sum(raw_data((Onsetdata(4)-Onsetdata(1)+150):(Onsetdata(4)-Onsetdata(1)+498),6))); % unit:V*ms
rawIEMG(4) = (1/2*(raw_data((Onsetdata(5)-Onsetdata(1)+149),7)+raw_data((Onsetdata(5)-Onsetdata(1)+499),7))+sum(raw_data((Onsetdata(5)-Onsetdata(1)+150):(Onsetdata(5)-Onsetdata(1)+498),7))); % unit:V*ms

IEMG = rawIEMG-baseline; % [rMG rHAM rPARA rGM]
if ~isempty(find(isnan(IEMG))) % 如果有其中一個參數出現missing,則那一個trial內所有的參數皆不列入最後的平均計算
IEMG(1,1:4) = -99;
end
else
IEMG(1,1:4) = -99;
end

IEMG_command = ['IEMG_cell(',num2str(k),',:) ={IEMG};'];
eval(IEMG_command)

fprintf(' %s\t %f\t %f\t %f\t %f\n',data_name,IEMG)

fprintf(IEMG_fid,' %s\t %.3f\t %.3f\t %.3f\t %.3f\n',data_name,IEMG);
end % for k loop

IEMG_array = reshape([IEMG_cell{:}],4,3)';
for l = 1:4
if ~isempty((find(IEMG_array(:,l) ~= -99)))
mean_IEMG(1,l) = mean(IEMG_array(find(IEMG_array(:,l) ~= -99),l));
std_IEMG(1,l) = std(IEMG_array(find(IEMG_array(:,l) ~= -99),l));
else
mean_IEMG(1,1:4) = -99;
std_IEMG(1,1:4) = -99;
end
end

fprintf(IEMG_fid,' \n');
fprintf(IEMG_fid,' %s\t %.3f\t %.3f\t %.3f\t %.3f\n','Mean',mean_IEMG);
fprintf(IEMG_fid,' %s\t %.3f\t %.3f\t %.3f\t %.3f\n','Std',std_IEMG);
fprintf(IEMG_fid,' \n');
end % for j loop

fclose(IEMG_fid);

end % for i loop

討論:
待完成事項:
1. 將程式一開始改為3種mode選擇:mode1-計算IEMG;mode2-單純繪出代表的EMG圖形;mode3-計算肌肉活化程度(IEMG)與干擾強度之相關性並繪圖。

星期四, 12月 21, 2006

Topic: 人體受外力牽拉後引發之姿勢反應_肌肉活化情形_rev.1

程式更新描述:
1. 將onset時間輸入方式改為由程式直接從已建立之excel檔案內擷取所需資料,不須經由對話窗輸入。
2. 新程式可同時讀取不同資料夾(依受試者ID不同做區別)內各個測試原始EMG data,並分別與該測試的onset時間資料相對應,如此可同時計算多位受試者以及多個測試的IEMG結果。
3. 將計算結果依每位受試者的測試順序做排序,俾輸出於指令窗中。

注意事項:
1. 實驗結果可儲存於任一路徑,若無指定路徑,則依預設路徑(D:\Physical Therapy\Graduate School\Thesis\Pilot study for Thesis\Data\Processed data for Matlab)進行原始資料之讀取。預設路徑內除了原始的實驗結果之外,亦須包括一Subject_information.txt檔案,紀錄欲分析之受試者ID,若欲分析不同受試者,則須由此檔案做變更。
2. 各個受試者的實驗結果以.xls檔案形式儲存於個別資料夾中(命名方式如,He01、He02、St05等;He/St代表不同受試者組別),各個受試者之資料夾中須包括所有測試的原始EMG data(命名方式如,He01C1V1R1、He02C1V2R3等;V代表不同牽拉干擾強度,R代表不同測試)以及onset時間檔案(Time events for EMG and pullonset signials.xls)

程式內容:

% IEMG4.m
% function: IEMG calculation for all trials of each subject
% onset data were retrived automatically
% the IEMG results were displayed on the command window
% raw_data: 1_Time(ms) 2_Fy 3_Mx 4_MGr 5_HAMr 6_PARAr 7_GMr 8_Pullonset
% range from (600ms prior to the pull onset) to (5000ms after the pull onset)
% baseline EMG:time interval between (500ms prior to the pull onset) to (150ms priot to the pull onset)
% IEMG:time interval between (150ms after the burst onset) to (500ms after the burst onset)

global EMGdata_path;
EMGdata_path = input('Please input the folder of the EMG data: [e.g.: D:\\Physical Therapy\\Graduate School\\Thesis\\Pilot study for Thesis\\Data\\Processed data for Matlab]','s');

if isempty(EMGdata_path)
EMGdata_path = 'D:\Physical Therapy\Graduate School\Thesis\Pilot study for Thesis\Data\Processed data for Matlab';
end

cd(EMGdata_path);
Subject_information = textread('Subject_information.txt','%s');
Subject_amount = size(Subject_information,1);


for i = 1:Subject_amount


Onsetdata_xls = xlsread([EMGdata_path,'\',Subject_information{i}(1:4),'\','Time events for EMG and pullonset signials.xls'],'B3:F14'); % [pullonset,MGronset,HAMronset,PARAronset,GMronset]
data_name=0;
Onsetdata=0;
IEMG=0;

fprintf('\n %s\n',Subject_information{i}(1:4))

for j = 1:4 % 4 perturbation amplitudes
for k = 1:3 % 3 trials
data_name = [Subject_information{i}(1:4),'C',num2str(1),'V',num2str(j),'R',num2str(k)];
if exist([EMGdata_path,'\',Subject_information{i}(1:4),'\',data_name,'.xls'])
data_name = [Subject_information{i}(1:4),'C',num2str(1),'V',num2str(j),'R',num2str(k)];
else
data_name = [Subject_information{i}(1:4),'C',num2str(1),'V',num2str(j),'R',num2str(k),'r'];
end
Onsetdata = Onsetdata_xls((j-1)*3+k,:);
raw_data = xlsread([EMGdata_path,'\',Subject_information{i}(1:4),'\',data_name,'.xls'],'C19:J5618');
baseline = mean(raw_data(101:451,4:7));

rawIEMG(1) = (1/2*(raw_data((Onsetdata(2)-Onsetdata(1)+149),4)+raw_data((Onsetdata(2)-Onsetdata(1)+499),4))+sum(raw_data((Onsetdata(2)-Onsetdata(1)+150):(Onsetdata(2)-Onsetdata(1)+498),4))); % unit:V*ms
rawIEMG(2) = (1/2*(raw_data((Onsetdata(3)-Onsetdata(1)+149),5)+raw_data((Onsetdata(3)-Onsetdata(1)+499),5))+sum(raw_data((Onsetdata(3)-Onsetdata(1)+150):(Onsetdata(3)-Onsetdata(1)+498),5))); % unit:V*ms
rawIEMG(3) = (1/2*(raw_data((Onsetdata(4)-Onsetdata(1)+149),6)+raw_data((Onsetdata(4)-Onsetdata(1)+499),6))+sum(raw_data((Onsetdata(4)-Onsetdata(1)+150):(Onsetdata(4)-Onsetdata(1)+498),6))); % unit:V*ms
rawIEMG(4) = (1/2*(raw_data((Onsetdata(5)-Onsetdata(1)+149),7)+raw_data((Onsetdata(5)-Onsetdata(1)+499),7))+sum(raw_data((Onsetdata(5)-Onsetdata(1)+150):(Onsetdata(5)-Onsetdata(1)+498),7))); % unit:V*ms

IEMG= rawIEMG-baseline; % [rMG rHAM rPARA rGM]

fprintf(' %s\t %f\t %f\t %f\t %f\n',data_name,IEMG(1),IEMG(2),IEMG(3),IEMG(4))
end % for k loop
end % for j loop
end % for i loop

執行結果:



討論:
1. 目前程式內容,僅限於將計算結果輸出於指令窗中,待完成部分包括:(1)將各個trial之IEMG計算值和每3個trial之平均值和標準差(代表各個牽拉強度)之執行結果以excel檔案形式輸出並儲存於特定資料夾中。
(2) 選出欲代表的EMG活化圖形之trial(以對話方式進行),並將圖形輸出且儲存於既定資料夾內

星期四, 12月 14, 2006

Topic: 人體受外力牽拉後引發之姿勢反應_肌肉活化情形



(Horak et al., 1992)






前言:
當人體在站立姿勢下接受一外在的平衡干擾時,下肢與軀幹肌肉的活化程度可以反映人體受到外在干擾後引發之姿勢反應。而當人體在站姿下受到外力干擾而產生前向的身體擺盪時,背側的肌肉主要負責活化以維持或回復平衡,避免跌倒發生。過去文獻指出,當站立於一塊會產生水平後向移動之力板上時,隨著干擾強度增加(力板移動速度加快或移動位移增加),受試者肌肉活化程度亦會隨之增加。但,由腳底板所接受之干擾與從腰間承受之外在干擾對於受試者的姿勢干擾程度與形式是有所不同的,因此,當受試者由腰間接受干擾後,其肌肉活化情形是否亦會隨著干擾強度增加而增加則值得探討。


實驗目的:
探討人體在站姿下從腰部位置受到之前向牽拉干擾時背側肌肉之活化情形,且比較在不同牽拉強度干擾下,人體反應是否會隨之變化。



實驗流程:
在受試者肚臍位置穿戴一腰帶,將三牽拉軸之牽拉線固定於受試者腰帶上(如上圖),由三牽拉軸產生之合力提供為干擾受試者站立平衡之牽拉力量。受試者在受到牽拉之後必須在不跨步的前提下盡可能地維持平衡不跌倒。牽拉強度共有4種 (固定牽拉速度為9cm/s,牽拉位移則依序增加:3,5,7,9cm),每個牽拉強度情境各進行3次測試。以肌電圖所量測到的肌肉活化情形作為受試者受牽拉後的姿勢反應依據,受測肌肉包括:腓腸肌 (MG)、膕旁肌(HAM)、臀中肌(GM),以及脊旁肌(PARA)。



牽拉位移 (cm)牽拉速度 (cm/s)
V139
V259
V379
V499


MATLAB程式目的:
1. 由既訂之檔案途徑擷取資料:一為原始檔案(包括時間與肌肉活化大小(以voltage表示)),一為選取後之onset時間(牽拉開始以及各肌肉開始活化時間)。
2.
功能一(mode 1):由原始EMG資料(excel檔案)計算不同牽拉強度所引發之integral EMG大小(IEMG計算方式為,肌肉開始活化後150~500毫秒減去牽拉開始前150~500毫秒時間內之IEMG大小做標準化)。並計算各個牽拉強度下各受測肌肉IEMG之平均值與標準差,以excel格式輸出並儲存於既定之資料夾內。
功能二(mode 2):畫出各個牽拉強度下EMG活化情形(各以其中一個具代表性的trial呈現),並儲存於既定之資料夾內。
Flowchart


以下為部分完成之程式內容
程式內容:
% IEMG.m

% function:IEMG calculation and EMG figure for one trial of a subject

% onset data were inputted by key-in

% IEMG results and EMG figure were displayed on the command window% raw_data: 1_Time(ms) 2_Fy 3_Mx 4_MGr 5_HAMr 6_PARAr 7_GMr 8_Pullonset

% range from (600ms prior to the pull onset) to (5000ms after the pull onset)

% baseline EMG:time interval between (500ms prior to the pull onset) to (150ms priot to the pull onset)

% IEMG:time interval between (150ms after the burst onset) to (500ms after the burst onset)


pullonset=input('please input the onset time of the perturbation (ms):');

MGronset=input('please input the onset time of the Medial Gastrocnemius muscle activation (ms):');

HAMronset=input('please input the onset time of the Hamstring muscle activation (ms):');

PARAronset=input('please input the onset time of the Paraspinal muscle activation (ms):');

GMronset=input('please input the onset time of the Gluteus Medius muscle activation (ms):');

raw_data=xlsread('D:\Physical Therapy\Graduate School\Thesis\Pilot study for Thesis\Data\ASCII output\Selected channels_Fy_Mx_rMG_rHAM_rPARA_rGM_pull onset\He01C1V1R1.xls','C19:J5618');

EMGonset=[MGronset,HAMronset,PARAronset,GMronset];

baseline=mean(raw_data(101:451,4:7));

for i=1:4

rawIEMG(i)=(1/2*(raw_data((EMGonset(i)-pullonset+149),i+3)+raw_data((EMGonset(i)-pullonset+499),i+3))+sum(raw_data((EMGonset(i)-pullonset+150):(EMGonset(i)-pullonset+498),i+3))); % unit:V*ms

end

IEMG=rawIEMG-baseline;

IEMG_MGr=IEMG(1),IEMG_HAMr=IEMG(2),IEMG_PARAr=IEMG(3),IEMG_GMr=IEMG(4)



% 以下為繪圖指令

muscle_name = {'MG (V)' 'HAM (V)' 'PARA (V)' 'GM (V)'};

linecolor=['b' 'r' 'g' 'm'];

for i=1:4

subplot(4,1,i),fig_EMG=plot((raw_data(:,1)),(raw_data(:,i+3)),linecolor(i));xlabel('Time (ms)');box off;hold on;onsetline=plot(pullonset*ones(100,1),0:max(raw_data(:,i+3))/99:max(raw_data(:,i+3)),'k');text(pullonset,max(raw_data(:,i+3)),'pull onset');

ylabel_command = ['ylabel(''',muscle_name{i},''')'];

eval(ylabel_command)

end

執行結果:

IEMG數值


EMG圖形


討論:
1. 實驗結果的蒐集會依實驗情境不同而讓受測者進行多個測試,所以結果大多會以多個檔案分別儲存(以測試名稱做區別)。程式的目的主要是想將實驗結果以最簡便的方式做運算,不須經過太多人為的介入,所以程式的重點將大部分著重在資料的處理部份,減少對話框方式的進行,讓使用者可以在同一時間內處理多筆資料。
2. 目前的程式內容只單純建立IEMG計算方式以及EMG活化之圖形呈現格式,且牽拉和肌肉活化onset時間是以對話方式呈現。之後待完成的部分還包括:
(1) 將onset時間輸入方式改為由程式直接從已建立之excel檔案內擷取所需資料。
(2) 繼續完成在同時間內讀取多個trial之測試結果,並將各個trial之IEMG計算值和每3個trial之平均值和標準差(代表各個牽拉強度)之執行結果以excel檔案形式輸出並儲存。
(3) 選出欲代表的EMG活化圖形之trial(以對話方式進行),並將圖形輸出且儲存於既定資料夾內