OSCR

Social interactions between people of same and different generations shape longitudinal changes in interpersonal neural synchrony, loneliness, and social connection.

Code ↔ Paper

4 matches between paragraphs of the paper and lines of its authors' code, computed by the harvester (lexical-v1). Click a colored paragraph or line to see its counterpart.

The 4 matches
  1. [1] § 5 Methods › 5.4 Measures › 5.4.2 fNIRS recordings. ↔ fNIRS Interbrain Coherence/fNIRS/3Dheadmodels/script_structuresensor1.m, lines 327–387 · score 0.78 · left IFG, left TPJ, right IFG, right TPJ, MNI, ROIs
  2. [2] § 5 Methods › 5.4 Measures › 5.4.2 fNIRS recordings. ↔ fNIRS Interbrain Coherence/fNIRS/3Dheadmodels/script_structuresensor1.m, lines 170–230 · score 0.68 · MNI space, FieldTrip, scan, fiducial, channel, optodes
  3. [3] § 5 Methods › 5.6 Data analysis › 5.6.1 Interbrain synchrony. ↔ Group Level Analysis/INS/2a-Frequentisttest.Rmd, lines 127–150 · score 0.67 · LTPJ RTPJ, 50 seconds, LIFG RTPJ, RIFG LTPJ, LIFG LTPJ, LIFG RIFG
  4. [4] § 5 Methods › 5.6 Data analysis › 5.6.1 Interbrain synchrony. ↔ fNIRS Interbrain Coherence/fNIRS/3Dheadmodels/script_structuresensor1.m, lines 232–284 · score 0.50 · optode positioning, location, Channel, S4, S2, Interbrain

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 · 421 lines · 16 KB · no license · 3 matches

  1. clear all;
  2. %% 0 Run these to set path & defaults
  3. addpath('/Users/rmoffat/Library/CloudStorage/OneDrive-ETHZurich/MATLAB/NIRS/fieldtrip-20240201')
  4. ft_defaults
  5. %% 1 Make 3D scan with the structure sensor
  6. % * place the cap on the subject's head and make sure that Cz is midway
  7. % between nasion-inion and LPA-RPA
  8. % * mark the fiducials (nasion, LPA, RPA, inion, Cz) with stickers
  9. % * make a 3D scan of the subject while walking around them with the
  10. % structure sensor (ask for help if necessary).n
  11. % * email to own email adress
  12. % * save the "Model" folder on a place you specify below in root_dir and
  13. % unzip
  14. %% 2 Specify where you saved the model folder
  15. sub_id= 'sub-309_session-5';
  16. root_dir='/Users/rmoffat/Library/CloudStorage/OneDrive-ETHZurich/SOBALAB/2023_projects/CortiVision/data/headmodels';
  17. obj_file=fullfile(root_dir, 'source', sub_id, 'model.obj');
  18. cd(fullfile(root_dir, 'processed', sub_id)) % or other folder where you want to save your data
  19. % 304_session-4 mesh is colourles
  20. % % you also need to specify your path to fieldtrip for a later step
  21. [ftver, ftpath] = ft_version;
  22. %% 3 Load the 3D-model
  23. head_surface = ft_read_headshape(obj_file);
  24. % needed if estimated unit is not m, but dm!
  25. % head_surface.pos = head_surface.pos * 10; % Convert from dm to m
  26. % Convert the units to mm
  27. head_surface = ft_convert_units(head_surface, 'mm');
  28. % Visualize the mesh surface
  29. figure('name', 'Mesh check');%title for clearity
  30. hold on
  31. ft_plot_mesh(head_surface);
  32. hold off
  33. %% 4 Specify the fiducials + optodes
  34. % Note that I also call Cz a fiducial, which is in fact not a fiducial, but
  35. % which we will use in a later stage to for coregistration.
  36. % Here I define the names of the transmitters and receivers. Adapt
  37. % according to own device.
  38. Sxnames=cell(16,1); %normal sources 1-8 and short sources are 13-16, total of 12 labels
  39. Dxnames=cell(10,1);
  40. idx=1;
  41. for i=1:16 %normal sources labels
  42. Sxnames{idx}=sprintf('S%d', i);
  43. idx=idx+1;
  44. end
  45. for i=1:10
  46. Dxnames{i}=sprintf('D%d', i);
  47. end
  48. cfg = [];
  49. cfg.channel={};
  50. cfg.channel{1} = 'Nz';
  51. cfg.channel{2} = 'LPA';
  52. cfg.channel{3} = 'RPA';
  53. cfg.channel{4}= 'Iz';
  54. cfg.channel{5} = 'Cz';
  55. cfg.channel(6:21)=Sxnames';
  56. cfg.channel(22:31)=Dxnames';
  57. cfg.method = 'headshape';
  58. opto = ft_electrodeplacement(cfg, head_surface);%2 figures appear: first figure for axes
  59. % (type 'n' in command window), second figure for electrode placement
  60. title ('axes check');
  61. save('opto.mat', 'opto')
  62. % Do you want to change the anatomical labels for the axes [Y, n]? --> n
  63. % Use "Rotate 3D" to rotate the 3D model.
  64. % Click/unclick "Colors" to toggle the colors on and off: best is to use the color
  65. % view for the fiducials, but the structure view for the optodes
  66. % Use the mouse to click on fiducials/optodes on the head and subsequently on the corresponding
  67. % label in the list to assign the markers. (Make sure you're not in "Rotate 3D" mode anymore!)
  68. % If an error was made: double click on the label to remove this marker
  69. % If ready --> press Q
  70. %% 5 Allign the axes of the coordinate system with the fiducial positions (ctf coordinates)
  71. % for the mesh
  72. load ('opto.mat')
  73. cfg = [];
  74. cfg.method = 'fiducial';
  75. cfg.coordsys = 'ctf';
  76. cfg.fiducial.nas = opto.elecpos(1,:); %position of Nz
  77. cfg.fiducial.lpa = opto.elecpos(2,:); %position of LPA
  78. cfg.fiducial.rpa = opto.elecpos(3,:); %position of RPA
  79. head_surface_ctf = ft_meshrealign(cfg, head_surface);
  80. %ft_plot_axes(head_surface_ctf)
  81. figure('name', 'axes check');
  82. ft_plot_mesh(head_surface_ctf, 'axes', true) %visualize the head surface,
  83. % including the axes of the coordinate system. You can check that the positive
  84. % and negative y-axes go through the preauricular points.
  85. % for the optodes
  86. fid.chanpos = [110 0 0; 0 90 0; 0 -90 0]; % CTF coordinates of the fiducials
  87. fid.elecpos = [110 0 0; 0 90 0; 0 -90 0]; % just like electrode positions
  88. fid.label = {'Nz','LPA','RPA'}; % same labels as in elec
  89. fid.unit = 'mm'; % same units as mri
  90. cfg = [];
  91. cfg.method = 'fiducial';
  92. cfg.coordsys = 'ctf';
  93. cfg.target = fid; % see above
  94. cfg.elec = opto;
  95. cfg.fiducial = {'Nz', 'LPA', 'RPA'}; % labels of fiducials in fid and in elec
  96. opto_ctf = ft_electroderealign(cfg);
  97. % Visualize the optodes on the alligned head surface
  98. % Notice that the colorview is not that clean as the the structure view
  99. figure('name','optodes on head');
  100. ft_plot_mesh(head_surface_ctf)
  101. ft_plot_sens(opto_ctf,'label', 'on', 'fontsize', 10, 'elecsize', 10, 'style', 'b')% I added optode labels, remove if in the way
  102. % to have the same visualization without the colors
  103. figure('Name','optodes on colourless head');
  104. ft_plot_mesh(removefields(head_surface_ctf, 'color'), 'tag', 'headshape', 'facecolor', 'skin', 'material', 'dull', 'edgecolor', 'none', 'facealpha', 1);
  105. lighting gouraud
  106. l = lightangle(0, 90); set(l, 'Color', [1 1 1]/2)
  107. l = lightangle( 0, 0); set(l, 'Color', [1 1 1]/3)
  108. l = lightangle( 90, 0); set(l, 'Color', [1 1 1]/3)
  109. l = lightangle(180, 0); set(l, 'Color', [1 1 1]/3)
  110. l = lightangle(270, 0); set(l, 'Color', [1 1 1]/3)
  111. alpha 0.9
  112. ft_plot_sens(opto_ctf, 'label', 'on', 'fontsize', 10,'elecsize', 10, 'style', 'b')
  113. save(['opto_ctf.mat'], 'opto_ctf')
  114. %% 6. Move optode inward
  115. load('opto_ctf.mat');
  116. cfg = [];
  117. cfg.method = 'moveinward';
  118. cfg.moveinward = 5; % determine distance to skin
  119. cfg.channel = 2:length(opto_ctf.label); % do not move the nasion inward
  120. cfg.keepchannel = true;
  121. cfg.elec = opto_ctf;
  122. opto_inw = ft_electroderealign(cfg);
  123. % visualize
  124. figure;
  125. ft_plot_mesh(removefields(head_surface_ctf, 'color'), 'tag', 'headshape', 'facecolor', 'skin', 'material', 'dull', 'edgecolor', 'none', 'facealpha', 1);
  126. lighting gouraud
  127. l = lightangle(0, 90); set(l, 'Color', [1 1 1]/2)
  128. l = lightangle( 0, 0); set(l, 'Color', [1 1 1]/3)
  129. l = lightangle( 90, 0); set(l, 'Color', [1 1 1]/3)
  130. l = lightangle(180, 0); set(l, 'Color', [1 1 1]/3)
  131. l = lightangle(270, 0); set(l, 'Color', [1 1 1]/3)
  132. alpha 0.7
  133. ft_plot_sens(opto_inw, 'elecsize', 10, 'style', 'b')
  134. %opto_inw = opto_ctf;
  135. save(['opto_inw.mat'], 'opto_inw')
  136. %% 7 Coregister optodes to MNI atlas
  137. % load("opto.mat")
  138. % load("opto_ctf.mat")
  139. % load("opto_inw.mat")
  140. % or event better: to an anatomical scan of your subject if you have one.
  141. % In that case, you will first need to segment the skin from your
  142. % anatomical MRI scan. For more information see: http://www.fieldtriptoolbox.org/tutorial/headmodel_eeg_bem/
  143. % load skin surface of standard atlas
  144. skin_template=fullfile(ftpath, 'template', 'headmodel', 'skin', 'standard_skin_14038.vol');
  145. skin=ft_read_headshape(skin_template);
  146. % visualization with optodes
  147. hold on; ft_plot_sens(opto_inw); %no skin mesh in this plot? 2d not 3d
  148. % you should notice that your optodes, which are represented in the ctf
  149. % coordinate system, are rotated with 90 degrees compared to the head model
  150. % which is represented in the MNI coordinate system. For more information
  151. % see: http://www.fieldtriptoolbox.org/faq/how_are_the_different_head_and_mri_coordinate_systems_defined/
  152. % We will use the MNI coordinates of the fiducials, which can be found in
  153. % the standard_1020.elc file of the fieldtrip template folder,
  154. % to guide the coregistration
  155. elec1020=ft_read_sens(fullfile(ftpath, 'template', 'electrode', 'standard_1020.elc'));
  156. % select rpa, lpa, nasion, inion and cz from elec1020
  157. cfg=[];
  158. cfg.method='moveinward'; % this is just a hack to select the right channels
  159. cfg.moveinward=10;
  160. cfg.channel={'Nz'; 'RPA'; 'LPA'; 'Iz'; 'Cz'};
  161. electarg=ft_electroderealign(cfg, elec1020);
  162. % There are two ways to coregister the optodes to the MNI space: (1)
  163. % interactively/manually or (2) automatically based on the fiducials we
  164. % specified here above
  165. % (1) interactively
  166. % So first a 90 degree turn to go from ctf to mni coordinate system
  167. cfg=[];
  168. cfg.method='interactive';
  169. cfg.headshape=skin;
  170. cfg.target=electarg; % you can use the fiducials to guide your coregistration
  171. opto_MNI=ft_electroderealign(cfg, opto_inw);
  172. % You might notice that this is quite time consuming and needs some
  173. % practice. Therefore, I prefer to do it automatically, but this is only
  174. % possible if you have enough fiducials/marker points.
  175. % (2) automatically
  176. % cfg=[];0
  177. % cfg.method='template';
  178. % cfg.warp= 'traditional';
  179. % cfg.channel={'LPA', 'RPA', 'Nz', 'Cz', 'Iz'};
  180. % cfg.target=electarg;
  181. % opto_MNI=ft_electroderealign(cfg, opto_inw);
  182. save('opto_MNI.mat', 'opto_MNI')
  183. % plot together
  184. figure;ft_plot_mesh(skin, 'edgecolor', 'none', 'facecolor', 'skin'); camlight
  185. hold on; ft_plot_sens(opto_MNI, 'elecsize', 20,'facecolor', 'k', 'label', 'label');
  186. hold on; ft_plot_sens(electarg, 'elecsize', 20, 'facecolor', 'b');
  187. %% 8 Calculate channel locations based on optode positions (in this case in CTF space)
  188. % load("opto_MNI.mat")
  189. % load("opto_ctf.mat")
  190. % use optode namings instead of eeg namings
  191. % define here the channels:
  192. channels = {'S1_D2', 'S2_D2', 'S2_D3', 'S2_D1','S3_D3', 'S3_D1', 'S4_D4', 'S4_D5', 'S5_D4', 'S5_D5','S6_D4', 'S7_D6', 'S7_D7','S8_D6', 'S8_D7', 'S8_D8','S9_D8','S10_D9', 'S10_D10','S11_D9', 'S11_D10','S12_D10', 'S13_D2', 'S14_D8', 'S15_D5', 'S16_D9'};
  193. % For these files the old montage needs to be used. Take care to follow the
  194. % old montage during the optode specification (%%4)
  195. % sub-103_session-1, sub-301_session-1,sub-101_session-1,
  196. % sub-201_session-1, sub-102_session-1, sub-202_session-1
  197. %
  198. % Old Montage
  199. % channels = {'S1_D2 ', 'S2_D2', 'S2_D3', 'S3_D3', 'S2_D1','S3_D1', 'S4_D5', 'S5_D5', 'S4_D4','S6_D4','S6_D5','S7_D6', 'S7_D7', 'S8_D7','S8_D6', 'S8_D8', 'S9_D8','S10_D9 ', 'S11_D9', 'S12_D9','S12_D10', 'S11_D10','S13_D1', 'S14_D6', 'S15_D5', 'S16_D9'};
  200. [dxnames, rem] = strtok(channels, {'_', ' '});
  201. [sxnames, rem] = strtok(rem, {'_', ' '});
  202. % change the naming
  203. opto_lay = opto_ctf;
  204. opto_lay.optopos=opto_ctf.chanpos;
  205. opto_lay.chantype=cell(length(opto_ctf.chantype),1);
  206. opto_lay.chantype(:) = {'nirs'};
  207. opto_lay.optolabel = opto_ctf.label;
  208. opto_lay.label=channels;
  209. opto_lay.tra=zeros(length(channels),length(opto_lay.optolabel));
  210. for i=1:length(channels)
  211. opto_lay.tra(i,:) = strcmp(dxnames{i},opto_lay.optolabel)+strcmp(sxnames{i}, opto_lay.optolabel);
  212. end
  213. opto_lay=rmfield(opto_lay, {'chanpos', 'chantype', 'chanunit', 'elecpos'});
  214. % calculate the channel positions
  215. opto_layout = ft_datatype_sens(opto_lay)
  216. % save
  217. save('opto_layout.mat', 'opto_layout')
  218. % calculate channel locations also in MNI space
  219. % change the naming
  220. opto_temp = opto_MNI;
  221. opto_temp.optopos=opto_MNI.chanpos;
  222. opto_temp.chantype=cell(length(opto_MNI.chantype),1);
  223. opto_temp.chantype(:) = {'nirs'};
  224. opto_temp.optolabel = opto_MNI.label;
  225. opto_temp.label=channels;
  226. opto_temp.tra=zeros(length(channels),length(opto_temp.optolabel));
  227. for i=1:length(channels)
  228. opto_temp.tra(i,:) = strcmp(dxnames{i},opto_temp.optolabel)+strcmp(sxnames{i}, opto_temp.optolabel);
  229. end
  230. opto_temp=rmfield(opto_temp, {'chanpos', 'chantype', 'chanunit', 'elecpos'});
  231. % calculate the channel positions
  232. chan_MNI = ft_datatype_sens(opto_temp);
  233. %% 9 Determine anatomical label for the channels (this is only possible in MNI space)
  234. % % documentati on: http://www.fieldtriptoolbox.org/faq/how_can_i_determine_the_anatomical_label_of_a_source/
  235. % % load atlas (AAL atlas), but you can also load another atlas, see: http://www.fieldtriptoolbox.org/template/atlas/
  236. % atlas = ft_read_atlas([ftpath filesep 'template/atlas/aal/ROI_MNI_V4.nii']);
  237. %
  238. % channels = {'S1_D2', 'S2_D2', 'S2_D3', 'S2_D1','S3_D3', 'S3_D1', 'S4_D4', 'S4_D5', 'S5_D4', 'S5_D5','S6_D4', 'S7_D6', 'S7_D7','S8_D6', 'S8_D7', 'S8_D8','S9_D8','S10_D9', 'S10_D10','S11_D9', 'S11_D10','S12_D10', 'S13_D2', 'S14_D8', 'S15_D5', 'S16_D9'};
  239. %
  240. % % Look up the corresponding anatomical label
  241. % cfg = [];
  242. % cfg.roi = chan_MNI.chanpos(match_str(chan_MNI.label,channels),:);
  243. % cfg.atlas = atlas;
  244. % cfg.output = 'multiple';
  245. % cfg.minqueryrange=1;
  246. % cfg.maxqueryrange=25; %if no label was found, increase the queryrange
  247. % labels = ft_volumelookup(cfg, atlas);
  248. %
  249. % % Select the anatomical label with the highest probability
  250. %
  251. % for i=1:length(channels)
  252. % [~, indx] = max(labels(i).count);
  253. % label{i}=char(labels(i).name(indx));
  254. % end
  255. %
  256. % % show results in table
  257. % table(channels', label', 'VariableNames', {'channel', 'label'})
  258. %% CSV table python
  259. labeling = char(chan_MNI.label);
  260. % f= "fidcuial";
  261. % s = "source";
  262. % d = "dectector";
  263. % types = repelem([f; s; d], [5 10 10]);
  264. %
  265. % pythontable = table(labeling,types,opto_MNI.elecpos(:,1),opto_MNI.elecpos(:,2),opto_MNI.elecpos(:,3), 'VariableNames',{'name','type', 'x','y','z'})
  266. pythontable = table(labeling,chan_MNI.chanpos(:,1),chan_MNI.chanpos(:,2),chan_MNI.chanpos(:,3), 'VariableNames',{'name', 'x','y','z'})
  267. writetable(pythontable, [sub_id, '.csv']); %change per participant
  268. %% compare ROI coordinates
  269. regions = {'left TPJ', 'right TPJ', 'left IFG', 'right IFG'};
  270. ROIs = char(regions);
  271. ROI_coordinates = [-56 -54 20; 56 -52 18; -48 22 8; 50 22 16];
  272. % ROI_tabel = table(ROIs, ROI_coordinates(:,1), ROI_coordinates(:,2), ROI_coordinates(:,3), 'VariableNames',{'ROI', 'x','y','z'});
  273. % Chan_coordinates = table(chan_MNI.chanpos(:,1),chan_MNI.chanpos(:,2),chan_MNI.chanpos(:,3), 'VariableNames',{ 'x','y','z'});
  274. P=chan_MNI.chanpos;
  275. l_tpj = ROI_coordinates(1,:);
  276. r_tpj = ROI_coordinates(2,:);
  277. l_ifg = ROI_coordinates(3,:);
  278. r_ifg = ROI_coordinates(4,:);
  279. l_tpj_distance = zeros(26,1);
  280. for i = 1:length(P)
  281. X = [l_tpj ; P(i,:)];
  282. d= pdist(X, 'euclidean');
  283. l_tpj_distance(i)=d;
  284. end
  285. r_tpj_distance = zeros(26,1);
  286. for i = 1:length(P)
  287. X = [r_tpj ; P(i,:)];
  288. d= pdist(X, 'euclidean');
  289. r_tpj_distance(i)=d;
  290. end
  291. l_ifg_distance = zeros(26,1);
  292. for i = 1:length(P)
  293. X = [l_ifg ; P(i,:)];
  294. d= pdist(X, 'euclidean');
  295. l_ifg_distance(i)=d;
  296. end
  297. r_ifg_distance = zeros(26,1);
  298. for i = 1:length(P)
  299. X = [r_ifg ; P(i,:)];
  300. d= pdist(X, 'euclidean');
  301. r_ifg_distance(i)=d;
  302. end
  303. alldistances = [l_tpj_distance, r_tpj_distance, l_ifg_distance, r_ifg_distance];
  304. distance = table(labeling,l_tpj_distance, r_tpj_distance, l_ifg_distance, r_ifg_distance)
  305. writetable(distance, [sub_id, '_distances.csv'])%change per participant
  306. nearest = [];
  307. nearest.chanlabels = chan_MNI.label;
  308. nearest.ROIS = regions;
  309. nearest.distance = alldistances;
  310. near= strings(4,2); %make a list of the closest channel per ROI stored in varaible 'near'
  311. channear = {};
  312. for i=1:4
  313. [min_value, index] = min(nearest.distance(:,i));
  314. near(i,1) = num2str(min_value);
  315. near(i,2) = nearest.chanlabels(1,index);
  316. end
  317. chanlabel = char(channear);
  318. %% distances between optode pairs
  319. %if you are doing this for participants who already had the entire script
  320. %run on them, just run section 2,8 and this section, uncomment load
  321. %opto_MNI and ctf at the top of section 8
  322. optode_distances = [];
  323. % Loop through each channel pair
  324. for i = 1:numel(channels)
  325. % Extract electrode labels for the current channel pair
  326. optodes = strsplit(channels{i}, '_');
  327. % Find the indices of electrodes in the data structure
  328. idx_optodes = cellfun(@(x) find(strcmp(chan_MNI.optolabel, x)), optodes);
  329. % Extract coordinates of electrodes in the channel pair
  330. coords = chan_MNI.optopos(idx_optodes, :);
  331. % Calculate distance between electrodes
  332. dist = pdist(coords);
  333. % Store channel distance
  334. optode_distances = [optode_distances; dist];
  335. end
  336. % Create a table with channel names and distances
  337. channeltable = channels';
  338. optode_dist = table(channeltable, optode_distances, 'VariableNames', {'Channel', 'Distance'});
  339. disp(optode_dist);
  340. writetable(optode_dist, [sub_id, '_optode_dist.csv'])%change per participant

script_structuresensor1.m, no license · at the source

Overview

Authors: Ryssa Moffat1, Guillaume Dumas2,3, Emily S. Cross1
  1. Social Brain Sciences Lab, ETH Zurich, Zurich, Switzerland
  2. CHU Sainte-Justine Azrieli Research Center, Department of Psychiatry, University of Montreal, Montréal, Quebec, Canada
  3. Mila – Quebec Artificial Intelligence Institute, Montréal, Quebec, Canada
Journal: PLoS biology, volume 24, issue 8, article e3003899
Dates: received 29 January 2026; accepted 26 June 2026; published online 20 August 2026
Type: Research article · Language: English
License: CC BY
Identifiers: DOI 10.1371/journal.pbio.3003899 · PMID 42623338 · PMCID PMC13492753 · OpenAlex W7203819231
Open access: gold, a free copy (OpenAlex)
Status: code verified
Categories: human (organism)
Methods: Spectral & time-frequency, Connectivity, Statistics, fMRI & imaging
MeSH: Intergenerational Relations*, Interpersonal Relations*, Loneliness*, Social Interaction*, Adult, Female, Humans, Longitudinal Studies, Male, Middle Aged, Social Group, Young Adult (* major topic)
Journal subjects: People and Places, Population Groupings, Age Groups, Adults, Elderly, Biology and Life Sciences, Psychology, Collective Human Behavior, Interpersonal Relationships, Social Sciences, Psychological Attitudes, Neuroscience, Cognitive Science, Cognitive Psychology, Attention, Behavior, Verbal Behavior, Verbal Communication, Research and Analysis Methods, Bioassays and Physiological Analysis, Electrophysiological Techniques, Brain Electrophysiology, Electroencephalography, Physiology, Electrophysiology, Neurophysiology, Brain Mapping, Medicine and Health Sciences, Clinical Medicine, Clinical Neurophysiology, Imaging Techniques, Neuroimaging, Sociology, Social Systems
Topic: Action Observation and Synchronization (Social Psychology, Psychology), according to OpenAlex
Funding: Cortivision Pathfinder Program (CPP-2023/09/01); Institut de Valorisation des Données (CF00137433); Fonds de recherche du Québec (285289); Natural Sciences and Engineering Research Council of Canada (DGECR-2023-00089); Caran D’Ache (712517); Social Brain Sciences Lab, ETH Zurich
Citations: not cited yet (Europe PMC); 140 references in the paper

Abstract

Loneliness is globally acknowledged as a severe and burgeoning health risk, fueling interest in helping people of all ages form meaningful social connections. One promising approach consists of intergenerational social programs. While behavioral and qualitative evidence derived from such programs promise health and wellbeing benefits, the physiological consequences of repeated intergenerational encounters remain unknown. Insight into physiological changes will shed light on the mechanisms of social connection. We charted longitudinal changes in interpersonal neural synchrony (INS) in 31 intergenerational (older/younger adult) and 30 same-generation (younger adult) dyads across a six-session creative drawing program. At each session, dyads completed self-report measures, drew together and alone, and had their cortical activation recorded with fNIRS. In both groups, INS was greater while dyads drew together than alone. Across sessions, intergenerational dyads’ INS decreased and same-generation dyads’ INS increased. INS in RIFG~RTPJ and RIFG~RIFG were predictive of loneliness levels and feelings of social closeness, respectively. This exploratory longitudinal research reinforces the multi-faceted nature of INS dynamics as social connections are forged.

Reproduced under the paper's license (CC BY), from the paper cited above.

Repositories

Its files are read in the Code ↔ Paper reader above, with 4 matches between paragraphs and lines of code.

OSF xcgp6

License: none: the authors keep all their rights
State: the link answers, verified on 27 September 2026
Evidence: files inventoried
Languages: R (19), MATLAB (1)
Size: 51 files, 20 scripts
Software Heritage: not checked
Found in: “Data Availability”
Holds: 19 notebooks
Not found: README, license file, CITATION.cff, environment file, tests, continuous integration, documentation
Tools: ggpubr (19 files), patchwork (19 files), tidyverse (19 files), brms (17 files), emmeans (17 files), data.table (2 files), ggplot2 (2 files), FieldTrip (1 file), Statistics and Machine Learning Toolbox (1 file)
Availability: 1 check, the latest on 27 September 2026: the link answers (HTTP 200)
  • 27 September 2026: the link answers (HTTP 200)
20 files
At the source: osf.io/xcgp6/

OSF zms2v

License: none: the authors keep all their rights
State: the link answers, verified on 27 September 2026
Evidence: files inventoried
Size: 1 file, 0 scripts
Software Heritage: not checked
Found in: the text, “5.5 Procedure”
Not found: README, license file, CITATION.cff, environment file, tests, continuous integration, documentation
Availability: 1 check, the latest on 27 September 2026: the link answers (HTTP 200)
  • 27 September 2026: the link answers (HTTP 200)
At the source: osf.io/zms2v

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:

  • 2 repositories of the authors' code, each at its verified commit, with its license and how the link was found in the paper;
  • 20 scripts, each with its path and the digest of its content;
  • 4 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

Datasets cited

Data Availability

These data were collected after the submission of the following preregistration: https://osf.io/hz6tm. All of the data collected and analysed for this study, as well as all of our code, can be found in our repository entitled ‘Longitudinal perspectives on intergenerational inter-brain synchrony’ on OSF: https://osf.io/xcgp6/.

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 1, 27 September 2026: the first record

Recorded: type, language, journal, volume, issue, pages, dates, 3 authors, 12 MeSH terms, 6 funders, 123 references.

Cite

This paper

Moffat, R., Dumas, G., & Cross, E. S. (2026). Social interactions between people of same and different generations shape longitudinal changes in interpersonal neural synchrony, loneliness, and social connection. PLoS biology, 24(8), e3003899. https://doi.org/10.1371/journal.pbio.3003899

BibTeX

@article{moffat2026social,
author = {Moffat, Ryssa and Dumas, Guillaume and Cross, Emily S.},
title = {{Social interactions between people of same and different generations shape longitudinal changes in interpersonal neural synchrony, loneliness, and social connection}},
journal = {PLoS biology},
year = {2026},
month = aug,
volume = {24},
number = {8},
pages = {e3003899},
publisher = {PLOS},
issn = {1544-9173},
doi = {10.1371/journal.pbio.3003899},
url = {https://doi.org/10.1371/journal.pbio.3003899},
pmid = {42623338},
pmcid = {PMC13492753}
}

RIS

TY - JOUR
AU - Moffat, Ryssa
AU - Dumas, Guillaume
AU - Cross, Emily S.
TI - Social interactions between people of same and different generations shape longitudinal changes in interpersonal neural synchrony, loneliness, and social connection
T2 - PLoS biology
J2 - PLoS Biol
PY - 2026
DA - 2026/08/20
VL - 24
IS - 8
SP - e3003899
SN - 1544-9173
PB - PLOS
DO - 10.1371/journal.pbio.3003899
UR - https://doi.org/10.1371/journal.pbio.3003899
LA - en
ER -

CSL-JSON

{
"id": "10.1371/journal.pbio.3003899",
"type": "article-journal",
"title": "Social interactions between people of same and different generations shape longitudinal changes in interpersonal neural synchrony, loneliness, and social connection",
"container-title": "PLoS biology",
"author": [
{
"family": "Moffat",
"given": "Ryssa"
},
{
"family": "Dumas",
"given": "Guillaume"
},
{
"family": "Cross",
"given": "Emily S."
}
],
"container-title-short": "PLoS Biol",
"volume": "24",
"issue": "8",
"page": "e3003899",
"DOI": "10.1371/journal.pbio.3003899",
"PMID": "42623338",
"PMCID": "PMC13492753",
"ISSN": "1544-9173",
"publisher": "PLOS",
"URL": "https://doi.org/10.1371/journal.pbio.3003899",
"language": "en",
"issued": {
"date-parts": [
[
2026,
8,
20
]
]
}
}

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.3390/brainsci16080809 [code]
The Influence of Shared Attention and Friendship on Emotional Processing: A Behavioral and EEG Hyperscanning Study.
Journal: Brain sciences
In common: emmeans, tidyverse, 6 references
[2] doi:10.1523/eneuro.0076-26.2026 [code]
Exogenously Driven Neural Reactivation of Spatially Matching Visual Working-Memory Contents.
Journal: eNeuro
In common: brms, FieldTrip, emmeans, 5 other tools, 1 reference
[3] doi:10.1523/eneuro.0316-25.2026 [code]
Neural Mechanisms of Self-Generated Action Sequences.
Journal: eNeuro
In common: brms, FieldTrip, emmeans, 3 other tools, 2 references
[4] doi:10.1038/s41598-026-50540-z [code]
Addressing arbitrary choices of frequency band of interest in fNIRS hyperscanning.
Journal: Scientific reports
In common: Statistics and Machine Learning Toolbox, 6 references
[5] doi:10.1093/oons/kvag006 [code]
Social disconnection in the brain: loneliness and age across networks using graph theory.
Journal: Oxford open neuroscience
In common: tidyverse, 6 references
[6] doi:10.1162/opmi.a.372 [code]
Broadening the Agent Preference Hypothesis Through Experiencers: Eye-Tracking and EEG Evidence of Proto-Agents and Proto-Patients.
Journal: Open mind : discoveries in cognitive science
In common: brms, FieldTrip, data.table, 3 other tools, 2 references
[7] doi:10.1162/imag.a.1347 [code]
Neural and behavioural correlates of theory of mind reasoning in five-year-old children born preterm.
Journal: Imaging neuroscience (Cambridge, Mass.)
In common: brms, patchwork, ggplot2, 1 other tool, 3 references
[8] doi:10.3758/s13428-026-03060-7 [code]
Synchronizing brains and hearts: A practical guide for caregiver-child fNIRS-ECG multimodal hyperscanning.
Journal: Behavior research methods
In common: 6 references
[9] doi:10.1111/jcpp.70178 [code]
What makes a lonely child: environmental, health, and multimodal neuroimaging correlates of prospective loneliness in the ABCD study.
Journal: Journal of child psychology and psychiatry, and allied disciplines
In common: ggpubr, patchwork, ggplot2, 1 other tool, 3 references
[10] doi:10.64898/2026.05.08.26348885 [code]
Insights from nine nights of self-applied, low-density sleep EEG during sleep restriction therapy: a proof-of-concept evaluation
Journal: medRxiv (preprint)
In common: FieldTrip, emmeans, ggpubr, 4 other tools, 1 reference

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.

Request its removal

To ask OSCR to remove this record, the copies of its authors' scripts or its tracing map, use the removal request page: signed in, you say who you are, what to remove and why, then review and confirm the request. Published rules decide every request (how).

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.