help > spm_fnirs_read_nirscout.m issue
Jul 8, 2016  06:07 PM | Don Rojas
spm_fnirs_read_nirscout.m issue
Hi Sungho,

I was running into some problems with some code I'd written that deleted channels in our nirx datasets and wrote out new channel configurations files. I hadn't realized until late that the spm_fnirs_read_nirscout script was overwriting my channel configuration file between lines 150-154. I modified the file as follows to test for an existing file, so as not to overwrite the customized one I had produced:

sfname = fullfile(pathstr, 'ch_config.txt');
if ~exist(sfname, 'file')
fid_w = fopen(sfname, 'w');
fprintf(fid_w, '%s\r\n', 'Ch, Source, Detector');
for j = 1:P.nch, fprintf(fid_w, '%s\r\n', [num2str(j) ', ' num2str(ch_sd(j,1)) ', ' num2str(ch_sd(j,2))]); end
fclose(fid_w);
end

I attached the revised file for your convenience if it makes sense to you. At any rate, the modification works well for me.

Best,

Don

Threaded View

TitleAuthorDate
spm_fnirs_read_nirscout.m issue
Don Rojas Jul 8, 2016
Sungho Tak Jul 12, 2016