OSCR

Layer-specific attentional modulation in the human primary somatosensory cortex.

Code ↔ Paper

The paper beside its authors' code: matches between them have not been computed for this paper yet.

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 · 203 lines · 5.4 KB · MIT

  1. % extract_qT1_laminar_profile.m
  2. %
  3. % Extract a laminar qT1 profile from a discrete LAYNII layer map (1..8)
  4. % within an ROI, while preserving the original analysis logic:
  5. % - optional ROI dilation
  6. % - layer-wise extraction using (layer == i)
  7. % - first derivative normalization
  8. % - second derivative computation
  9. %
  10. % This public-friendly version:
  11. % - removes hard-coded local paths
  12. % - saves outputs to ./out/
  13. % - keeps the original ROI dilation + layer==i logic unchanged
  14. %
  15. % Requirements:
  16. % - MATLAB
  17. % - Image Processing Toolbox (for imdilate)
  18. %
  19. % Important:
  20. % qT1, layer map, and ROI must be in the same voxel space and dimensions.
  21. %
  22. % Inputs to edit below:
  23. % - qT1_path
  24. % - layer_path
  25. % - roi_path
  26. % - subject_id
  27. %
  28. % Outputs:
  29. % ./out/<subject_id>_qT1profile.mat
  30. % ./out/<subject_id>_qT1profile.png
  31. clc;
  32. clear;
  33. close all;
  34. %% =========================
  35. % USER SETTINGS
  36. %% =========================
  37. subject_id = 'CYH_sb01'; % e.g., 'sub01'
  38. % Input files (edit these paths)
  39. qT1_path = '/path/to/qT1_map_new.nii';
  40. layer_path = '/path/to/rim_mask_layers_equidist.nii.gz'; % discrete LAYNII labels: 1..8
  41. roi_path = '/path/to/rh.S1_3b_in_qT1.nii.gz';
  42. % Number of cortical bins/layers
  43. n_layers = 8;
  44. % ROI dilation
  45. % Keep this identical to the original logic if you want to reproduce results.
  46. do_dilate = true;
  47. dilate_kernel = ones(3,3,3);
  48. % Flip control
  49. % In the original code, a double flip effectively resulted in no net flip.
  50. % To explicitly reproduce the original behavior, keep this false.
  51. % Set true only if you intentionally want reversed profile ordering.
  52. flip_profile = false;
  53. % Output directory
  54. out_dir = fullfile(pwd, 'out');
  55. %% =========================
  56. % CHECK INPUTS
  57. %% =========================
  58. assert(isfile(qT1_path), 'qT1 file not found: %s', qT1_path);
  59. assert(isfile(layer_path), 'Layer file not found: %s', layer_path);
  60. assert(isfile(roi_path), 'ROI file not found: %s', roi_path);
  61. if ~exist(out_dir, 'dir')
  62. mkdir(out_dir);
  63. end
  64. %% =========================
  65. % LOAD DATA
  66. %% =========================
  67. qT1 = double(niftiread(qT1_path));
  68. layer_map = double(niftiread(layer_path));
  69. roi = niftiread(roi_path) ~= 0;
  70. % Check dimensions
  71. assert(isequal(size(qT1), size(layer_map), size(roi)), ...
  72. 'qT1, layer map, and ROI must have identical dimensions.');
  73. % For discrete LAYNII layer maps, robustly enforce integer labels
  74. layer_lbl = round(layer_map);
  75. %% =========================
  76. % ROI DILATION
  77. %% =========================
  78. if do_dilate
  79. roi_dilated = imdilate(roi, dilate_kernel);
  80. else
  81. roi_dilated = roi;
  82. end
  83. % Restrict analysis to valid layers inside the dilated ROI
  84. layered_roi = (layer_lbl > 0) & roi_dilated;
  85. %% =========================
  86. % EXTRACT qT1 PROFILE
  87. %% =========================
  88. qT1_profile = nan(n_layers, 1);
  89. nvox_layer = zeros(n_layers, 1);
  90. for i = 1:n_layers
  91. mask = (layer_lbl == i) & layered_roi;
  92. nvox_layer(i) = nnz(mask);
  93. if nvox_layer(i) > 0
  94. qT1_profile(i) = mean(qT1(mask), 'omitnan');
  95. end
  96. end
  97. % Optional explicit flip
  98. if flip_profile
  99. qT1_profile = flipud(qT1_profile);
  100. nvox_layer = flipud(nvox_layer);
  101. end
  102. %% =========================
  103. % DERIVATIVES
  104. %% =========================
  105. % Match original style:
  106. % 1) first derivative from qT1_profile
  107. % 2) normalize by max absolute value
  108. % 3) second derivative from normalized first derivative
  109. dqT1 = gradient(qT1_profile);
  110. m = max(abs(dqT1));
  111. if isfinite(m) && m > 0
  112. dqT1_normalized = dqT1 / m;
  113. else
  114. dqT1_normalized = dqT1;
  115. end
  116. ddqT1 = gradient(dqT1_normalized);
  117. % Bin-center depth coordinates
  118. depth_centers = linspace(0.5/n_layers, 1 - 0.5/n_layers, n_layers);
  119. %% =========================
  120. % PLOT
  121. %% =========================
  122. fig = figure('Color', 'w', 'Position', [200 200 650 750]);
  123. subplot(3,1,1);
  124. plot(depth_centers, qT1_profile, 'k-o', 'LineWidth', 2);
  125. title('qT1 Profile', 'Interpreter', 'none');
  126. xlabel('Normalized depth (bin centers)');
  127. ylabel('qT1');
  128. grid on;
  129. subplot(3,1,2);
  130. plot(depth_centers, dqT1_normalized, 'b-o', 'LineWidth', 2);
  131. title('First Derivative (normalized)', 'Interpreter', 'none');
  132. xlabel('Normalized depth (bin centers)');
  133. ylabel('dqT1 (normalized)');
  134. grid on;
  135. subplot(3,1,3);
  136. plot(depth_centers, ddqT1, 'r-o', 'LineWidth', 2);
  137. title('Second Derivative', 'Interpreter', 'none');
  138. xlabel('Normalized depth (bin centers)');
  139. ylabel('ddqT1');
  140. grid on;
  141. sgtitle(sprintf('%s | voxels/layer: %s', ...
  142. subject_id, strjoin(string(nvox_layer'), ' ')), ...
  143. 'Interpreter', 'none');
  144. png_path = fullfile(out_dir, sprintf('%s_qT1profile.png', subject_id));
  145. saveas(fig, png_path);
  146. %% =========================
  147. % SAVE OUTPUT
  148. %% =========================
  149. out = struct();
  150. out.subject_id = subject_id;
  151. out.qT1_path = qT1_path;
  152. out.layer_path = layer_path;
  153. out.roi_path = roi_path;
  154. out.n_layers = n_layers;
  155. out.do_dilate = do_dilate;
  156. out.dilate_kernel = dilate_kernel;
  157. out.flip_profile = flip_profile;
  158. out.nvox_layer = nvox_layer(:);
  159. out.depth_centers = depth_centers(:);
  160. out.qT1_profile = qT1_profile(:);
  161. out.dqT1 = dqT1(:);
  162. out.dqT1_normalized = dqT1_normalized(:);
  163. out.ddqT1 = ddqT1(:);
  164. out.figure_png = png_path;
  165. mat_path = fullfile(out_dir, sprintf('%s_qT1profile.mat', subject_id));
  166. save(mat_path, 'out', '-v7.3');
  167. fprintf('\nSaved outputs:\n');
  168. fprintf(' %s\n', mat_path);
  169. fprintf(' %s\n\n', png_path);

extract_qT1_laminar_profile.m at commit 9586b39, under MIT · at the source

Overview

Authors: Dongho Kim1,2, SoHyun Han3, Seongyun Kim1, Seulgi Eun4, Min-Suk Kang1,2,5, Choong-Wan Woo1,2,6,7, Seong-Gi Kim1,2,6
  1. Center for Neuroscience Imaging Research, Institute for Basic Science,Suwon, South Korea
  2. Department of Brain Science and Engineering, Sungkyunkwan University,Suwon, South Korea
  3. Center for Bio-imaging and Translational Research, Korea Basic Science Institute,Cheongju, South Korea
  4. Division of KM Science Research, Korea Institute of Oriental Medicine (KIOM),Daejeon, South Korea
  5. Department of Psychology, Sungkyunkwan University,Seoul, South Korea
  6. Department of Biomedical Engineering, Sungkyunkwan University,Suwon, South Korea
  7. Department of Intelligent Precision Healthcare Convergence, Sungkyunkwan University,Suwon, South Korea
Journal: Nature communications, volume 17, issue 1, article 5163
Dates: received 27 December 2024; accepted 29 March 2026; published online 13 April 2026
Type: Research article · Language: English
License: CC BY-NC-ND
Identifiers: DOI 10.1038/s41467-026-71842-w · PMID 41974711 · PMCID PMC13249840 · OpenAlex W7154076634
Open access: gold, a free copy (OpenAlex)
Status: code verified
Categories: human (organism)
Methods: Connectivity, Statistics, Preprocessing, fMRI & imaging
Keywords: Sensory processing, Cognitive neuroscience
MeSH: Attention*, Somatosensory Cortex*, Adult, Brain Mapping, Female, Fingers, Humans, Magnetic Resonance Imaging, Male, Wrist, Young Adult (* major topic)
Topic: Transcranial Magnetic Stimulation Studies (Neurology, Neuroscience), according to OpenAlex
Funding: Institute for Basic Science, Korea,IBS-R015-D2
Citations: not cited yet (Europe PMC); 87 references in the paper

Abstract

The abstract is not reproduced here: the paper's license (CC BY-NC-ND) does not allow it. Read it in the paper, at the publisher or on Europe PMC.

Repository

Its files are read in the Code ↔ Paper reader above.

dhkim15/S1-laminar-attention-SEBOLD

License: MIT
State: the link answers, verified on 29 September 2026
Evidence: files inventoried
Commit: 9586b39c5c0c88ab964daeeb1adfc4f96d47acc2, 9 March 2026
Languages: MATLAB (3)
Size: 6 files, 3 scripts
Software Heritage: not archived
Found in: “Code availability”
Holds: README, license file
Not found: CITATION.cff, environment file, tests, continuous integration, documentation
Availability: 1 check, the latest on 29 September 2026: the link answers
  • 29 September 2026: the link answers
5 files

Code availability statement

The paper has a code availability statement. Its license (CC BY-NC-ND) does not allow reproducing it here; in short, from what the harvester recognized in it:

Read it in the paper: doi.org/10.1038/s41467-026-71842-w.

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;
  • 3 scripts, each with its path and the digest of its content;
  • no match between paragraphs and code yet;
  • 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 statement

The paper has a data availability statement. Its license (CC BY-NC-ND) does not allow reproducing it here; in short, from what the harvester recognized in it:

Read it in the paper: doi.org/10.1038/s41467-026-71842-w.

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

Recorded: type, language, journal, volume, issue, pages, dates, 7 authors, 2 keywords, 11 MeSH terms, 1 funder, 83 references.

Cite

This paper

Kim, D., Han, S., Kim, S., Eun, S., Kang, M.-S., Woo, C.-W., & Kim, S.-G. (2026). Layer-specific attentional modulation in the human primary somatosensory cortex. Nature communications, 17(1), 5163. https://doi.org/10.1038/s41467-026-71842-w

BibTeX

@article{kim2026layer,
author = {Kim, Dongho and Han, SoHyun and Kim, Seongyun and Eun, Seulgi and Kang, Min-Suk and Woo, Choong-Wan and Kim, Seong-Gi},
title = {{Layer-specific attentional modulation in the human primary somatosensory cortex}},
journal = {Nature communications},
year = {2026},
month = apr,
volume = {17},
number = {1},
pages = {5163},
publisher = {Nature Publishing Group},
issn = {2041-1723},
doi = {10.1038/s41467-026-71842-w},
url = {https://doi.org/10.1038/s41467-026-71842-w},
pmid = {41974711},
pmcid = {PMC13249840}
}

RIS

TY - JOUR
AU - Kim, Dongho
AU - Han, SoHyun
AU - Kim, Seongyun
AU - Eun, Seulgi
AU - Kang, Min-Suk
AU - Woo, Choong-Wan
AU - Kim, Seong-Gi
TI - Layer-specific attentional modulation in the human primary somatosensory cortex
T2 - Nature communications
J2 - Nat Commun
PY - 2026
DA - 2026/04/13
VL - 17
IS - 1
SP - 5163
SN - 2041-1723
PB - Nature Publishing Group
DO - 10.1038/s41467-026-71842-w
UR - https://doi.org/10.1038/s41467-026-71842-w
LA - en
ER -

CSL-JSON

{
"id": "10.1038/s41467-026-71842-w",
"type": "article-journal",
"title": "Layer-specific attentional modulation in the human primary somatosensory cortex",
"container-title": "Nature communications",
"author": [
{
"family": "Kim",
"given": "Dongho"
},
{
"family": "Han",
"given": "SoHyun"
},
{
"family": "Kim",
"given": "Seongyun"
},
{
"family": "Eun",
"given": "Seulgi"
},
{
"family": "Kang",
"given": "Min-Suk"
},
{
"family": "Woo",
"given": "Choong-Wan"
},
{
"family": "Kim",
"given": "Seong-Gi"
}
],
"container-title-short": "Nat Commun",
"volume": "17",
"issue": "1",
"page": "5163",
"DOI": "10.1038/s41467-026-71842-w",
"PMID": "41974711",
"PMCID": "PMC13249840",
"ISSN": "2041-1723",
"publisher": "Nature Publishing Group",
"URL": "https://doi.org/10.1038/s41467-026-71842-w",
"language": "en",
"issued": {
"date-parts": [
[
2026,
4,
13
]
]
}
}

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.1371/journal.pbio.3003707 [code]
Behavioral engagement facilitates auditory neuron responses beyond their receptive fields.
Journal: PLoS biology
In common: Image Processing Toolbox, Statistics and Machine Learning Toolbox, 9 references
[2] doi:10.7554/elife.108408 [code]
Frequency and laminar profile of feature-specific visual activity revealed by interleaved EEG-fMRI.
Journal: eLife
In common: Image Processing Toolbox, Statistics and Machine Learning Toolbox, 8 references
[3] doi:10.1038/s41467-026-73540-z [code]
Predictive acoustical processing in human cortical layers.
Journal: Nature communications
In common: Image Processing Toolbox, Statistics and Machine Learning Toolbox, 7 references
[4] doi:10.7554/elife.92805 [code]
Brain-wide mapping of layer-specific functional connectivity in the human cortex at 3T using draining-vein-suppressed fMRI.
Journal: eLife
In common: Image Processing Toolbox, Statistics and Machine Learning Toolbox, 5 references
[5] doi:10.1162/imag.a.1197 [code]
Blood volume-sensitive laminar fMRI with VASO in human hippocampus: Capabilities and biophysical challenges at clinical 7T scanners.
Journal: Imaging neuroscience (Cambridge, Mass.)
In common: Image Processing Toolbox, 6 references
[6] doi:10.1002/hbm.70629
Characterising the Diffusion Functional Signature of Negative BOLD With Interleaved TMS-fMRI in the Human Brain.
Journal: Human brain mapping
In common: 6 references
[7] doi:10.1038/s41467-026-71506-9 [code]
UltraFast Layer-Resolved Encoding (uFLARE) functional MRI deciphers bidirectional signaling from spontaneous activity.
Journal: Nature communications
In common: 6 references
[8] doi:10.1093/cercor/bhag040 [code]
BOLD response delays represent local cortical processing.
Journal: Cerebral cortex (New York, N.Y. : 1991)
In common: shadedErrorBar, Image Processing Toolbox, Statistics and Machine Learning Toolbox, 2 references
[9] doi:10.1162/imag.a.1212 [code]
Intracortical microstructure profiling: A cross-modal method for indexing cortical lamination.
Journal: Imaging neuroscience (Cambridge, Mass.)
In common: 5 references
[10] doi:10.1038/s41598-026-58377-2 [code]
A novel distortion-matched anatomical imaging sequence for high-fidelity functional mapping in submillimeter-resolution fMRI.
Journal: Scientific reports
In common: Image Processing Toolbox, 4 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.

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.