Partially Different Mechanisms of Social and Nonsocial Attention: Evidence From Changes in Cueing Effects and Underlying Frontal Cortex Processing Over Time.
The 2 matches
- [1] § Methods › fNIRS Data Preprocessing ↔ SOT_fnirs.m, lines 382–424 · score 0.79 · distribution repair, signal improvement, Hz, component, global, shift
- [2] § Methods › fNIRS Data Preprocessing ↔ SOT_fnirs.m, lines 467–540 · score 0.59 · optical density changes, Inc, rejected, fNIRS, channels, SD
Paper
Loaded from Europe PMC by your browser, not stored by OSCR: doi.org · Europe PMC
The paper is loaded when this pane is shown.
The authors' code
MATLAB · 621 lines · 28 KB · no license · 2 matches
- clear; clc
- % Selects and reads in the data file.
- Drive = 'E:\';
- offset = 'y'; %delete the 2nd stimuli
- subj_list = [19:45 47:59 61]; %subj46-SOT1 marker problem
- rep_list = 1;
- task_selection = 1; %1:SOT
- for task_num = task_selection;
- switch task_num
- case 1
- Task = 'SOT';
- trial_tp = 240;
- trial_amp = 1;
- nCond = 6;
- end
- %Path setup
- posfilename = '0001.pos';
- dir_file = [Drive 'From SD Card\Project_C_test_retest\'];
- output_dir = [Drive 'From SD Card\Matlab_C\' Task '_fNIRS_output\'];
- pospath = [Drive 'From SD Card\Matlab_C\PosForHomerConversion\'];
- % Load subject information
- [~,~,c] = xlsread([Drive 'From SD Card\Matlab_C\fNIRS_subj_info.xlsx']);
- SubjINFO_header = c(1,:);
- SubjINFO_data = c(2:end,:);
- %Transform csv to nirs
- for subj = subj_list
- Age = cell2mat(SubjINFO_data(subj,find(cellfun(@(x)isequal(x,'Age'),SubjINFO_header)==1)));
- CapSize = cell2mat(SubjINFO_data(subj,find(cellfun(@(x)isequal(x,'cap_size'),SubjINFO_header)==1)));
- Folder_name = char(SubjINFO_data(subj,find(cellfun(@(x)isequal(x,'Folder_name'),SubjINFO_header)==1)));
- for rep = rep_list;
- for probe = 1:2;
- Probe_num = num2str(probe);
- %correction for 2nd test-retest batch
- if subj<=43 & rep==1
- filename = [Task '_MES_Probe' Probe_num '.csv'];
- else
- filename = [Task num2str(rep) '_MES_Probe' Probe_num '.csv'];
- end
- if rep==2
- filename = [Task num2str(rep) '_MES_Probe' Probe_num '.csv'];
- end
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- % Open raw data file
- fid = fopen([dir_file Folder_name '\' filename]);
- disp('Loading data...');
- while 1
- tline = fgetl(fid);
- if isempty(strfind(tline, 'Mode')) == 0
- rindex = find(tline == ',');
- tline(rindex) = ' ';
- text_array = tline(rindex(1)+1:end);
- end
- if isempty(strfind(tline, 'Wave[nm]')) == 0
- windex = find(tline == ',');
- tline(windex) = ' ';
- text_lambda = tline(windex(1)+1:end);
- wavelengths = str2num(text_lambda);
- end
- if isempty(strfind(tline, 'Sampling Period[s]')) == 0
- nindex = find(tline == ',');
- tline(nindex) = ' ';
- txt_fs = tline(nindex(1)+1:end);
- fs = 1./mean(str2num(txt_fs));
- end
- if isempty(strfind(tline, 'Data')) == 0
- tline = fgetl(fid);
- nch = length(strfind(tline, 'CH'));
- nindex = find(tline == ',');
- try
- col_mark = strfind(tline, 'Mark');
- col_mark = col_mark(1);
- col_mark = find(nindex == col_mark - 1) + 1;
- end
- try
- col_prescan = strfind(tline, 'PreScan');
- col_prescan = col_prescan(1);
- col_prescan = find(nindex == col_prescan - 1)+1;
- end
- while 1
- tline = fgetl(fid);
- if ischar(tline) == 0, break, end,
- nindex = find(tline == ',');
- tline_data = tline(nindex(1)+1:nindex(nch+1)-1);
- nindex_d = find(tline_data == ',');
- tline_data(nindex_d) = ' ';
- tline_data = str2num(tline_data);
- count = str2num(tline(1:nindex(1)-1));
- nirs_data.rawData(count, :) = tline_data;
- try
- vector_onset(count) = str2num(tline(nindex(col_mark-1)+1:nindex(col_mark)-1));
- end
- try
- baseline(count) = str2num(tline(nindex(col_prescan-1)+1:nindex(col_prescan)-1));
- end
- end
- break;
- end
- end
- disp('Data loaded... Getting more information...');
- % Asks if you want to remove the marker at the end of the stimulus (i.e. if you
- % have a block design and your stimuli are marked at both beginning and end (as
- % is required by the ETG4000) rather than just at the beginning (as is required
- % by HomER2. To hard-code this, replace the next line with offset = 'y' or 'n'.
- % offset = input('Do you want to remove the marker at the end of each stimulus? y/n: ','s');
- % Constructs the arrays that are required in the .nirs file
- t = transpose((0:count-1)*(1/fs));
- d = nirs_data.rawData;
- switch probe
- case 1
- d1 = d;
- case 2
- d2 = d(:,[43:48 35:42 29:34 21:28 15:20 7:14 1:6]); %Homologous channels of probe 1
- end
- SD.Lambda = transpose(wavelengths);
- SD.MeasList = [];
- end % probe end
- d = [d1 d2]; %Combine Probe 1 and Probe 2
- channel_pos = importdata(strcat(pospath,posfilename));
- channel_pos_tmp = char(channel_pos);
- text_array = '4x4';
- % Calculation of MeasList for two 4x4 optode arrays
- if strcmp('4x4', text_array)
- names = {'[LeftEar]','[RightEar]','[Nasion]','[Back]','[Top]',...
- '[Probe1-ch1]','[Probe1-ch2]','[Probe1-ch3]','[Probe1-ch4]',...
- '[Probe1-ch5]','[Probe1-ch6]','[Probe1-ch7]','[Probe1-ch8]',...
- '[Probe1-ch9]','[Probe1-ch10]','[Probe1-ch11]','[Probe1-ch12]',...
- '[Probe1-ch13]','[Probe1-ch14]','[Probe1-ch15]','[Probe1-ch16]',...
- '[Probe2-ch13]','[Probe2-ch14]','[Probe2-ch15]','[Probe2-ch16]',...
- '[Probe2-ch9]','[Probe2-ch10]','[Probe2-ch11]','[Probe2-ch12]',...
- '[Probe2-ch5]','[Probe2-ch6]','[Probe2-ch7]','[Probe2-ch8]',...
- '[Probe2-ch1]','[Probe2-ch2]','[Probe2-ch3]','[Probe2-ch4]'};
- optodes = 32;
- x = zeros(optodes,1);
- y = zeros(optodes,1);
- z = zeros(optodes,1);
- for i=1:optodes
- ind = find(strcmp(channel_pos,names{i+5}));
- x(i) = str2num(channel_pos_tmp(ind+1,3:end));
- y(i) = str2num(channel_pos_tmp(ind+2,3:end));
- z(i) = str2num(channel_pos_tmp(ind+3,3:end));
- end
- SD.SpatialUnit = 'mm';
- SD.nSrcs = 16;
- SD.nDets = 16;
- SD.SrcPos = [x(1), y(1), z(1); x(3), y(3), z(3); x(6), y(6), z(6); x(8), y(8), z(8);...
- x(9), y(9), z(9); x(11), y(11), z(11); x(14), y(14), z(14); x(16), y(16), z(16);...
- x(1+16), y(1+16), z(1+16); x(3+16), y(3+16), z(3+16); x(6+16), y(6+16), z(6+16); x(8+16), y(8+16), z(8+16);...
- x(9+16), y(9+16), z(9+16); x(11+16), y(11+16), z(11+16); x(14+16), y(14+16), z(14+16); x(16+16), y(16+16), z(16+16)];
- SD.DetPos = [x(2), y(2), z(2); x(4), y(4), z(4); x(5), y(5), z(5); x(7), y(7), z(7);...
- x(10), y(10), z(10); x(12), y(12), z(12); x(13), y(13), z(13); x(15), y(15), z(15);...
- x(2+16), y(2+16), z(2+16); x(4+16), y(4+16), z(4+16); x(5+16), y(5+16), z(5+16); x(7+16), y(7+16), z(7+16);...
- x(10+16), y(10+16), z(10+16); x(12+16), y(12+16), z(12+16); x(13+16), y(13+16), z(13+16); x(15+16), y(15+16), z(15+16)];
- SD.MeasList(1,:) = [1 1 1 1];
- SD.MeasList(2,:) = [1 1 1 2];
- SD.MeasList(3,:) = [2 1 1 1];
- SD.MeasList(4,:) = [2 1 1 2];
- SD.MeasList(5,:) = [2 2 1 1];
- SD.MeasList(6,:) = [2 2 1 2];
- SD.MeasList(7,:) = [1 3 1 1];
- SD.MeasList(8,:) = [1 3 1 2];
- SD.MeasList(9,:) = [3 1 1 1];
- SD.MeasList(10,:) = [3 1 1 2];
- SD.MeasList(11,:) = [2 4 1 1];
- SD.MeasList(12,:) = [2 4 1 2];
- SD.MeasList(13,:) = [4 2 1 1];
- SD.MeasList(14,:) = [4 2 1 2];
- SD.MeasList(15,:) = [3 3 1 1];
- SD.MeasList(16,:) = [3 3 1 2];
- SD.MeasList(17,:) = [3 4 1 1];
- SD.MeasList(18,:) = [3 4 1 2];
- SD.MeasList(19,:) = [4 4 1 1];
- SD.MeasList(20,:) = [4 4 1 2];
- SD.MeasList(21,:) = [5 3 1 1];
- SD.MeasList(22,:) = [5 3 1 2];
- SD.MeasList(23,:) = [3 5 1 1];
- SD.MeasList(24,:) = [3 5 1 2];
- SD.MeasList(25,:) = [6 4 1 1];
- SD.MeasList(26,:) = [6 4 1 2];
- SD.MeasList(27,:) = [4 6 1 1];
- SD.MeasList(28,:) = [4 6 1 2];
- SD.MeasList(29,:) = [5 5 1 1];
- SD.MeasList(30,:) = [5 5 1 2];
- SD.MeasList(31,:) = [6 5 1 1];
- SD.MeasList(32,:) = [6 5 1 2];
- SD.MeasList(33,:) = [6 6 1 1];
- SD.MeasList(34,:) = [6 6 1 2];
- SD.MeasList(35,:) = [5 7 1 1];
- SD.MeasList(36,:) = [5 7 1 2];
- SD.MeasList(37,:) = [7 5 1 1];
- SD.MeasList(38,:) = [7 5 1 2];
- SD.MeasList(39,:) = [6 8 1 1];
- SD.MeasList(40,:) = [6 8 1 2];
- SD.MeasList(41,:) = [8 6 1 1];
- SD.MeasList(42,:) = [8 6 1 2];
- SD.MeasList(43,:) = [7 7 1 1];
- SD.MeasList(44,:) = [7 7 1 2];
- SD.MeasList(45,:) = [7 8 1 1];
- SD.MeasList(46,:) = [7 8 1 2];
- SD.MeasList(47,:) = [8 8 1 1];
- SD.MeasList(48,:) = [8 8 1 2];
- SD.MeasList(1+48,:) = [1+8 1+8 1 1];
- SD.MeasList(2+48,:) = [1+8 1+8 1 2];
- SD.MeasList(3+48,:) = [2+8 1+8 1 1];
- SD.MeasList(4+48,:) = [2+8 1+8 1 2];
- SD.MeasList(5+48,:) = [2+8 2+8 1 1];
- SD.MeasList(6+48,:) = [2+8 2+8 1 2];
- SD.MeasList(7+48,:) = [1+8 3+8 1 1];
- SD.MeasList(8+48,:) = [1+8 3+8 1 2];
- SD.MeasList(9+48,:) = [3+8 1+8 1 1];
- SD.MeasList(10+48,:) = [3+8 1+8 1 2];
- SD.MeasList(11+48,:) = [2+8 4+8 1 1];
- SD.MeasList(12+48,:) = [2+8 4+8 1 2];
- SD.MeasList(13+48,:) = [4+8 2+8 1 1];
- SD.MeasList(14+48,:) = [4+8 2+8 1 2];
- SD.MeasList(15+48,:) = [3+8 3+8 1 1];
- SD.MeasList(16+48,:) = [3+8 3+8 1 2];
- SD.MeasList(17+48,:) = [3+8 4+8 1 1];
- SD.MeasList(18+48,:) = [3+8 4+8 1 2];
- SD.MeasList(19+48,:) = [4+8 4+8 1 1];
- SD.MeasList(20+48,:) = [4+8 4+8 1 2];
- SD.MeasList(21+48,:) = [5+8 3+8 1 1];
- SD.MeasList(22+48,:) = [5+8 3+8 1 2];
- SD.MeasList(23+48,:) = [3+8 5+8 1 1];
- SD.MeasList(24+48,:) = [3+8 5+8 1 2];
- SD.MeasList(25+48,:) = [6+8 4+8 1 1];
- SD.MeasList(26+48,:) = [6+8 4+8 1 2];
- SD.MeasList(27+48,:) = [4+8 6+8 1 1];
- SD.MeasList(28+48,:) = [4+8 6+8 1 2];
- SD.MeasList(29+48,:) = [5+8 5+8 1 1];
- SD.MeasList(30+48,:) = [5+8 5+8 1 2];
- SD.MeasList(31+48,:) = [6+8 5+8 1 1];
- SD.MeasList(32+48,:) = [6+8 5+8 1 2];
- SD.MeasList(33+48,:) = [6+8 6+8 1 1];
- SD.MeasList(34+48,:) = [6+8 6+8 1 2];
- SD.MeasList(35+48,:) = [5+8 7+8 1 1];
- SD.MeasList(36+48,:) = [5+8 7+8 1 2];
- SD.MeasList(37+48,:) = [7+8 5+8 1 1];
- SD.MeasList(38+48,:) = [7+8 5+8 1 2];
- SD.MeasList(39+48,:) = [6+8 8+8 1 1];
- SD.MeasList(40+48,:) = [6+8 8+8 1 2];
- SD.MeasList(41+48,:) = [8+8 6+8 1 1];
- SD.MeasList(42+48,:) = [8+8 6+8 1 2];
- SD.MeasList(43+48,:) = [7+8 7+8 1 1];
- SD.MeasList(44+48,:) = [7+8 7+8 1 2];
- SD.MeasList(45+48,:) = [7+8 8+8 1 1];
- SD.MeasList(46+48,:) = [7+8 8+8 1 2];
- SD.MeasList(47+48,:) = [8+8 8+8 1 1];
- SD.MeasList(48+48,:) = [8+8 8+8 1 2];
- end
- % Sort SD.MeasList by lambda
- [SD.MeasList, I] = sortrows(SD.MeasList,4); % Version 3
- % Re-arrange the measurement signals in the data matrix accordingly
- d = d(:,I); % Version 3
- % Trim irrelevant time points
- Exp_timestamp = find(vector_onset==10);
- t = t(Exp_timestamp(1):Exp_timestamp(2)) - t(Exp_timestamp(1));
- d = d(Exp_timestamp(1):Exp_timestamp(2),:);
- vector_onset = vector_onset(Exp_timestamp(1):Exp_timestamp(2));
- count = length(t);
- % Reading vector of stimulus markers and arranging this into the format
- % required by Homer2 and storing in the variable "aux"
- markertimes = [find(vector_onset>0) find(vector_onset<0)];
- markers = vector_onset(markertimes);
- unique_markers = unique(markers);
- aux = zeros(count, length(unique_markers));
- for stimuli=1:length(unique_markers)
- if offset == 'y' || offset == 'Y' % Version 3
- stim_on_off = find(vector_onset==(unique_markers(stimuli))); % Version 3
- stim_markers = stim_on_off(1:2:length(stim_on_off)-1); % Version 3
- aux(stim_markers,stimuli) = 1; % Version 3
- else % Version 3
- stim_markers = find(vector_onset==(unique_markers(stimuli)));
- aux(stim_markers,stimuli) = 1;
- end % Version 3
- end
- ml = SD.MeasList;
- % As the stimulus markers are stored in "aux", the stimulus matrix "s" still
- % needs to be created. This is set to zeroes for now.
- s = zeros(size(t));
- % Add all task conditions
- switch Task
- case 'SOT'
- [row col] = find(aux(:,1:6)==1);
- case 'NBT'
- [row col] = find(aux(:,1:4)==1);
- case 'FMT'
- [row col] = find(aux(:,1:3)==1);
- end
- aux(row,end+1)=1;
- % Finished rearranging information...
- disp('I have all the information I need... Saving...');
- save(strcat(output_dir,['C' num2str(subj,'%03d')],'_',Task,'_run',num2str(rep),'.nirs')...
- ,'t', 'd', 'SD', 's', 'ml', 'aux');
- disp('Done!');
- save(strcat(output_dir,['C' num2str(subj,'%03d')],'_',Task,'_run',num2str(rep),'.mat')...
- ,'t', 'd', 'SD', 's', 'ml', 'aux','vector_onset','Age','CapSize','output_dir');
- %Condition setup
- snirf = SnirfClass(load(strcat(output_dir,['C' num2str(subj,'%03d')],'_',Task,'_run',num2str(rep),'.nirs'),'-mat'));
- %Create StimClass from aux
- for i = 1:nCond
- Cond{i}.idx = find(snirf.aux(i).dataTimeSeries==1);
- Cond{i}.tp =zeros(length(snirf.data.dataTimeSeries),1);
- Cond{i}.tp(Cond{i}.idx)=1;
- Cond{i}.dur = repmat(round(trial_tp/fs),length(Cond{i}.idx),1);
- Cond{i}.amp = repmat(trial_amp,length(Cond{i}.idx),1);
- % stim{i} = Cond{i}.idx;
- obj = StimClass();
- obj.data = [find(Cond{i}.tp>0)/fs repmat(trial_tp,length(find(Cond{i}.tp>0)),1)/fs repmat(1,length(find(Cond{i}.tp>0)),1)];
- obj.states = [find(Cond{i}.tp>0)/fs repmat(1,length(find(Cond{i}.tp>0)),1)];
- obj.name =['Cond' num2str(i)];
- snirf.stim(i) = obj;
- % stimRuns(:,i) = Cond{i}.tp
- end
- if strcmp(Task,'SOT')
- for i = 4:6
- snirf.stim(i).data(:,2)= 1/fs;
- end
- blk_markers_pre = markers(markers>1 & markers<4);
- blk_markers= blk_markers_pre(1:2:end);
- Nonsoc_valid = [];
- Nonsoc_invalid = [];
- Soc_valid = [];
- Soc_invalid = [];
- aaa = find(blk_markers==2);
- for i = aaa
- Nonsoc_valid = [Nonsoc_valid;snirf.stim(5).data((i-1)*6+1:(i-1)*6+6,:)];
- Nonsoc_invalid = [Nonsoc_invalid;snirf.stim(6).data((i-1)*6+1:(i-1)*6+6,:)];
- end
- bbb = find(blk_markers==3);
- for i = bbb
- Soc_valid = [Soc_valid;snirf.stim(5).data((i-1)*6+1:(i-1)*6+6,:)];
- Soc_invalid = [Soc_invalid;snirf.stim(6).data((i-1)*6+1:(i-1)*6+6,:)];
- end
- snirf.stim(7).data = Nonsoc_valid; snirf.stim(7).states = Nonsoc_valid(:,[1 3]); snirf.stim(7).name = 'Nonsoc_valid';
- snirf.stim(8).data = Nonsoc_invalid; snirf.stim(8).states = Nonsoc_invalid(:,[1 3]); snirf.stim(8).name = 'Nonsoc_invalid';
- snirf.stim(9).data = Soc_valid; snirf.stim(9).states = Soc_valid(:,[1 3]); snirf.stim(9).name = 'Soc_valid';
- snirf.stim(10).data = Soc_invalid; snirf.stim(10).states = Soc_valid(:,[1 3]); snirf.stim(10).name = 'Soc_invalid';
- end
- %convert from .nirs to .snirf
- snirf.Save(strcat(output_dir,['C' num2str(subj,'%03d')],'_',Task,'_run',num2str(rep),'.snirf'));
- end %rep end
- ['Subj ' num2str(subj) ' - completed']
- end %subj end
- %Channel locations corrected for Probe 2; d:ch1-24(695nm); ch25-48(830nm)
- end %task end
- %% Preprocessing
- clear; clc;
- % Selects and reads in the data file.
- Drive = 'E:\';
- fs = 10; % sampling rate (Hz)
- age_correction = 1; %Correct DPF for the subject's age
- MAmp_criterion = [0 4.9];%OD
- SNR_criterion = [20 65]; %db
- glm = 1;
- TDDR = 1; %Temporal Deriative Distribution Repair
- PCA = 1;nSV_option= 1; %PCA to remove the global spatial covariance. nSV = no. of components to remove
- Freqfilt = 1;Freqfilt_freq = [0.005 0.5];
- CBSI = 0; %Correlation-Based Signal Improvement
- fNIRS_idx = 1; %1:HbO; 2:HbR: 3:HbT
- plot_OD = 0;
- task_num = 1; %1:SOT
- subj_list = [1:17 19:45 47:59 61];
- rep_list = 1;
- for task_num = task_num;
- switch task_num
- case 1
- Task = 'SOT';
- er_flag = 1; %1: event-related (use stim 7-10)
- target_flag = 1; %1: shift from cue onset to target onset
- max_rep = 1;
- Task_duration = 24;
- Pretask_bsline = 2;
- Posttask_plot = 10;
- Pretask_lag = 0;
- Posttask_lag = 0;
- linearfit = 0; %0:no; 1:yes;
- TaskBlk_marker = [1];%1-3)Congruent and no,Center,SpatualCue; 4-6)Incongruent and no,Center,SpatualCue
- c_vector = [1/3 1/3 1/3];
- end
- %Path setup
- posfilename = '0001.pos';
- dir_file = [Drive 'From SD Card\'];
- output_dir = [Drive 'From SD Card\Matlab_C\' Task '_fNIRS_output\'];
- pospath = [Drive 'From SD Card\Matlab_C\PosForHomerConversion\'];
- % Load subject information
- [~,~,c] = xlsread([Drive 'From SD Card\Matlab_C\fNIRS_subj_info.xlsx']);
- SubjINFO_header = c(1,:);
- SubjINFO_data = c(2:end,:);
- %Transform csv to nirs
- for subj = subj_list
- Age = cell2mat(SubjINFO_data(subj,find(cellfun(@(x)isequal(x,'Age'),SubjINFO_header)==1)));
- CapSize = cell2mat(SubjINFO_data(subj,find(cellfun(@(x)isequal(x,'cap_size'),SubjINFO_header)==1)));
- Folder_name = char(SubjINFO_data(subj,find(cellfun(@(x)isequal(x,'Folder_name'),SubjINFO_header)==1)));
- for rep = rep_list;
- output_dir = [Drive 'From SD Card\Matlab_C\' Task '_fNIRS_output\'];
- snirf = SnirfClass(strcat(output_dir,['C' num2str(subj,'%03d')],'_',Task,'_run' ,num2str(rep) ,'.snirf'));
- data_d = snirf.data;
- probe = snirf.probe;
- %Channel rejection
- mlActAuto = hmrR_PruneChannels_MKY(data_d, probe, [], [], MAmp_criterion, SNR_criterion, [0 99]); %function modified to use SNR in decibels
- SD.MeasListAct = mlActAuto{1}(:,3); %for TDDR
- %Convert d to dod
- d = hmrR_PreprocessIntensity_Negative_MKY(data_d, 'OPTION1: Add a dc offset'); %Automatic selection of Option 1
- data_dod = hmrR_Intensity2OD(data_d);
- %TDDR motion correction
- if TDDR==1
- dod = hmrMotionCorrectTDDR(data_dod.GetDataTimeSeries,SD,fs);
- data_dod.SetDataTimeSeries(dod);
- end
- %PCA systemic correction
- if PCA==1
- [data_dod, svs, nSV] = hmrR_PCAFilter(data_dod, mlActAuto, [],nSV_option);
- end
- % frequency filtering
- if Freqfilt ==1
- data_dod = hmrR_BandpassFilt(data_dod, Freqfilt_freq(1) , Freqfilt_freq(2))
- end
- % From optical density changes to [oxy-Hb] and [deoxy-Hb] changes
- %NaN for rejected channels
- data_dod.dataTimeSeries(:,find(cell2mat(mlActAuto)==0))=NaN;
- %Conversion from dod to dc
- switch CapSize
- case 54, rho = 29;
- case 56, rho = 30;
- case 58, rho = 31;
- end
- % General equation from Scholkmann and Wolf (2013) in the Journal of Biomedical Optics
- %recommended for the age of 0-70 years and for the wavelength of 690-832 nm
- if age_correction ==1
- lambda=probe.wavelengths;
- for i = 1:length(lambda)
- DPF(i) = 223.3 + 0.05624*(Age^0.8493)-(5.723*10^-7)*(lambda(i)^3)+0.001245*(lambda(i)^2)-0.9025*lambda(i);
- end
- else
- DPF(1:length(lambda)) = 1;
- end
- ppf = DPF;
- data_dc = hmrR_OD2Conc_Hitachi_EASYCAP(data_dod, probe, ppf, rho);
- % CBSI
- if CBSI ==1;
- data_dc = hmrR_MotionCorrectCbsi(data_dc,mlActAuto);
- end
- %glm
- if glm ==1;
- data_y = data_dc;
- stim = snirf.stim;
- if task_num==1
- if er_flag
- stim = snirf.stim([4 7:10]);
- for i = 1:length(stim)
- stim(i).data(:,1) = stim(i).data(:,1)+0.3; stim(i).states(:,1) = stim(i).data(:,1)+0.3;% 300ms SOA
- end
- else
- stim = snirf.stim(1:3);
- end
- end
- switch task_num
- case {1}
- trange = [0, 32];
- end
- Aaux = [];
- tIncAuto =[];
- mlActAuto = mlActAuto;
- rcMap =[];
- glmSolveMethod= 1;
- idxBasis= 5; %1: consecutive sequence of guassian functions; 2: modified gamma; 5: canonical hrf from spm
- paramsBasis= []; %idxBasis2_default:[0.1 3.0 1.8 3.0]
- rhoSD_ssThresh= 0;
- flagNuisanceRMethod= 0;
- driftOrder= 0;
- [data_yavg, data_yavgstd, nTrials, data_ynew, data_yresid, data_ysum2, beta_blks, yR_blks, hmrstats] = ...
- hmrR_GLM_MKY(data_y, stim, probe, mlActAuto, Aaux, tIncAuto, rcMap, trange, glmSolveMethod, ...
- idxBasis, paramsBasis, rhoSD_ssThresh, flagNuisanceRMethod, driftOrder, c_vector, fs);
- if idxBasis ==1
- beta_master(:,:,:,rep,subj) = squeeze(mean(cell2mat(beta_blks),1));%idx, ch, cond, rep, subj
- else
- beta_master(:,:,:,rep,subj) = squeeze(cell2mat(beta_blks)); %idx, ch, cond, rep, subj
- end
- % set bad channels to NaN
- beta_master(:,mlActAuto{1}(1:48,3)==0,:,rep,subj) = NaN;
- beta_master(:,mlActAuto{1}(49:96,3)==0,:,rep,subj) = NaN;
- bad_ch_list = mlActAuto{1}(1:48,3)==0 |mlActAuto{1}(49:96,3)==0;
- BadChannel_N(:,subj) = sum(bad_ch_list);
- end% end GLM
- %Homer block averaging
- stim = snirf.stim;
- if task_num==1
- if er_flag
- stim = snirf.stim([4 7:10]);
- for i = 1:length(stim)
- stim(i).data(:,1) = stim(i).data(:,1)+0.3; stim(i).states(:,1) = stim(i).states(:,1)+0.3;% 300ms SOA
- end
- else
- stim = snirf.stim(1:3);
- end
- end
- % set bad channels to NaN
- fNIRS_master(:,bad_ch_list,:,:,:,subj) = NaN;
- clearvars dc
- end % rep end
- ['Preprocessing for ' num2str(subj) ' completed']
- end % subj end
- %correct output_dir
- output_dir = [Drive 'From SD Card\Matlab_C\' Task '_fNIRS_output\'];
- end % task end
- fNIRS_master_M = squeeze(mean(nanmean(fNIRS_master((Pretask_bsline+Pretask_lag)*fs+1:...
- (Pretask_bsline+Task_duration+Posttask_lag)*fs+1,:,:,fNIRS_idx,:,:),5))); %tp ch cond idx rep subj
- %BA Tal
- %unilateral
- ROI_config = {[1 4 8 11] [2 3 6 7 9 10 13] [5 12 15 16 20] [18 19 22 23] [14 17 21 24]...
- [25 28 32 35] [26 27 30 31 33 34 37] [29 36 39 40 44] [42 43 46 47] [38 41 45 48]};
- for i = 1:length(ROI_config)
- fNIRS_master_M_cluster(i,:,:) = squeeze(nanmean(fNIRS_master_M(ROI_config{i},:,:),1));
- end
- if glm==1
- Master_glm_beta = squeeze(nanmean(beta_master(fNIRS_idx,:,:,rep,:),4));
- for i = 1:length(ROI_config)
- fNIRS_master_M_beta_cluster(i,:,:) = squeeze(nanmean(Master_glm_beta(ROI_config{i},:,:),1));
- end
- end
- fNIRS_master_plot = squeeze(mean(nanmean(fNIRS_master(:,:,TaskBlk_marker,fNIRS_idx,:,:),4),3));
- ['Preprocessing for ' Task ' completed']
- %% SOT GLM - Export cluster-level beta values
- LR_combine =0;
- NROI = 5;
- filename = [output_dir 'SOT_output7.xlsx'];
- delete(filename)
- clear beta_export
- beta_export_pre = reshape(fNIRS_master_M_beta_cluster,[size(fNIRS_master_M_beta_cluster,1)*size(fNIRS_master_M_beta_cluster,2) ...
- size(fNIRS_master_M_beta_cluster,3)])'*10^6;
- %left and right combined
- if LR_combine==1
- for m = 1:3 %number of conditions
- for n = 1:NROI %no. of ROIs in each hemisphere
- beta_export(:,n+(m-1)*NROI) = mean(beta_export_pre(:,[n n+NROI]+(m-1)*(NROI*2)),2);
- end
- end
- else
- beta_export = beta_export_pre;
- end
- for i = 1:size(beta_export,1)
- for j = 1:size(beta_export,2)
- if beta_export(i,j)==0
- beta_export(i,j)= NaN;
- end
- end
- end
- writematrix([[1:subj]' beta_export BadChannel_N'], filename);
- winopen(filename)
SOT_fnirs.m, no license · at the source
Overview
- Department of Psychology The Education University of Hong Kong Hong Kong SAR China
- University Research Facility of Human Behavioral Neuroscience The Education University of Hong Kong Hong Kong SAR China
- Centre for Psychosocial Health The Education University of Hong Kong Hong Kong SAR China
- Department of Rehabilitation Sciences The Hong Kong Polytechnic University Hung Hom Hong Kong SAR China
- University Research Facility in Behavioral and Systems Neuroscience The Hong Kong Polytechnic University Hung Hom Hong Kong SAR China
Abstract
Gaze conveys important information about one's intentions and likely object of reference. Because processes of attention may change over time, for reasons including fatigue or experience, this study aimed to compare mechanisms of gaze and arrow cueing effects by measuring across sessions. On two separate occasions, 39 young adults underwent a cueing paradigm with valid or invalid gaze or arrow cues, as well as neutral cues. Activation in frontal cortex regions implicated in the dorsal and ventral attention networks was examined during task performance using functional near‐infrared spectroscopy. Behavioral results showed comparable orienting (valid vs. neutral) and reorienting (invalid vs. valid) responses following gaze and arrow cues, which did not significantly change over sessions. However, the gaze cue elicited a significantly greater alerting effect (i.e., more benefits from the presence of the cue on reaction time) than the arrow cue in Session 2. Parallel to these behavioral findings, neuroimaging results indicated robust (de‐)activation during orienting and reorienting. Aligning with the greater alerting effect, target detection elicited significantly greater activation in the left posterior dorsomedial frontal cortex following gaze cues as opposed to arrow cues in Session 2. Therefore, insofar as changes over time are concerned, our findings offer converging evidence that gaze and arrow cues follow partially different attentional and neural mechanisms.
Reproduced under the paper's license (CC BY), from the paper cited above.
Repository
Its files are read in the Code ↔ Paper reader above, with 2 matches between paragraphs and lines of code.
OSF p7cx4
Availability: 1 check, the latest on 28 September 2026: the link answers (HTTP 200)
- 28 September 2026: the link answers (HTTP 200)
2 files
- SOT_beh.m, MATLAB, 148 lines
- SOT_fnirs.m, MATLAB, 621 lines, 2 matches
The paper's code and data availability statement is in the Data section.
Tracing map
Proposed by the machine: these links were found in the paper and verified at the source, without human review. The map will receive a Zenodo DOI once one of the paper's authors has validated it with their ORCID.
What the map holds:
- 1 repository of the authors' code, each at its verified commit, with its license and how the link was found in the paper;
- 2 scripts, each with its path and the digest of its content;
- 2 matches between paragraphs of the paper and lines of the code (method lexical-v1);
- neither the text of the paper nor the code itself.
Its JSON (tracing-map.json) is deposited on Zenodo with its DOI once the map is validated.
Data
No dataset and no data link were found in the paper.
Data Availability Statement
The dataset and data processing scripts that form the basis of the results are available on OSF (https://
Reproduced under the paper's license (CC BY), from the paper cited above.
Versions
The history of this record: each version stored by the harvester or made by a correction of its authors or of the maintainers of its code, and what changed in its facts. The texts of the paper (its abstract, its availability statements) are not part of it; versions that changed only those are not listed.
Version 2, 28 September 2026
- Publisher: n/a → Wiley
Version 1, 28 September 2026: the first record
Recorded: type, language, journal, volume, issue, pages, dates, 2 authors, 6 keywords, 12 MeSH terms, 55 references.
Cite
This paper
Yeung, M. K., & Han, Y. M. Y. (2026). Partially Different Mechanisms of Social and Nonsocial Attention: Evidence From Changes in Cueing Effects and Underlying Frontal Cortex Processing Over Time. Psychophysiology, 63(4), e70286. https://
BibTeX
@article{yeung2026partia
author = {Yeung, Michael K. and Han, Yvonne M. Y.},
title = {{Partially Different Mechanisms of Social and Nonsocial Attention: Evidence From Changes in Cueing Effects and Underlying Frontal Cortex Processing Over Time}},
journal = {Psychophysiology},
year = {2026},
month = apr,
volume = {63},
number = {4},
pages = {e70286},
publisher = {Wiley},
issn = {0048-5772},
doi = {10.1111/
url = {https://
pmid = {41882980},
pmcid = {PMC13018724}
}
RIS
TY - JOUR
AU - Yeung, Michael K.
AU - Han, Yvonne M. Y.
TI - Partially Different Mechanisms of Social and Nonsocial Attention: Evidence From Changes in Cueing Effects and Underlying Frontal Cortex Processing Over Time
T2 - Psychophysiology
J2 - Psychophysiology
PY - 2026
DA - 2026/
VL - 63
IS - 4
SP - e70286
SN - 0048-5772
PB - Wiley
DO - 10.1111/
UR - https://
LA - en
ER -
CSL-JSON
{
"id": "10.1111/
"type": "article-journal",
"title": "Partially Different Mechanisms of Social and Nonsocial Attention: Evidence From Changes in Cueing Effects and Underlying Frontal Cortex Processing Over Time",
"container-title": "Psychophysiology",
"author": [
{
"family": "Yeung",
"given": "Michael K."
},
{
"family": "Han",
"given": "Yvonne M. Y."
}
],
"container-title-short":
"volume": "63",
"issue": "4",
"page": "e70286",
"DOI": "10.1111/
"PMID": "41882980",
"PMCID": "PMC13018724",
"ISSN": "0048-5772",
"publisher": "Wiley",
"URL": "https://
"language": "en",
"issued": {
"date-parts": [
[
2026,
4,
1
]
]
}
}
The tracing map gets a citation of its own once an author has validated it and it has a DOI.
Similar papers
The papers with a page that share the most with this one: the tools found in their code, their categories, datasets, cited references and authors, the rarest counting most.
- [1] doi:10.1117/1.nph.12.2.025011 [code]
- NIRSTORM: a Brainstorm extension dedicated to functional near-infrared spectroscopy data analysis, advanced 3D reconstructions, and optimal probe designJournal: n/aIn common: Statistics and Machine Learning Toolbox, fNIRS, 4 references
- [2] doi:10.1117/1.nph.13.3.035009
- Single-subject detection of speech network activation using functional near-infrared spectroscopy.Journal: NeurophotonicsIn common: fNIRS, cognitive, 4 references
- [3] doi:10.1038/s41598-026-50540-z [code]
- Addressing arbitrary choices of frequency band of interest in fNIRS hyperscanning.Journal: Scientific reportsIn common: Statistics and Machine Learning Toolbox, fNIRS, 3 references
- [4] doi:10.1111/desc.70188
- Contextual Transparency Supports Cognitive Control by Reducing Prefrontal Activation and Enhancing Cue Prioritization in Children.Journal: Developmental scienceIn common: fNIRS, cognitive, 3 references
- [5] doi:10.1016/j.nicl.2026.104019 [code]
- Stress-related hypofrontality in depression and its relation to altered activation prior to the stress response.Journal: NeuroImage. ClinicalIn common: Statistics and Machine Learning Toolbox, 3 references
- [6] doi:10.1117/1.nph.13.3.035006 [code]
- Characterizing developmental changes in infant habituation using functional change point detection.Journal: NeurophotonicsIn common: fNIRS, 3 references
- [7] doi:10.1016/j.isci.2026.116287 [code]
- Neural selectivity for social interactions in the infant brain.Journal: iScienceIn common: 4 references
- [8] doi:10.1364/boe.604286
- Computational validation of optical adaptive depth steering for continuous-wave fNIRS.Journal: Biomedical optics expressIn common: fNIRS, 3 references
- [9] doi:10.1117/1.nph.13.s3.s32602 [code]
- Cedalion tutorial: a Python-based framework for comprehensive analysis of multimodal fNIRS and DOT from the lab to the everyday world.Journal: NeurophotonicsIn common: fNIRS, 3 references
- [10] doi:10.1162/imag.a.1208 [code]
- Brain network analysis in Alzheimer's disease and mild cognitive impairment using high-density diffuse optical tomography.Journal: Imaging neuroscience (Cambridge, Mass.)In common: Statistics and Machine Learning Toolbox, fNIRS, 2 references
Contribute
The authors of this paper can claim it, correct its record and validate its tracing map, and the maintainers of its code (its owner, or a public member of its organization) correct what it says of their repository; anyone signed in can ask for its removal. Every request goes to OSCR's own machine, which answers it; your account page follows them.
Sign in with ORCID to claim this paper as one of its authors, correct its record or validate its tracing map: when the paper's metadata lists your ORCID iD, you are recognized at once. Maintainers of its code: sign in with GitHub, then claim the repository on your account page.
Claim this paper
Correct its record
Say what each link of this record is, remove the ones that are not the paper's, add the ones that are missing. The correction becomes a new version of the record, in its Versions section.
Validate its tracing map
You validate the map as this page shows it: 1 repository of the authors' code, each at its verified commit and with its license, 2 scripts, and 2 matches between paragraphs and code (see the Code and Map sections). It then receives a DOI on Zenodo, with you (your ORCID iD) and OSCR as its creators; the code itself is not deposited.
The map's fingerprint: sha256:95e9b86969cbf828…
Add the badge to its README
The badge links the code to this page. Copy one of these into the README of the paper's code: only you decide where it goes, and nothing is changed for you.
Markdown
[.
Discussion, reproductions, activity
Discussion: questions and error reports about this paper and its code, from signed-in readers and its authors. It opens with sign-in.
Reproductions: reports from readers who ran the authors' code: what they reproduced, with which environment, commit and data. It opens with sign-in.
Activity: what happens around this paper: new versions of its record, its map's validation, discussions and reproductions. It opens with sign-in.
