Skip to content

Commit c257e6f

Browse files
committed
add ability to input either cfg or filepath
1 parent 5d3245f commit c257e6f

File tree

2 files changed

+13
-6
lines changed

2 files changed

+13
-6
lines changed

demos/CPP_getResponseDemo.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
%% Demo showing how to use the getResponse function
1+
%% Demo showing how to use the getResponse function
22

33
% This small script shows how to use the getReponse function
44

src/readOutputFilter.m

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
function outputFiltered = readOutputFilter(cfg, filterHeader, filterContent)
1+
function outputFiltered = readOutputFilter(varargin, filterHeader, filterContent)
22
% outputFiltered = readOutputFilter(cfg, filterHeader, filterContent)
33
%
44
% It will display in the command window the content of the `output.tsv' filtered by one element
@@ -22,11 +22,18 @@
2222
% - outputFiltered: dataset with only the specified content, to see it in the command window
2323
% use display(outputFiltered)
2424

25+
if isstring(varargin{1})
26+
tsvFile = varargin{1}
27+
elseif isstruct(varargin{1})
28+
tsvFile = fullfile(varargin{1}.dir.outputSubject, ...
29+
varargin{1}.fileName.modality, ...
30+
varargin{1}.fileName.events);
31+
end
2532

26-
% Get the outputfile path
27-
tsvFile = fullfile(cfg.dir.outputSubject, ...
28-
cfg.fileName.modality, ...
29-
cfg.fileName.events);
33+
% % Get the outputfile path
34+
% tsvFile = fullfile(cfg.dir.outputSubject, ...
35+
% cfg.fileName.modality, ...
36+
% cfg.fileName.events);
3037

3138
% Read the the tsv file and store each column in a field of `output` structure
3239
output = bids.util.tsvread(tsvFile);

0 commit comments

Comments
 (0)