Skip to content

Commit ed0c1f8

Browse files
committed
uncomment remaining tests
1 parent 9ee6a32 commit ed0c1f8

1 file changed

Lines changed: 94 additions & 94 deletions

File tree

PhysIO/tests/unit/readin/tapas_physio_readin_bids_test.m

Lines changed: 94 additions & 94 deletions
Original file line numberDiff line numberDiff line change
@@ -27,100 +27,100 @@
2727
tests = functiontests(localfunctions);
2828
end
2929

30-
% % compare raw read-in PPU trace data from BIDS example to previously saved reference
31-
% % results
32-
% function test_readin_bids_ppu3t(testCase)
33-
%
34-
% % Get PhysIO public repo base folder from this file's location
35-
% pathPhysioPublic = fullfile(fileparts(mfilename('fullpath')), '..', '..', '..');
36-
%pathExamples = tapas_physio_get_path_examples(pathPhysioPublic);
37-
%
38-
%
39-
% % load SPM matlabbatch, but convert to pure script before executing
40-
% % remove unnecessary (beyond read-in) part from job exeuction (e.g.
41-
% % visualization, modeling)
42-
% % ...still needs SPM at the moment for conversion
43-
% % TODO: parse matlab-script.m file apart from last, execution line
44-
%
45-
% pathCurrentExample = fullfile(pathExamples, 'BIDS/PPU3T');
46-
% pathNow = pwd;
47-
% cd(pathCurrentExample); % for prepending absolute paths correctly
48-
% fileExample = fullfile(pathCurrentExample, 'bids_ppu3t_spm_job.mat');
49-
% load(fileExample, 'matlabbatch');
50-
%
51-
% physio = tapas_physio_job2physio(matlabbatch{1}.spm.tools.physio);
52-
% physio.verbose.level = 0;
53-
% physio.preproc.cardiac.initial_cpulse_select.method = 'load_from_logfile'; % faster
54-
% physio = tapas_physio_main_create_regressors(physio);
55-
% cd(pathNow)
56-
%
57-
% actPhysio = physio;
58-
%
59-
% % load physio from reference data
60-
% fileReferenceData = fullfile(pathExamples, 'TestReferenceResults', 'readin', ...
61-
% 'physio_readin_bids_ppu3t.mat');
62-
% load(fileReferenceData, 'physio');
63-
% expPhysio = physio;
64-
%
65-
% % extract cpulse from actual and expected solution and compare
66-
% actRaw = actPhysio.ons_secs.raw;
67-
% expRaw = expPhysio.ons_secs.raw;
68-
%
69-
% verifyEqual(testCase, actRaw.t, expRaw.t, 'RelTol', 1e-6, 'Raw time vector does not match');
70-
% verifyEqual(testCase, actRaw.c, expRaw.c, 'RelTol', 1e-6, 'Raw cardiac trace does not match');
71-
% verifyEqual(testCase, actRaw.r, expRaw.r, 'RelTol', 1e-6, 'Raw respiratory trace does not match');
72-
%
73-
% end
74-
%
75-
%
76-
% % compare raw read-in CPULSE data from BIDS example to previously saved reference
77-
% % results
78-
% function test_readin_bids_cpulse3t(testCase)
79-
%
80-
% % run BIDS cpulse3t example and extract physio
81-
% pathPhysioPublic = fullfile(fileparts(mfilename('fullpath')), '..', '..', '..');
82-
% pathExamples = tapas_physio_get_path_examples(pathPhysioPublic);
83-
%
84-
% % load SPM matlabbatch, but convert to pure script before executing
85-
% % remove unnecessary (beyond read-in) part from job exeuction (e.g.
86-
% % visualization, modeling)
87-
% % ...still needs SPM at the moment for conversion
88-
% % TODO: parse matlab-script.m file apart from last, execution line
89-
%
90-
% pathCurrentExample = fullfile(pathExamples, 'BIDS/CPULSE3T');
91-
% pathNow = pwd;
92-
% cd(pathCurrentExample); % for prepending absolute paths correctly
93-
% fileExample = fullfile(pathCurrentExample, 'bids_cpulse3t_spm_job.mat');
94-
% load(fileExample, 'matlabbatch');
95-
%
96-
% physio = tapas_physio_job2physio(matlabbatch{1}.spm.tools.physio);
97-
% physio.verbose.level = 0;
98-
% % Some modeling has to be done, otherwise no raw data preprocessed
99-
% %physio.model.retroicor.include = 0;
100-
% physio.model.retroicor.order.cr = 0;
101-
% physio.model.retroicor.order.r = 0;
102-
% physio.model.hrv.include = 0;
103-
% physio.model.rvt.include = 0;
104-
% physio = tapas_physio_main_create_regressors(physio);
105-
% cd(pathNow)
106-
%
107-
% actPhysio = physio;
108-
%
109-
% % load physio from reference data
110-
% fileReferenceData = fullfile(pathExamples, 'TestReferenceResults', 'readin', ...
111-
% 'physio_readin_bids_cpulse3t.mat');
112-
% load(fileReferenceData, 'physio');
113-
% expPhysio = physio;
114-
%
115-
% % extract cpulse from actual and expected solution and compare
116-
% actRaw = actPhysio.ons_secs.raw;
117-
% expRaw = expPhysio.ons_secs.raw;
118-
%
119-
% verifyEqual(testCase, actRaw.t, expRaw.t, 'Raw time vector does not match');
120-
% verifyEqual(testCase, actRaw.cpulse, expRaw.cpulse, 'Raw cardiac trace does not match');
121-
% verifyEqual(testCase, actRaw.r, expRaw.r, 'Raw respiratory trace does not match');
122-
%
123-
% end
30+
% compare raw read-in PPU trace data from BIDS example to previously saved reference
31+
% results
32+
function test_readin_bids_ppu3t(testCase)
33+
34+
% Get PhysIO public repo base folder from this file's location
35+
pathPhysioPublic = fullfile(fileparts(mfilename('fullpath')), '..', '..', '..');
36+
pathExamples = tapas_physio_get_path_examples(pathPhysioPublic);
37+
38+
39+
% load SPM matlabbatch, but convert to pure script before executing
40+
% remove unnecessary (beyond read-in) part from job exeuction (e.g.
41+
% visualization, modeling)
42+
% ...still needs SPM at the moment for conversion
43+
% TODO: parse matlab-script.m file apart from last, execution line
44+
45+
pathCurrentExample = fullfile(pathExamples, 'BIDS/PPU3T');
46+
pathNow = pwd;
47+
cd(pathCurrentExample); % for prepending absolute paths correctly
48+
fileExample = fullfile(pathCurrentExample, 'bids_ppu3t_spm_job.mat');
49+
load(fileExample, 'matlabbatch');
50+
51+
physio = tapas_physio_job2physio(matlabbatch{1}.spm.tools.physio);
52+
physio.verbose.level = 0;
53+
physio.preproc.cardiac.initial_cpulse_select.method = 'load_from_logfile'; % faster
54+
physio = tapas_physio_main_create_regressors(physio);
55+
cd(pathNow)
56+
57+
actPhysio = physio;
58+
59+
% load physio from reference data
60+
fileReferenceData = fullfile(pathExamples, 'TestReferenceResults', 'readin', ...
61+
'physio_readin_bids_ppu3t.mat');
62+
load(fileReferenceData, 'physio');
63+
expPhysio = physio;
64+
65+
% extract cpulse from actual and expected solution and compare
66+
actRaw = actPhysio.ons_secs.raw;
67+
expRaw = expPhysio.ons_secs.raw;
68+
69+
verifyEqual(testCase, actRaw.t, expRaw.t, 'RelTol', 1e-6, 'Raw time vector does not match');
70+
verifyEqual(testCase, actRaw.c, expRaw.c, 'RelTol', 1e-6, 'Raw cardiac trace does not match');
71+
verifyEqual(testCase, actRaw.r, expRaw.r, 'RelTol', 1e-6, 'Raw respiratory trace does not match');
72+
73+
end
74+
75+
76+
% compare raw read-in CPULSE data from BIDS example to previously saved reference
77+
% results
78+
function test_readin_bids_cpulse3t(testCase)
79+
80+
% run BIDS cpulse3t example and extract physio
81+
pathPhysioPublic = fullfile(fileparts(mfilename('fullpath')), '..', '..', '..');
82+
pathExamples = tapas_physio_get_path_examples(pathPhysioPublic);
83+
84+
% load SPM matlabbatch, but convert to pure script before executing
85+
% remove unnecessary (beyond read-in) part from job exeuction (e.g.
86+
% visualization, modeling)
87+
% ...still needs SPM at the moment for conversion
88+
% TODO: parse matlab-script.m file apart from last, execution line
89+
90+
pathCurrentExample = fullfile(pathExamples, 'BIDS/CPULSE3T');
91+
pathNow = pwd;
92+
cd(pathCurrentExample); % for prepending absolute paths correctly
93+
fileExample = fullfile(pathCurrentExample, 'bids_cpulse3t_spm_job.mat');
94+
load(fileExample, 'matlabbatch');
95+
96+
physio = tapas_physio_job2physio(matlabbatch{1}.spm.tools.physio);
97+
physio.verbose.level = 0;
98+
% Some modeling has to be done, otherwise no raw data preprocessed
99+
%physio.model.retroicor.include = 0;
100+
physio.model.retroicor.order.cr = 0;
101+
physio.model.retroicor.order.r = 0;
102+
physio.model.hrv.include = 0;
103+
physio.model.rvt.include = 0;
104+
physio = tapas_physio_main_create_regressors(physio);
105+
cd(pathNow)
106+
107+
actPhysio = physio;
108+
109+
% load physio from reference data
110+
fileReferenceData = fullfile(pathExamples, 'TestReferenceResults', 'readin', ...
111+
'physio_readin_bids_cpulse3t.mat');
112+
load(fileReferenceData, 'physio');
113+
expPhysio = physio;
114+
115+
% extract cpulse from actual and expected solution and compare
116+
actRaw = actPhysio.ons_secs.raw;
117+
expRaw = expPhysio.ons_secs.raw;
118+
119+
verifyEqual(testCase, actRaw.t, expRaw.t, 'Raw time vector does not match');
120+
verifyEqual(testCase, actRaw.cpulse, expRaw.cpulse, 'Raw cardiac trace does not match');
121+
verifyEqual(testCase, actRaw.r, expRaw.r, 'Raw respiratory trace does not match');
122+
123+
end
124124

125125
% compare newly written bids output file from the Phillips ECG V3 test case to
126126
% saved files

0 commit comments

Comments
 (0)