Layer-specific attentional modulation in the human primary somatosensory cortex.
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
- % extract_qT1_laminar_profile.m
- %
- % Extract a laminar qT1 profile from a discrete LAYNII layer map (1..8)
- % within an ROI, while preserving the original analysis logic:
- % - optional ROI dilation
- % - layer-wise extraction using (layer == i)
- % - first derivative normalization
- % - second derivative computation
- %
- % This public-friendly version:
- % - removes hard-coded local paths
- % - saves outputs to ./out/
- % - keeps the original ROI dilation + layer==i logic unchanged
- %
- % Requirements:
- % - MATLAB
- % - Image Processing Toolbox (for imdilate)
- %
- % Important:
- % qT1, layer map, and ROI must be in the same voxel space and dimensions.
- %
- % Inputs to edit below:
- % - qT1_path
- % - layer_path
- % - roi_path
- % - subject_id
- %
- % Outputs:
- % ./out/<subject_id>_qT1profile.mat
- % ./out/<subject_id>_qT1profile.png
- clc;
- clear;
- close all;
- %% =========================
- % USER SETTINGS
- %% =========================
- subject_id = 'CYH_sb01'; % e.g., 'sub01'
- % Input files (edit these paths)
- qT1_path = '/path/to/qT1_map_new.nii';
- layer_path = '/path/to/rim_mask_layers_equidist.nii.gz'; % discrete LAYNII labels: 1..8
- roi_path = '/path/to/rh.S1_3b_in_qT1.nii.gz';
- % Number of cortical bins/layers
- n_layers = 8;
- % ROI dilation
- % Keep this identical to the original logic if you want to reproduce results.
- do_dilate = true;
- dilate_kernel = ones(3,3,3);
- % Flip control
- % In the original code, a double flip effectively resulted in no net flip.
- % To explicitly reproduce the original behavior, keep this false.
- % Set true only if you intentionally want reversed profile ordering.
- flip_profile = false;
- % Output directory
- out_dir = fullfile(pwd, 'out');
- %% =========================
- % CHECK INPUTS
- %% =========================
- assert(isfile(qT1_path), 'qT1 file not found: %s', qT1_path);
- assert(isfile(layer_path), 'Layer file not found: %s', layer_path);
- assert(isfile(roi_path), 'ROI file not found: %s', roi_path);
- if ~exist(out_dir, 'dir')
- mkdir(out_dir);
- end
- %% =========================
- % LOAD DATA
- %% =========================
- qT1 = double(niftiread(qT1_path));
- layer_map = double(niftiread(layer_path));
- roi = niftiread(roi_path) ~= 0;
- % Check dimensions
- assert(isequal(size(qT1), size(layer_map), size(roi)), ...
- 'qT1, layer map, and ROI must have identical dimensions.');
- % For discrete LAYNII layer maps, robustly enforce integer labels
- layer_lbl = round(layer_map);
- %% =========================
- % ROI DILATION
- %% =========================
- if do_dilate
- roi_dilated = imdilate(roi, dilate_kernel);
- else
- roi_dilated = roi;
- end
- % Restrict analysis to valid layers inside the dilated ROI
- layered_roi = (layer_lbl > 0) & roi_dilated;
- %% =========================
- % EXTRACT qT1 PROFILE
- %% =========================
- qT1_profile = nan(n_layers, 1);
- nvox_layer = zeros(n_layers, 1);
- for i = 1:n_layers
- mask = (layer_lbl == i) & layered_roi;
- nvox_layer(i) = nnz(mask);
- if nvox_layer(i) > 0
- qT1_profile(i) = mean(qT1(mask), 'omitnan');
- end
- end
- % Optional explicit flip
- if flip_profile
- qT1_profile = flipud(qT1_profile);
- nvox_layer = flipud(nvox_layer);
- end
- %% =========================
- % DERIVATIVES
- %% =========================
- % Match original style:
- % 1) first derivative from qT1_profile
- % 2) normalize by max absolute value
- % 3) second derivative from normalized first derivative
- dqT1 = gradient(qT1_profile);
- m = max(abs(dqT1));
- if isfinite(m) && m > 0
- dqT1_normalized = dqT1 / m;
- else
- dqT1_normalized = dqT1;
- end
- ddqT1 = gradient(dqT1_normalized);
- % Bin-center depth coordinates
- depth_centers = linspace(0.5/n_layers, 1 - 0.5/n_layers, n_layers);
- %% =========================
- % PLOT
- %% =========================
- fig = figure('Color', 'w', 'Position', [200 200 650 750]);
- subplot(3,1,1);
- plot(depth_centers, qT1_profile, 'k-o', 'LineWidth', 2);
- title('qT1 Profile', 'Interpreter', 'none');
- xlabel('Normalized depth (bin centers)');
- ylabel('qT1');
- grid on;
- subplot(3,1,2);
- plot(depth_centers, dqT1_normalized, 'b-o', 'LineWidth', 2);
- title('First Derivative (normalized)', 'Interpreter', 'none');
- xlabel('Normalized depth (bin centers)');
- ylabel('dqT1 (normalized)');
- grid on;
- subplot(3,1,3);
- plot(depth_centers, ddqT1, 'r-o', 'LineWidth', 2);
- title('Second Derivative', 'Interpreter', 'none');
- xlabel('Normalized depth (bin centers)');
- ylabel('ddqT1');
- grid on;
- sgtitle(sprintf('%s | voxels/layer: %s', ...
- subject_id, strjoin(string(nvox_layer'), ' ')), ...
- 'Interpreter', 'none');
- png_path = fullfile(out_dir, sprintf('%s_qT1profile.png', subject_id));
- saveas(fig, png_path);
- %% =========================
- % SAVE OUTPUT
- %% =========================
- out = struct();
- out.subject_id = subject_id;
- out.qT1_path = qT1_path;
- out.layer_path = layer_path;
- out.roi_path = roi_path;
- out.n_layers = n_layers;
- out.do_dilate = do_dilate;
- out.dilate_kernel = dilate_kernel;
- out.flip_profile = flip_profile;
- out.nvox_layer = nvox_layer(:);
- out.depth_centers = depth_centers(:);
- out.qT1_profile = qT1_profile(:);
- out.dqT1 = dqT1(:);
- out.dqT1_normalized = dqT1_normalized(:);
- out.ddqT1 = ddqT1(:);
- out.figure_png = png_path;
- mat_path = fullfile(out_dir, sprintf('%s_qT1profile.mat', subject_id));
- save(mat_path, 'out', '-v7.3');
- fprintf('\nSaved outputs:\n');
- fprintf(' %s\n', mat_path);
- fprintf(' %s\n\n', png_path);
extract_qT1_laminar_profile.m at commit 9586b39, under MIT · at the source
Overview
- Center for Neuroscience Imaging Research, Institute for Basic Science,Suwon, South Korea
- Department of Brain Science and Engineering, Sungkyunkwan University,Suwon, South Korea
- Center for Bio-imaging and Translational Research, Korea Basic Science Institute,Cheongju, South Korea
- Division of KM Science Research, Korea Institute of Oriental Medicine (KIOM),Daejeon, South Korea
- Department of Psychology, Sungkyunkwan University,Seoul, South Korea
- Department of Biomedical Engineering, Sungkyunkwan University,Suwon, South Korea
- Department of Intelligent Precision Healthcare Convergence, Sungkyunkwan University,Suwon, South Korea
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
9586b39c5c0c88ab964daeeb1adfc4f96d47acc2, 9 March 2026Availability: 1 check, the latest on 29 September 2026: the link answers
- 29 September 2026: the link answers
5 files
- scripts/
extract_qT1_laminar_prof , MATLAB, 203 linesile.m - scripts/
laminar_qT1_profile.m , MATLAB, 316 lines - scripts/
traveling_wave_phase_map , MATLAB, 217 linesping.m - LICENSE, License, 21 lines
- README.md, Text, 24 lines
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:
- it points to the authors' code: dhkim15/
S1-laminar-attention-SEB OLD
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
- figshare:27937923, at figshare; found in DataCite
- osf:2v6nb, at OSF; found in “Data availability”
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:
- it points to a dataset: OSF 2v6nb
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://
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/
url = {https://
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/
VL - 17
IS - 1
SP - 5163
SN - 2041-1723
PB - Nature Publishing Group
DO - 10.1038/
UR - https://
LA - en
ER -
CSL-JSON
{
"id": "10.1038/
"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":
"volume": "17",
"issue": "1",
"page": "5163",
"DOI": "10.1038/
"PMID": "41974711",
"PMCID": "PMC13249840",
"ISSN": "2041-1723",
"publisher": "Nature Publishing Group",
"URL": "https://
"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 biologyIn 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: eLifeIn 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 communicationsIn 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: eLifeIn 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 mappingIn 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 communicationsIn 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 reportsIn 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.
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, 3 scripts, and 0 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:492cad754caacbbd…
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
[, paste the snippet at the top, then “Commit changes…” and, to review it first, “Create a new branch and start a pull request”. You open the pull request; OSCR asks for no permission.
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.
