Neural encoding of pain is robust within but unstable between individuals.
The 12 matches
- [1] § Methods › Extracting EEG responses › Individual-level responses. ↔ statistical_analysis/plot_results_GAs.m, lines 47–65 · score 0.95 · 150–350 ms, 300–600 ms, 500–900 ms, 7–12 Hz, 14–30 Hz, 70–90 Hz
- [2] § Methods › Statistical analyses › Models of inter-individual variability. ↔ statistical_analysis/varPain_StatisticalAnalysis_INTER.R, lines 101–151 · score 0.70 · inter individual variability, Bayes factors, pain rating, regression, N2, N1
- [3] § Methods › Statistical analyses › Models of inter-individual variability. ↔ statistical_analysis/varPain_StatisticalAnalyses_INTRA_D2D.R, lines 91–140 · score 0.70 · inter individual variability, Bayes factors, pain rating, regression, N2, N1
- [4] § Methods › Extracting EEG responses › Individual-level responses. ↔ statistical_analysis/plot_results_GAs.m, lines 47–65 · score 0.68 · 14–30 Hz, 70–90 Hz, FieldTrip, 14 Hz, 70 Hz, beta
- [5] § Methods › Noxious stimulation ↔ paradigm/varPain_familiarization_laser.m, lines 120–156 · score 0.68 · spot diameter, pulse duration, stimulation intensities, laser, stimuli, Pain
- [6] § Methods › Noxious stimulation ↔ paradigm/varPain_Paradigm_IntensityRating.m, lines 298–349 · score 0.67 · spot diameter, stimulation intensities, pulse duration, laser, Pain
- [7] § Methods › Statistical analyses › Models of intra-individual variability. ↔ statistical_analysis/varPain_StatisticalAnalyses_INTRA_D2D.R, lines 91–140 · score 0.60 · bayesFactor, inter individual variability, pain rating, N2, N1, beta
- [8] § Methods › Statistical analyses › Models of intra-individual variability. ↔ statistical_analysis/varPain_StatisticalAnalyses_INTRA_M2M.R, lines 94–143 · score 0.60 · bayesFactor, inter individual variability, pain rating, N2, N1, beta
- [9] § Methods › Statistical analyses › Inference criteria. ↔ statistical_analysis/varPain_StatisticalAnalysis_INTER.R, lines 101–151 · score 0.57 · model fitting, inter individual variability, sex, age, posterior, BF
- [10] § Methods › Procedure and paradigm ↔ paradigm/varPain_Paradigm_IntensityRating.m, lines 434–546 · score 0.57 · pain paradigm, laser stimuli, prompted, sounds, intensities, EEG
- [11] § Methods › External replication data ↔ paradigm/varPain_familiarization_laser.m, lines 120–156 · score 0.56 · spot diameter, pulse duration, stimulation, laser, stimuli
- [12] § Methods › External replication data ↔ paradigm/varPain_Paradigm_IntensityRating.m, lines 298–349 · score 0.55 · spot diameter, pulse duration, stimulation, laser
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 · 546 lines · 20 KB · no license · 3 matches
- % before starting of this function:
- % 1. execute this line to open the serial port:
- % [spHandle, errmsg] = IOPort('OpenSerialPort', 'COM2');
- % 2. set laser from "panel" to "serial" on the laser's touchpad
- % establish handshake with laser by executing this line:
- % IOPort('Write', spHandle, uint8([204,080,000,000,000,185]));
- % in case you need to repeat the procedure, close serial port first by executing this line:
- % IOPort('Close', spHandle)
- function ME = varPain_Paradigm_IntensityRating()
- %% adjust parameters before each session %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- subject_ID = 'vp00';
- intens_1 = 2.5;
- intens_2 = 3.0;
- intens_3 = 3.5
- intens_4 = 4.0
- number_trials = 80;
- withTraining = true;
- number_test_trials = 3;
- % number_trials_block1 = 20;
- % number_trials_block2 = 20;
- % number_trials_block3 = 20;
- % number_trials_block4 = 20;
- % LASER parameters (fixed for experiment)
- Energy_1 = 4*(intens_1) - 1; % energy of the laser pulse in J (range: 1 - 59); E = 4*(energy in J) - 1
- Energy_2 = 4*(intens_2) - 1;
- Energy_3 = 4*(intens_3) - 1;
- Energy_4 = 4*(intens_4) - 1;
- pulseDuration = 3; % = 4ms; duration of the laser pulse in ms (range: 0 - 19); pulseDuration = pulse duration in ms - 1)
- spotDiameter = 3; % = 7mm; spot size of the laser pulse in mm (range: 0 - 11); spotDiameter = spot size in mm - 4
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- close all
- % clear all
- % delete(instrfindall);
- % Screen('CloseAll');
- % clear ports
- % delete(instrfindall); % clear objects in ports
- % IOPort('CloseAll')
- % lptwrite(888,192); % set port with active 6th and 7th bit (response box)
- %% set isi
- isi = [1.0,5.0]; % random ISI between these two values (in seconds), specify as 7 seconds less as desired ISI because of the additional WaitSecs(3). to the beep, and additional WaitSecs(4). before applying the laser
- isi = isi(1) + (isi(2)-isi(1)).*rand(1,number_trials);
- isi = round(isi*10)/10;
- %% generate, randomize, and save matrix with stimulation intensities
- % save matrix with stimulation intensities
- max_num_same_intens = 2; % Number of identical elements who are allowed to follow after one another in the stim-sequence
- % for four stimulation intensities
- % block 1
- flag = 1;
- count = 0;
- while flag == 1
- % Randomisation
- stim_sequence1 = [repmat(intens_1,1,(number_trials/4)/4),repmat(intens_2,1,(number_trials/4)/4),repmat(intens_3,1,(number_trials/4)/4),repmat(intens_4,1,(number_trials/4)/4)];
- stim_sequence1 = stim_sequence1(randperm(numel(stim_sequence1)));
- % Create Matrix with 0 and 1 for 1, 2, 3, and 4_intens
- log_intens_1 = stim_sequence1 == intens_1;
- log_intens_2 = stim_sequence1 == intens_2;
- log_intens_3 = stim_sequence1 == intens_3;
- log_intens_4 = stim_sequence1 == intens_4;
- % sum consecutive elements in the 0/1 vector for 1, 2, 3, and 4_intens
- for i = 1:length(stim_sequence1)-max_num_same_intens
- sum_1_quad = sum(log_intens_1(1,i:i+max_num_same_intens));
- sum_2_quad = sum(log_intens_2(1,i:i+max_num_same_intens));
- sum_3_quad = sum(log_intens_3(1,i:i+max_num_same_intens));
- sum_4_quad = sum(log_intens_4(1,i:i+max_num_same_intens));
- % randomize until no sum is larger than max_num_same_intens
- if sum_1_quad == max_num_same_intens+1 || sum_2_quad == max_num_same_intens+1 || sum_3_quad == max_num_same_intens+1 || sum_4_quad == max_num_same_intens+1
- flag = 1;
- break
- else flag = 0;
- end
- end
- count = count + 1;
- end
- % block 2
- flag = 1;
- count = 0;
- while flag == 1
- % Randomisation
- stim_sequence2 = [repmat(intens_1,1,(number_trials/4)/4),repmat(intens_2,1,(number_trials/4)/4),repmat(intens_3,1,(number_trials/4)/4),repmat(intens_4,1,(number_trials/4)/4)];
- stim_sequence2 = stim_sequence2(randperm(numel(stim_sequence2)));
- % Create Matrix with 0 and 1 for 1, 2, 3, and 4_intens
- log_intens_1 = stim_sequence2 == intens_1;
- log_intens_2 = stim_sequence2 == intens_2;
- log_intens_3 = stim_sequence2 == intens_3;
- log_intens_4 = stim_sequence2 == intens_4;
- % sum consecutive elements in the 0/1 vector for 1, 2, 3, and 4_intens
- for i = 1:length(stim_sequence2)-max_num_same_intens
- sum_1_quad = sum(log_intens_1(1,i:i+max_num_same_intens));
- sum_2_quad = sum(log_intens_2(1,i:i+max_num_same_intens));
- sum_3_quad = sum(log_intens_3(1,i:i+max_num_same_intens));
- sum_4_quad = sum(log_intens_4(1,i:i+max_num_same_intens));
- % randomize until no sum is larger than max_num_same_intens
- if sum_1_quad == max_num_same_intens+1 || sum_2_quad == max_num_same_intens+1 || sum_3_quad == max_num_same_intens+1 || sum_4_quad == max_num_same_intens+1 || stim_sequence1(1,number_trials/4) == stim_sequence2(1,1)
- flag = 1;
- break
- else flag = 0;
- end
- end
- count = count + 1;
- end
- stim_sequence = [stim_sequence1, stim_sequence2];
- % block 3
- flag = 1;
- count = 0;
- while flag == 1
- % Randomisation
- stim_sequence3 = [repmat(intens_1,1,(number_trials/4)/4),repmat(intens_2,1,(number_trials/4)/4),repmat(intens_3,1,(number_trials/4)/4),repmat(intens_4,1,(number_trials/4)/4)];
- stim_sequence3 = stim_sequence3(randperm(numel(stim_sequence3)));
- % Create Matrix with 0 and 1 for 1, 2, 3, and 4_intens
- log_intens_1 = stim_sequence3 == intens_1;
- log_intens_2 = stim_sequence3 == intens_2;
- log_intens_3 = stim_sequence3 == intens_3;
- log_intens_4 = stim_sequence3 == intens_4;
- % sum consecutive elements in the 0/1 vector for 1, 2, 3, and 4_intens
- for i = 1:length(stim_sequence3)-max_num_same_intens
- sum_1_quad = sum(log_intens_1(1,i:i+max_num_same_intens));
- sum_2_quad = sum(log_intens_2(1,i:i+max_num_same_intens));
- sum_3_quad = sum(log_intens_3(1,i:i+max_num_same_intens));
- sum_4_quad = sum(log_intens_4(1,i:i+max_num_same_intens));
- % randomize until no sum is larger than max_num_same_intens
- if sum_1_quad == max_num_same_intens+1 || sum_2_quad == max_num_same_intens+1 || sum_3_quad == max_num_same_intens+1 || sum_4_quad == max_num_same_intens+1
- flag = 1;
- break
- else flag = 0;
- end
- end
- count = count + 1;
- end
- stim_sequence = [stim_sequence1, stim_sequence2, stim_sequence3];
- % block 4
- flag = 1;
- count = 0;
- while flag == 1
- % Randomisation
- stim_sequence4 = [repmat(intens_1,1,(number_trials/4)/4),repmat(intens_2,1,(number_trials/4)/4),repmat(intens_3,1,(number_trials/4)/4),repmat(intens_4,1,(number_trials/4)/4)];
- stim_sequence4 = stim_sequence4(randperm(numel(stim_sequence4)));
- % Create Matrix with 0 and 1 for 1, 2, 3, and 4_intens
- log_intens_1 = stim_sequence4 == intens_1;
- log_intens_2 = stim_sequence4 == intens_2;
- log_intens_3 = stim_sequence4 == intens_3;
- log_intens_4 = stim_sequence4 == intens_4;
- % sum consecutive elements in the 0/1 vector for 1, 2, 3, and 4_intens
- for i = 1:length(stim_sequence4)-max_num_same_intens
- sum_1_quad = sum(log_intens_1(1,i:i+max_num_same_intens));
- sum_2_quad = sum(log_intens_2(1,i:i+max_num_same_intens));
- sum_3_quad = sum(log_intens_3(1,i:i+max_num_same_intens));
- sum_4_quad = sum(log_intens_4(1,i:i+max_num_same_intens));
- % randomize until no sum is larger than max_num_same_intens
- if sum_1_quad == max_num_same_intens+1 || sum_2_quad == max_num_same_intens+1 || sum_3_quad == max_num_same_intens+1 || sum_4_quad == max_num_same_intens+1 || stim_sequence3(1,number_trials/4) == stim_sequence4(1,1)
- flag = 1;
- break
- else flag = 0;
- end
- end
- count = count + 1;
- end
- stim_sequence = [stim_sequence1, stim_sequence2, stim_sequence3, stim_sequence4];
- % mkdir(['C:\Users\PainLabPres\Documents\experiments\variability of pain responses\',subject_ID]);
- PATHOUT = ['C:\Users\PainLabPres\Desktop\VarPain\StimSequences\'];
- save([PATHOUT,subject_ID,'_stim_sequence.mat'],'stim_sequence');
- % load([PATHOUT,Subject_ID,'_stim_sequence.mat']);
- try % used for debugging with PTB (error message can be found in the structure ME)
- % initialization of keyboard
- KbName('UnifyKeyNames');
- esc = KbName('escape');
- enter = KbName('return');
- reaction_key = KbName('space');
- pause_key = KbName('shift'); % key to pause experiment
- [keyisdown, secs, keycode] = KbCheck; % initializing KbCheck
- oldenablekeys = RestrictKeysForKbCheck([esc,enter,reaction_key,pause_key]); % just the escape, return, reaction key and pause key are responsive
- % pausekey = 'shift'; % key to pause experiment
- % pausekeycode = KbName(pausekey);
- % %% set up TCPIP connection with EEG laptop
- % tcpip_obj = tcpip('141.39.145.129', 6700, 'NetworkRole', 'client');
- % tcpip_obj.ByteOrder = 'littleEndian';
- % fopen(tcpip_obj);
- %% window specifications
- w_size = [];
- backgr_color = [192,192,192];
- instr_textsize = 40;
- text_color = 0;
- screenNumber = Screen('Screens');
- [w rect]=Screen('OpenWindow',screenNumber,backgr_color,w_size);
- Screen('TextSize', w, instr_textsize);
- Screen('TextStyle', w, 1);
- Screen('TextFont', w, 'Arial');
- [X,Y] = RectCenter(rect);
- Screen('FillRect',w,backgr_color);
- Screen('Flip',w);
- WaitSecs(1);
- HideCursor(screenNumber);
- % %% start Brain Vision Recorder
- % start_remote_recorder_EEG(tcpip_obj,Subject_ID,'_Mediation_Paradigm1_Perception')
- %
- %% instruction
- DrawFormattedText(w ,['Wir werden Ihnen gleich Schmerzreize ganz'...
- '\n unterschiedlicher Intensit?t auf dem linken Handr?cken verabreichen.'...
- ' \n\n Ihre Aufgabe ist es, die Intensit?t jedes Schmerzreizes zu bewerten,'...
- '\n auf einer Skala von: \n\n '...
- '0 = >kein Schmerz<'...
- '\n bis \n '...
- '100 = >maximal tolerierbarer Schmerz<. \n\n'...
- '\n Bitte warten Sie mit Ihrer Bewertung, \n bis Sie den Piepton h?ren.'], 'center', 'center', text_color,[],[],[],1.7);
- Screen('Flip',w);
- KbWait;
- [keyIsDown,~,keyCode] = KbCheck;
- if keyIsDown && keyCode(esc)
- Screen('CloseAll');
- return
- end
- Screen('FillRect',w,backgr_color);
- Screen('Flip',w);
- WaitSecs(1);
- DrawFormattedText(w,['Bitte lassen Sie Ihre Augen \n die gesamte Zeit geschlossen.'...
- ' \n\n Bitte versuchen Sie auch, w?hrend der \n gesamten Zeit m?glichst entspannt zu bleiben.'...
- ' \n\n Die Intensit?t der Schmerzreize wird die Intensit?t'...
- ' \n w?hrend der Gew?hnung nicht ?berschreiten.'...
- ' \n\n Wenn Sie unterbrechen m?chten, \n lassen Sie es uns bitte wissen.'...
- ' \n Dann beenden wir das Experiment.'], 'center', 'center', text_color,[],[],[],1.7);
- Screen('Flip',w);
- KbWait;
- [keyIsDown,~,keyCode] = KbCheck;
- if keyIsDown && keyCode(esc)
- Screen('CloseAll');
- return
- end
- Screen('FillRect',w,backgr_color);
- Screen('Flip',w);
- WaitSecs(1);
- DrawFormattedText(w,'Haben Sie noch Fragen?', 'center', 'center', text_color,[],[],[],1.7);
- Screen('Flip',w);
- KbWait;
- [keyIsDown,~,keyCode] = KbCheck;
- if keyIsDown && keyCode(esc)
- Screen('CloseAll');
- return
- end
- Screen('FillRect',w,backgr_color);
- Screen('Flip',w);
- WaitSecs(1);
- DrawFormattedText(w,['Dann starten wir nun mit drei Probedurchg?ngen!'...
- ' \n\n Bitte schlie?en Sie die Augen \n und halten Sie sich bereit.'], 'center', 'center', text_color,[],[],[],1.7);
- Screen('Flip',w);
- KbWait;
- [keyIsDown,~,keyCode] = KbCheck;
- if keyIsDown && keyCode(esc)
- Screen('CloseAll');
- return
- end
- Screen('FillRect',w,backgr_color);
- Screen('Flip',w);
- WaitSecs(1);
- %% prepare laser
- % open Serialport (alternative)
- [spHandle, errmsg] = IOPort('OpenSerialPort', 'COM2');
- WaitSecs(2);
- % set LASER ON
- IOPort('Write', spHandle, uint8([204,076,049,049,049,185])); % L111
- WaitSecs(2);
- % set OPERATE ON
- IOPort('Write', spHandle, uint8([204,079,049,049,049,185])); % O111
- WaitSecs(2);
- % calibrate parameters for all stimulation intensities
- IOPort('Write', spHandle, uint8([204,067,pulseDuration,Energy_1,000,185])); % Cdef (f is empty)
- WaitSecs(8);
- IOPort('Write', spHandle, uint8([204,067,pulseDuration,Energy_2,000,185])); % Cdef (f is empty)
- WaitSecs(8);
- IOPort('Write', spHandle, uint8([204,067,pulseDuration,Energy_3,000,185])); % Cdef (f is empty)
- WaitSecs(8);
- IOPort('Write', spHandle, uint8([204,067,pulseDuration,Energy_4,000,185])); % Cdef (f is empty)
- WaitSecs(8);
- % set parameters for all stimulation intensities
- IOPort('Write', spHandle, uint8([204,080,pulseDuration,Energy_1,spotDiameter,185])); % Pdes
- WaitSecs(2);
- IOPort('Write', spHandle, uint8([204,080,pulseDuration,Energy_2,spotDiameter,185])); % Pdes
- WaitSecs(2);
- IOPort('Write', spHandle, uint8([204,080,pulseDuration,Energy_3,spotDiameter,185])); % Pdes
- WaitSecs(2);
- IOPort('Write', spHandle, uint8([204,080,pulseDuration,Energy_4,spotDiameter,185])); % Pdes
- WaitSecs(2);
- DrawFormattedText(w,['Footswitch pressed? \n Press >space< to start the test trials.'...
- ' \n\n >space<'], 'center', 'center', text_color,[],[],[],1.7);
- Screen('Flip',w);
- KbWait;
- [keyIsDown,~,keyCode] = KbCheck;
- if keyIsDown && keyCode(esc)
- Screen('CloseAll');
- return
- end
- Screen('FillRect',w,backgr_color);
- Screen('Flip',w);
- WaitSecs(1);
- % create beep or later use
- beep = MakeBeep(1000,0.2);
- Snd('Open');
- %% loop for test trials
- for i = 1:number_test_trials
- [keyisdown, secs, keycode] = KbCheck; % initializing KbCheck
- if keyisdown && keycode(esc)
- Screen('CloseAll');
- return
- end
- if keyisdown && keycode(pause_key)
- DrawFormattedText(w,['Pause requested.'...
- ' \n\n Press space to continue.'], 'center', 'center', text_color);
- Screen('Flip',w);
- KbPressWait;
- end
- % display trial number on screen
- DrawFormattedText(w,num2str(i), 'center', 'center', text_color);
- Screen('Flip',w);
- % LASER: set laser intensity
- LasEnerg = stim_sequence(i);
- LasEnerg_str = num2str(LasEnerg);
- if LasEnerg == intens_1
- IOPort('Write', spHandle, uint8([204,080,pulseDuration,Energy_1,spotDiameter,185])); % Pdes
- lptwrite(888,1); WaitSecs(0.004); lptwrite(888,0); % EEG marker laserpulse
- elseif LasEnerg == intens_2
- IOPort('Write', spHandle, uint8([204,080,pulseDuration,Energy_2,spotDiameter,185])); % Pdes
- lptwrite(888,2); WaitSecs(0.004); lptwrite(888,0); % EEG marker laserpulse
- elseif LasEnerg == intens_3
- IOPort('Write', spHandle, uint8([204,080,pulseDuration,Energy_3,spotDiameter,185])); % Pdes
- lptwrite(888,3); WaitSecs(0.004); lptwrite(888,0); % EEG marker laserpulse
- elseif LasEnerg == intens_4
- IOPort('Write', spHandle, uint8([204,080,pulseDuration,Energy_4,spotDiameter,185])); % Pdes
- lptwrite(888,4); WaitSecs(0.004); lptwrite(888,0); % EEG marker laserpulse
- end
- WaitSecs(4);
- % LASER: apply laser stimulus
- IOPort('Write', spHandle, uint8([204,071,049,049,049,185])); % G11
- % Wait for specified time (3 sec until beep)
- WaitSecs(3);
- % play sound which prompts rating
- lptwrite(888,7); WaitSecs(0.004); lptwrite(888,0); % EEG marker beep
- Snd('Play',beep);
- % Wait for specified time (ISI)
- WaitSecs(isi(i));
- end
- %% Instructions before start of main experiment
- DrawFormattedText(w,['Alles klar? Dann geht es jetzt los!'], 'center', 'center', text_color,[],[],[],1.7);
- Screen('Flip',w);
- KbWait;
- [keyIsDown,~,keyCode] = KbCheck;
- if keyIsDown && keyCode(esc)
- Screen('CloseAll');
- return
- end
- Screen('FillRect',w,backgr_color);
- Screen('Flip',w);
- WaitSecs(1);
- DrawFormattedText(w,['Footswitch pressed? EEG saved? \n Press >space< to start the experiment.'...
- ' \n\n >space<'], 'center', 'center', text_color,[],[],[],1.7);
- Screen('Flip',w);
- KbWait;
- [keyIsDown,~,keyCode] = KbCheck;
- if keyIsDown && keyCode(esc)
- Screen('CloseAll');
- return
- end
- Screen('FillRect',w,backgr_color);
- Screen('Flip',w);
- % fprintf(tcpip_obj, '%s','S');
- WaitSecs(10);
- lptwrite(888,8); WaitSecs(0.004); lptwrite(888,0); % start the experiment / start block 1
- %% loop for main experiment
- for i = 1:number_trials
- [keyisdown, secs, keycode] = KbCheck; % initializing KbCheck
- if keyisdown && keycode(esc)
- Screen('CloseAll');
- return
- end
- if keyisdown && keycode(pause_key)
- DrawFormattedText(w,['Pause requested.'...
- ' \n \n Press space to continue.'], 'center', 'center', text_color);
- Screen('Flip',w);
- KbPressWait;
- end
- % display trial number on screen
- DrawFormattedText(w,num2str(i), 'center', 'center', text_color);
- Screen('Flip',w);
- % send marker end / start blocks and pause after 40 trials
- if i == 20
- lptwrite(888,9); WaitSecs(0.004); lptwrite(888,0); % end block 1
- elseif i == 21
- lptwrite(888,10); WaitSecs(0.004); lptwrite(888,0); % start block 2
- elseif i == 40
- lptwrite(888,11); WaitSecs(0.004); lptwrite(888,0); % end block 2
- WaitSecs(0.5);
- DrawFormattedText(w,'Kurze Pause. \n \n Alles klar? Dann geht es jetzt weiter! \n \n >space<', 'center', 'center', text_color);
- Screen('Flip',w);
- KbWait;
- [keyIsDown,~,keyCode] = KbCheck;
- if keyIsDown && keyCode(esc)
- Screen('CloseAll');
- return
- end
- Screen('FillRect',w,backgr_color);
- Screen('Flip',w);
- % fprintf(tcpip_obj, '%s','S');
- WaitSecs(3);
- end
- % LASER: set laser intensity
- LasEnerg = stim_sequence(i);
- LasEnerg_str = num2str(LasEnerg);
- if LasEnerg == intens_1
- IOPort('Write', spHandle, uint8([204,080,pulseDuration,Energy_1,spotDiameter,185])); % Pdes
- lptwrite(888,1); WaitSecs(0.004); lptwrite(888,0); % EEG marker laserpulse
- elseif LasEnerg == intens_2
- IOPort('Write', spHandle, uint8([204,080,pulseDuration,Energy_2,spotDiameter,185])); % Pdes
- lptwrite(888,2); WaitSecs(0.004); lptwrite(888,0); % EEG marker laserpulse
- elseif LasEnerg == intens_3
- IOPort('Write', spHandle, uint8([204,080,pulseDuration,Energy_3,spotDiameter,185])); % Pdes
- lptwrite(888,3); WaitSecs(0.004); lptwrite(888,0); % EEG marker laserpulse
- elseif LasEnerg == intens_4
- IOPort('Write', spHandle, uint8([204,080,pulseDuration,Energy_4,spotDiameter,185])); % Pdes
- lptwrite(888,4); WaitSecs(0.004); lptwrite(888,0); % EEG marker laserpulse
- end
- WaitSecs(4);
- % LASER: apply laser stimulus
- IOPort('Write', spHandle, uint8([204,071,049,049,049,185])); % G111
- % Wait for specified time (3 sec until beep)
- WaitSecs(3);
- % play sound which prompts rating
- lptwrite(888,7); WaitSecs(0.004); lptwrite(888,0); % EEG marker beep
- beep = MakeBeep(1000,0.2);
- Snd('Open');
- Snd('Play',beep);
- Snd('Quiet');
- % Wait for specified time (ISI)
- WaitSecs(isi(i));
- end
- catch ME
- Screen('CloseAll');
- rethrow(ME);
- end
- WaitSecs(5);
- lptwrite(888,15); WaitSecs(0.004); lptwrite(888,0); % end of the experiment / end block 4
- WaitSecs(1);
- % fprintf(tcpip_obj, '%s','Q'); % stop the recording
- % fprintf(tcpip_obj, '%s','X'); % quit the recorder
- % fclose(tcpip_obj); delete(tcpip_obj); clear tcpip_obj; % clear and delete the object
- % fclose(s); delete(s); clear s; % clear and delete the object
- DrawFormattedText(w,['The experiment is completed.'], 'center', 'center', text_color);
- Screen('Flip',w);
- WaitSecs(5);
- Screen('CloseAll');
- %close object used or beep
- Snd('Quiet');
- % %% function starting EEG recording
- % function start_remote_recorder_EEG(tcpip_obj,Subject_ID,file_extension)
- % fprintf(tcpip_obj, '%s','1f:\WorkFiles\Pain64ch_1kHz_mediation.rwksp'); % workspace (numbers 1-4 necessary for remote recorder)
- % WaitSecs(1); fprintf(tcpip_obj, '%s',['2',file_extension]); % experiment name
- % WaitSecs(1); fprintf(tcpip_obj, '%s',['3',Subject_ID]); % vp number
- % WaitSecs(1); fprintf(tcpip_obj, '%s','4'); % start recorder
- % WaitSecs(1); fprintf(tcpip_obj, '%s','M'); % Monitor Mode
- % WaitSecs(1);
varPain_Paradigm_IntensityRating.m, no license · at the source
Overview
Abstract
The perception of pain varies both within and between individuals, even when sensory input remains constant. Understanding how the brain encodes these intra- and inter-individual variations is central to elucidating the neural mechanisms of pain and to developing reliable brain-based markers for clinical use. Yet, previous findings have been inconsistent, and their robustness across time and populations remains unclear. Here, we used electroencephalography (EEG) in 161 healthy participants to re-investigate the neural patterns explaining intra- and inter-individual variations in the perception of brief painful stimuli independent of stimulus intensity. Using Bayesian multivariate multi-model regression, we related pain ratings to canonical EEG responses. To directly assess robustness, the experiment was repeated after 4 weeks in the same participants and replicated in an independent cohort (n = 111). Neural patterns associated with inter-individual differences in pain perception were repeatable over time but not replicable across cohorts. In contrast, neural patterns underlying intra-individual fluctuations were robust both over time and across cohorts. These findings indicate that within-person and between-person variability in pain perception is encoded by distinct neural patterns that differ fundamentally in their robustness. Furthermore, they show that brain-based markers are particularly suited for tracking intra-individual fluctuations of pain, while being less sensitive to inter-individual differences. More broadly, they highlight the importance of within-person approaches for advancing both mechanistic models of pain and the development of clinically useful biomarkers.
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 12 matches between paragraphs and lines of code.
OSF bs3yj
Availability: 1 check, the latest on 27 September 2026: the link answers (HTTP 200)
- 27 September 2026: the link answers (HTTP 200)
9 files
- paradigm/
varPain_Paradigm_Intensi , MATLAB, 546 lines, 3 matchestyRating.m - paradigm/
varPain_familiarization_ , MATLAB, 210 lines, 2 matcheslaser.m - statistical_analysis/
BFDA.R , R, 31 lines - statistical_analysis/
plot_distributions.m , MATLAB, 331 lines - statistical_analysis/
plot_results_GAs.m , MATLAB, 209 lines, 2 matches - statistical_analysis/
plot_results_bars.m , MATLAB, 339 lines - statistical_analysis/
varPain_StatisticalAnaly , R, 558 lines, 2 matchesses_INTRA_D2D.R - statistical_analysis/
varPain_StatisticalAnaly , R, 561 lines, 1 matchses_INTRA_M2M.R - statistical_analysis/
varPain_StatisticalAnaly , R, 569 lines, 2 matchessis_INTER.R
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;
- 9 scripts, each with its path and the digest of its content;
- 12 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
- doi:10.18112/
openneuro.ds005280.v1.0. , at OpenNeuro; found in the text, “External replication data”0 - osf:z2h86, at OSF; found in “Data Availability”
Data Availability
All data in standardized EEG-BIDS format [44] are available at 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 1, 27 September 2026: the first record
Recorded: type, language, journal, volume, issue, pages, dates, 9 authors, 11 MeSH terms, 2 funders, 57 references.
Cite
This paper
Tiemann, L., Bott, F. S., May, E. S., Nickel, M. M., Hohn, V. D., Gil Ávila, C., Bruna, N., Zebhauser, P. T., & Ploner, M. (2026). Neural encoding of pain is robust within but unstable between individuals. PLoS biology, 24(8), e3003948. https://
BibTeX
@article{tiemann2026neur
author = {Tiemann, Laura and Bott, Felix S and May, Elisabeth S and Nickel, Moritz M and Hohn, Vanessa D and Gil Ávila, Cristina and Bruna, Nicolò and Zebhauser, Paul Theo and Ploner, Markus},
title = {{Neural encoding of pain is robust within but unstable between individuals}},
journal = {PLoS biology},
year = {2026},
month = aug,
volume = {24},
number = {8},
pages = {e3003948},
publisher = {PLOS},
issn = {1544-9173},
doi = {10.1371/
url = {https://
pmid = {42574470},
pmcid = {PMC13475984}
}
RIS
TY - JOUR
AU - Tiemann, Laura
AU - Bott, Felix S
AU - May, Elisabeth S
AU - Nickel, Moritz M
AU - Hohn, Vanessa D
AU - Gil Ávila, Cristina
AU - Bruna, Nicolò
AU - Zebhauser, Paul Theo
AU - Ploner, Markus
TI - Neural encoding of pain is robust within but unstable between individuals
T2 - PLoS biology
J2 - PLoS Biol
PY - 2026
DA - 2026/
VL - 24
IS - 8
SP - e3003948
SN - 1544-9173
PB - PLOS
DO - 10.1371/
UR - https://
LA - en
ER -
CSL-JSON
{
"id": "10.1371/
"type": "article-journal",
"title": "Neural encoding of pain is robust within but unstable between individuals",
"container-title": "PLoS biology",
"author": [
{
"family": "Tiemann",
"given": "Laura"
},
{
"family": "Bott",
"given": "Felix S"
},
{
"family": "May",
"given": "Elisabeth S"
},
{
"family": "Nickel",
"given": "Moritz M"
},
{
"family": "Hohn",
"given": "Vanessa D"
},
{
"family": "Gil Ávila",
"given": "Cristina"
},
{
"family": "Bruna",
"given": "Nicolò"
},
{
"family": "Zebhauser",
"given": "Paul Theo"
},
{
"family": "Ploner",
"given": "Markus"
}
],
"container-title-short":
"volume": "24",
"issue": "8",
"page": "e3003948",
"DOI": "10.1371/
"PMID": "42574470",
"PMCID": "PMC13475984",
"ISSN": "1544-9173",
"publisher": "PLOS",
"URL": "https://
"language": "en",
"issued": {
"date-parts": [
[
2026,
8,
10
]
]
}
}
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.1097/j.pain.0000000000004044 [code]
- No effect of rhythmic visual stimulation on experimental pain perception.Journal: PainIn common: pain, EEG, cognitive, 10 references
- [2] doi:10.1371/journal.pbio.3003979 [code]
- Impaired midfrontal‑motor theta phase synchronization characterizes maladaptive motivational behavior in people with obsessive‑compulsive disorder.Journal: PLoS biologyIn common: BayesFactor, FieldTrip, lmerTest, 4 other tools, EEG, 2 references
- [3] doi:10.1016/j.neuroimage.2026.122002
- EEG-based clustering shows distinct separation of chronic pain patients before spinal cord stimulation surgery.Journal: NeuroImageIn common: pain, EEG, 7 references
- [4] doi:10.1038/s44271-026-00431-w [code]
- Alpha power increases spontaneously during a neurofeedback session.Journal: Communications psychologyIn common: BayesFactor, Psychtoolbox, easystats, 2 other tools, EEG, cognitive, 2 references
- [5] doi:10.1038/s41467-026-74565-0 [code]
- The functional neurobiology of dispositions towards negative emotions.Journal: Nature communicationsIn common: BayesFactor, easystats, FieldTrip, 3 other tools, cognitive, 1 reference
- [6] doi:10.1038/s41467-026-71600-y [code]
- Temporal predictions shape somatosensory perception.Journal: Nature communicationsIn common: Psychtoolbox, FieldTrip, pain, EEG, cognitive, 4 references
- [7] doi:10.1371/journal.pone.0355165 [code]
- Pupillary dynamics during hands-off L2 driving and transitions of control under high cognitive load.Journal: PloS oneIn common: BayesFactor, easystats, lmerTest, 4 other tools, cognitive
- [8] doi:10.1038/s41467-026-73865-9 [code]
- Histamine shapes the neurocomputational dynamics of human learning.Journal: Nature communicationsIn common: BayesFactor, easystats, lmerTest, 4 other tools, cognitive
- [9] doi:10.1038/s41598-026-53424-4 [code]
- Cognitive control networks causally support implicit emotion regulation: evidence from dlPFC stimulation and directed functional connectivity.Journal: Scientific reportsIn common: BayesFactor, FieldTrip, lmerTest, 3 other tools, EEG, cognitive, 1 reference
- [10] doi:10.1162/imag.a.1258 [code]
- Non-specific increase in alpha power during a neurofeedback session targeting its downregulation.Journal: Imaging neuroscience (Cambridge, Mass.)In common: BayesFactor, Psychtoolbox, easystats, 2 other tools, EEG, 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, 9 scripts, and 12 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:46770cee8cbe2686…
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.
