繁体   English   中英

有没有办法从 acqknowledge 中检索生理数据并在 R 中对其进行预处理?

[英]Is there a way to retrieve physiological data from acqknowledge and preprocess them in R?

我正在尝试从 Acqknowledge 检索原始生理数据(手测力计),以便能够以自动化方式在 R(或 Matlab)中对它们进行预处理和分析。 有没有办法做到这一点 ? 我想避免必须手动将数据从 Acknowledge 复制/粘贴到 Excel 以在 R 中读取它们。

然后我想对数据应用过滤器并检索 R 中感兴趣的挤压。有没有办法做到这一点?

非常欢迎任何建议,在此先感谢您!

我有一个类似的问题。 关键是 load_acq.m 函数,你可以在这里找到它 -> https://github.com/munoztd0/fusy-octave-memories/blob/main/load_acq.m然后你可以遍历它们并将它们保存为.csv 或任何您可以在 R 中加载和使用的文件。

至于如何做到这一点,我已经整理了一个小程序来做到这一点。

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Create physiological files from AcqKnowledge
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% SETTING THE PATH
path = 'your path here'; %your path here
physiodir   = fullfile(path, '/SOURCE/physio');
outdir = fullfile(path, '/DERIVATIVES/physio');
session = "first" %your session

base = [path 'sub-**_ses-' session '*'];

subj = dir(base); %check all matching subject for this session

addpath([path '/functions']) % load aknowledge functions
%check here https://github.com/munoztd0/fusy-octave-memories/blob/main/load_acq.m

for i=1:length(subj)

cd (physiodir) %go to the folder

subjO = char(subj(i).name);
subjX =  subjO(end-3:end); %remove .mat extension
filename = [subjX '.acq']; %add .acq extension
                

disp (['****** PARTICIPANT: ' subjX ' **** session ' session ' ****' ]);

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% OPEN FILE
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


physio = load_acq(filename); %load and transform acknowledge file

data = physio.data; %or whatever the name is




%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% CREATE AND SAVE THE CHANNEL
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%



cd (outdir) %go to the folder

% save the data as a file text in the participant directory
fid = fopen([subjX ',txt'],'wt');
for ii = 1:length(data)
    fprintf(fid,'%g\t',data(ii));
    fprintf(fid,'\n');
end
fclose(fid);

end 

希望能帮助到你 !

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM