Skip to content

Commit

Permalink
GUI update: reformat char to string for tInfo and gInfo
Browse files Browse the repository at this point in the history
fix sccn#95. also add .txt extension to README. tested to work with p300 dataset.
  • Loading branch information
cll008 committed Oct 28, 2021
1 parent a0190d8 commit 98eb293
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 3 deletions.
2 changes: 1 addition & 1 deletion bids_export.m
Original file line number Diff line number Diff line change
Expand Up @@ -481,7 +481,7 @@ function bids_export(files, varargin)
% ---------------------------
if ~isempty(opt.README)
if exist(opt.README) ~= 2
fid = fopen(fullfile(opt.targetdir, 'README'), 'w');
fid = fopen(fullfile(opt.targetdir, 'README.txt'), 'w');
if fid == -1, error('Cannot write README file'); end
fprintf(fid, '%s', opt.README);
fclose(fid);
Expand Down
18 changes: 16 additions & 2 deletions pop_taskinfo.m
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,11 @@ function okCB(src,event)
if strcmp(objs(i).Tag, 'ReferencesAndLinks') || strcmp(objs(i).Tag, 'Authors')
gInfo.(objs(i).Tag) = {objs(i).String};
else
gInfo.(objs(i).Tag) = objs(i).String;
tmp = objs(i).String;
if ndims(tmp) > 1 && size(tmp,1) > 1
tmp = reformatchartostring(tmp);
end
gInfo.(objs(i).Tag) = tmp;
end
else
if strcmp(objs(i).Style, 'popupmenu')
Expand All @@ -210,7 +214,11 @@ function okCB(src,event)
tmp.FilterDescription.Description = objs(i).String;
tInfo.(objs(i).Tag) = tmp;
else
tInfo.(objs(i).Tag) = objs(i).String;
tmp = objs(i).String;
if ndims(tmp) > 1 && size(tmp,1) > 1
tmp = reformatchartostring(tmp);
end
tInfo.(objs(i).Tag) = tmp;
end
end
end
Expand Down Expand Up @@ -340,4 +348,10 @@ function preFill()

function editedCB(src,event)
end

function string_out = reformatchartostring(char_in)
char_in(1:end-1,end+1) = newline;
char_in = char_in';
string_out = char_in(:)';
end
end

0 comments on commit 98eb293

Please sign in to comment.