OSCR

Separable and integrated pleasantness coding for appetitive and aversive odors across olfactory and ventral prefrontal cortices.

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.

3 blocks of code here have a permanent identifier (oscr:b:…), listed with the matches below: citable for good, with a page of its own. Select a match and press Cite to copy it. What a block identifier is.

The 4 matches · 1 of them tie a paragraph to a whole file without given lines: a weak match, whose lines are not tinted
  1. [1] § Methods › Cross-decoding analyses ↔ common_functions/invnorm_reslice_masks.m, lines 1 to 129 · score 0.69 · MNI space, native spaces, inverse normalized · block oscr:b:0ZWV0KER1EF1N-Y · Report a mismatch
  2. [2] § Methods › Regions of interest (ROI) ↔ common_functions/invnorm_reslice_masks.m, lines 1 to 129 · score 0.64 · native space, inverse normalized, atlas, insula, masks, voxels · block oscr:b:0ZWV0KER1EF1N-Y · Report a mismatch
  3. [3] § Methods › Representational similarity analyses (RSA) ↔ common_functions/discontinued_scripts/ARC_binandRSAcomparision.m, lines 269 to 346 · score 0.55 · linear regression, neural activity, iterations, RSA, bins, correlation · block oscr:b:GAT7C7KXPSD14-J · Report a mismatch
  4. [4] § Methods › Basic decoding analyses ↔ common_functions/ARC_regress_nested.m, the whole file · a weak match · score 0.53 · Pearson correlation, cross validation, split, trained, accuracy, regression · block oscr:b:24JX8A65CSSH3-T · Report a mismatch

Paper

Loaded from Europe PMC by your browser; OSCR does not store it: doi.org · Europe PMC

The paper is loaded when this pane is shown.

The authors' code

MATLAB · 167 lines · 6.2 KB · MIT · 2 matches

  1. function out = invnorm_reslice_masks(maskDir, maskFiles, anatDir, varargin)
  2. % invnorm_reslice_masks
  3. % Inverse-normalize atlas/mask(s) to subject native space, then reslice to a
  4. % chosen reference image (e.g., anat or first functional).
  5. %
  6. % Inputs
  7. % maskDir : folder containing mask(s) defined in normalized/MNI space
  8. % maskFiles : char or cellstr of mask filenames (e.g., 'insula.nii' or {'insula.nii','DLPFC.nii'})
  9. % anatDir : subject's anatomical folder (contains y_*.nii, anatomical .nii)
  10. %
  11. % Name/Value options
  12. % 'AnatFilePattern' : cellstr patterns to find native anat (default {'s*.nii','means*.nii'})
  13. % 'DefFilePattern' : cellstr patterns to find forward def field y_*.nii (default {'y_*.nii','y_s*.nii','y_means*.nii'})
  14. % 'InvDefName' : inverse def filename to write (default 'y_inverse.nii')
  15. % 'DoMakeInverse' : true/false, make inverse if missing (default true)
  16. % 'RefImage' : full path to image used for reslicing (default: auto-pick in anatDir)
  17. % 'RefPattern' : patterns to find ref image if RefImage not given (default {'rf*.nii','s*.nii'})
  18. % 'BB' : bounding box for write (default [-78 -112 -85; 78 95 85])
  19. % 'Vox' : voxel size for write (default [1 1 1])
  20. % 'InterpWrite' : interpolation for write (0=nearest) (default 0; keeps masks binary-ish)
  21. % 'InterpReslice' : interpolation for reslice (default 0)
  22. % 'CopyWToAnat' : move w* masks to anatDir after write (default false)
  23. % 'ReslicePrefix' : prefix for resliced output (default 'r')
  24. %
  25. % Output (struct)
  26. % out.invDef : path to inverse deformation
  27. % out.wMasks : cellstr paths to inverse-normalized masks (w*)
  28. % out.rwMasks : cellstr paths to resliced masks (r w*)
  29. % out.refImage : path used for reslicing
  30. %
  31. % Requires SPM12 on MATLAB path.
  32. % --- defaults & parsing ---
  33. ip = inputParser;
  34. addParameter(ip,'AnatFilePattern', {'s*.nii','means*.nii'});
  35. addParameter(ip,'DefFilePattern', {'y_*.nii','y_s*.nii','y_means*.nii'});
  36. addParameter(ip,'InvDefName', 'y_inverse.nii');
  37. addParameter(ip,'DoMakeInverse', true);
  38. addParameter(ip,'RefImage', '');
  39. addParameter(ip,'RefPattern', {'rf*.nii','s*.nii'});
  40. addParameter(ip,'BB', [-78 -112 -85; 78 95 85]);
  41. addParameter(ip,'Vox', [1 1 1]);
  42. addParameter(ip,'InterpWrite', 0);
  43. addParameter(ip,'InterpReslice', 0);
  44. addParameter(ip,'CopyWToAnat', false);
  45. addParameter(ip,'ReslicePrefix', 'r');
  46. parse(ip, varargin{:});
  47. opt = ip.Results;
  48. if ischar(maskFiles), maskFiles = {maskFiles}; end
  49. % --- init SPM ---
  50. spm('defaults','fmri');
  51. try, spm_jobman('initcfg'); end
  52. % --- locate anat file & forward deformation ---
  53. anatFile = find_first(anatDir, opt.AnatFilePattern, true);
  54. defFile = find_first(anatDir, opt.DefFilePattern, true);
  55. % --- inverse deformation: create if missing ---
  56. invDef = fullfile(anatDir, opt.InvDefName);
  57. if ~exist(invDef,'file')
  58. if ~opt.DoMakeInverse
  59. error('Inverse deformation not found: %s', invDef);
  60. end
  61. matlabbatch = [];
  62. matlabbatch{1}.spm.util.defs.comp{1}.inv.comp{1}.def = {defFile};
  63. matlabbatch{1}.spm.util.defs.comp{1}.inv.space = {anatFile};
  64. matlabbatch{1}.spm.util.defs.out{1}.savedef.ofname = opt.InvDefName;
  65. matlabbatch{1}.spm.util.defs.out{1}.savedef.savedir.saveusr = {anatDir};
  66. spm_jobman('run', matlabbatch);
  67. end
  68. % --- apply inverse deformation to masks (write) ---
  69. resampleList = cellfun(@(f) fullfile(maskDir,f), maskFiles, 'uni', false);
  70. matlabbatch = [];
  71. matlabbatch{1}.spm.spatial.normalise.write.subj.def = {invDef};
  72. matlabbatch{1}.spm.spatial.normalise.write.subj.resample = resampleList(:);
  73. matlabbatch{1}.spm.spatial.normalise.write.woptions.bb = opt.BB;
  74. matlabbatch{1}.spm.spatial.normalise.write.woptions.vox = opt.Vox;
  75. matlabbatch{1}.spm.spatial.normalise.write.woptions.interp = opt.InterpWrite;
  76. spm_jobman('run', matlabbatch);
  77. % paths to written masks (prefix 'w')
  78. wMasks = cellfun(@(f) fullfile(maskDir, ['w' strip_gz(f)]), maskFiles, 'uni', false);
  79. % optionally move w* to anatDir
  80. if opt.CopyWToAnat
  81. for i=1:numel(wMasks)
  82. tgt = fullfile(anatDir, get_filename(wMasks{i}));
  83. if ~strcmp(wMasks{i}, tgt)
  84. if exist(tgt,'file'), delete(tgt); end
  85. movefile(wMasks{i}, tgt);
  86. wMasks{i} = tgt;
  87. end
  88. end
  89. end
  90. % --- pick reslice reference ---
  91. if ~isempty(opt.RefImage)
  92. refImage = opt.RefImage;
  93. else
  94. refImage = find_first(anatDir, opt.RefPattern, true);
  95. end
  96. refCell = {sprintf('%s,1', refImage)};
  97. % --- reslice to reference (coreg write) ---
  98. matlabbatch = [];
  99. matlabbatch{1}.spm.spatial.coreg.write.ref = refCell;
  100. matlabbatch{1}.spm.spatial.coreg.write.source = wMasks(:);
  101. matlabbatch{1}.spm.spatial.coreg.write.roptions.interp = opt.InterpReslice;
  102. matlabbatch{1}.spm.spatial.coreg.write.roptions.wrap = [0 0 0];
  103. matlabbatch{1}.spm.spatial.coreg.write.roptions.mask = 0;
  104. matlabbatch{1}.spm.spatial.coreg.write.roptions.prefix = opt.ReslicePrefix;
  105. spm_jobman('run', matlabbatch);
  106. % resliced outputs have prefix 'r' (default), applied to the *current* mask paths
  107. rwMasks = prepend_prefix(wMasks, opt.ReslicePrefix);
  108. % --- (optional) quick orientation sanity check ---
  109. % v = spm_vol([{refImage}; rwMasks(:)]);
  110. % spm_check_orientations([v{:}]);
  111. % --- out ---
  112. out = struct('invDef',invDef, 'wMasks',{wMasks}, 'rwMasks',{rwMasks}, 'refImage',refImage);
  113. end
  114. % ===== helpers =====
  115. function f = find_first(dirpath, patterns, mustExist)
  116. if ischar(patterns), patterns = {patterns}; end
  117. f = '';
  118. for i=1:numel(patterns)
  119. dd = dir(fullfile(dirpath, patterns{i}));
  120. if ~isempty(dd)
  121. f = fullfile(dirpath, dd(1).name);
  122. break;
  123. end
  124. end
  125. if mustExist && isempty(f)
  126. error('File not found in %s for patterns: %s', dirpath, strjoin(patterns, ', '));
  127. end
  128. end
  129. function s = strip_gz(fname)
  130. % remove trailing .gz if present
  131. [p,n,e] = fileparts(fname);
  132. if strcmpi(e,'.gz')
  133. [~,n2,e2] = fileparts(n);
  134. s = [n2 e2];
  135. else
  136. s = [n e];
  137. end
  138. end
  139. function n = get_filename(pth)
  140. [~,n,ext] = fileparts(pth);
  141. n = [n ext];
  142. end
  143. function out = prepend_prefix(paths, prefix)
  144. out = cell(size(paths));
  145. for i=1:numel(paths)
  146. [p,n,e] = fileparts(paths{i});
  147. out{i} = fullfile(p, [prefix n e]);
  148. end
  149. end

invnorm_reslice_masks.m at commit 5fd5bf9, under MIT · at the source

Overview

  1. Department of Neurology, Feinberg School of Medicine, Northwestern University,Chicago, IL USA
  2. Present Address: Department of Psychological and Brain Sciences, Dartmouth College,Hanover, NH USA
  3. National Institute on Drug Abuse Intramural Research Program,Baltimore, MD USA
Institutions: Northwestern University (United States); Dartmouth College (United States); National Institute on Drug Abuse (United States)
Journal: Nature communications, volume 17, issue 1, article 6732
Dates: received 6 January 2025; accepted 22 April 2026; published online 22 May 2026
Type: Research article · Language: English
License: CC BY
Identifiers: DOI 10.1038/s41467-026-73001-7 · PMID 42173851 · PMCID PMC13385377 · OpenAlex W7162133109
Open access: gold, a free copy (OpenAlex)
Status: code verified (how the code is found and verified)
Categories: human (organism), cognitive (subfield)
Methods: Statistics, Machine learning, Preprocessing, Connectivity, fMRI & imaging
Keywords: Olfactory cortex, Cognitive neuroscience
MeSH: Odorants*, Olfactory Cortex*, Olfactory Perception*, Prefrontal Cortex*, Smell*, Amygdala, Brain Mapping, Female, Humans, Magnetic Resonance Imaging, Male, Piriform Cortex (* major topic)
Topic: Olfactory and Sensory Function Studies (Sensory Systems, Neuroscience), according to OpenAlex
Funding: national institute on drug abuse (ZIA DA000642)
Citations: not cited yet (Europe PMC); 68 references in the paper

Abstract

Odor pleasantness is a key driver of approach and avoidance behaviors, raising the question of how pleasantness is represented in olfactory brain areas. To address this question, here we analyzed an existing dataset consisting of perceptual and fMRI responses to 160 odors from three individual participants. We find that piriform cortex, amygdala, orbitofrontal cortex, and ventromedial prefrontal cortex encode the pleasantness of appetitive and aversive odors. However, whereas these pleasantness representations are separable for appetitive and aversive odors in piriform cortex and amygdala, ventral prefrontal cortex (especially area 11) combines information from appetitive and aversive odors and forms a continuous representation of odor salience. These results suggest that distinct pleasantness codes for appetitive and aversive odors in olfactory cortices are integrated into a continuous representation in ventral prefrontal cortices.

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.

viveksgr/ARC

License: MIT
State: the link answers, verified on 28 September 2026
Evidence: files inventoried
Commit: 5fd5bf96845fa46144e5d972a404e5b5cfb3406f, 19 March 2026
Languages: MATLAB (147), C++ (1)
Size: 207 files, 148 scripts
Software Heritage: not archived
Found in: “Code availability”
Holds: README, license file
Not found: CITATION.cff, environment file, tests, continuous integration, documentation
Tools: Statistics and Machine Learning Toolbox (63 files), SPM (27 files), GLMsingle (3 files), Signal Processing Toolbox (1 file)
Availability: 1 check, the latest on 28 September 2026: the link answers
  • 28 September 2026: the link answers
150 files

Zenodo 19119376

License: MIT
State: the link answers, verified on 28 September 2026
Evidence: files inventoried
Size: 1 file
Software Heritage: not checked
Found in: “Code availability”
Not found: README, license file, CITATION.cff, environment file, tests, continuous integration, documentation
Availability: 1 check, the latest on 28 September 2026: the link answers (HTTP 200)
  • 28 September 2026: the link answers (HTTP 200)
At the source:

Zenodo 19119377

License: MIT
State: the link answers, verified on 28 September 2026
Evidence: files inventoried
Size: 1 file
Software Heritage: not checked
Found in: the references
Not found: README, license file, CITATION.cff, environment file, tests, continuous integration, documentation
Availability: 1 check, the latest on 28 September 2026: the link answers (HTTP 200)
  • 28 September 2026: the link answers (HTTP 200)
At the source:

Code availability

All analyses were performed using custom scripts in MATLAB 2023b and the LibSVM package66 for decoding. Other software packages used in the study were SPM1267, GLMSingle61,62, and Breathmetrics toolbox68. Code for preprocessing and reproducing the results presented in this manuscript is available at https://github.com/viveksgr/ARC and archived on Zenodo 10.5281/zenodo.1911937665.

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

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:

  • 3 repositories of the authors' code, each at its verified commit, with its license and how the link was found in the paper;
  • 148 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

Dataset to reproduce all major findings of the study is available without restriction at https://github.com/viveksgr/ARC and archived on Zenodo 10.5281/zenodo.1911937665. Analyses presented in this manuscript are based on previously published dataset 10.5281/zenodo.763672263. The access request to the raw dataset can be submitted at Zenodo and is subject to a data-use agreement that restricts use to research purposes, prohibits re-identification and redistribution, and requires citation of the associated Zenodo DOI and publication. The timeframe for response to requests is approximately 10 business days.

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

Recorded: type, language, journal, volume, issue, pages, dates, 3 authors, 2 keywords, 12 MeSH terms, 1 funder, 66 references.

Cite

This paper

Sagar, V., Zelano, C. M., & Kahnt, T. (2026). Separable and integrated pleasantness coding for appetitive and aversive odors across olfactory and ventral prefrontal cortices. Nature communications, 17(1), 6732. https://doi.org/10.1038/s41467-026-73001-7

BibTeX

@article{sagar2026separable,
author = {Sagar, Vivek and Zelano, Christina M. and Kahnt, Thorsten},
title = {{Separable and integrated pleasantness coding for appetitive and aversive odors across olfactory and ventral prefrontal cortices}},
journal = {Nature communications},
year = {2026},
month = may,
volume = {17},
number = {1},
pages = {6732},
publisher = {Nature Portfolio},
issn = {2041-1723},
doi = {10.1038/s41467-026-73001-7},
url = {https://doi.org/10.1038/s41467-026-73001-7},
pmid = {42173851},
pmcid = {PMC13385377}
}

RIS

TY - JOUR
AU - Sagar, Vivek
AU - Zelano, Christina M.
AU - Kahnt, Thorsten
TI - Separable and integrated pleasantness coding for appetitive and aversive odors across olfactory and ventral prefrontal cortices
T2 - Nature communications
J2 - Nat Commun
PY - 2026
DA - 2026/05/22
VL - 17
IS - 1
SP - 6732
SN - 2041-1723
PB - Nature Portfolio
DO - 10.1038/s41467-026-73001-7
UR - https://doi.org/10.1038/s41467-026-73001-7
LA - en
ER -

CSL-JSON

{
"id": "10.1038/s41467-026-73001-7",
"type": "article-journal",
"title": "Separable and integrated pleasantness coding for appetitive and aversive odors across olfactory and ventral prefrontal cortices",
"container-title": "Nature communications",
"author": [
{
"family": "Sagar",
"given": "Vivek"
},
{
"family": "Zelano",
"given": "Christina M."
},
{
"family": "Kahnt",
"given": "Thorsten"
}
],
"container-title-short": "Nat Commun",
"volume": "17",
"issue": "1",
"page": "6732",
"DOI": "10.1038/s41467-026-73001-7",
"PMID": "42173851",
"PMCID": "PMC13385377",
"ISSN": "2041-1723",
"publisher": "Nature Portfolio",
"URL": "https://doi.org/10.1038/s41467-026-73001-7",
"language": "en",
"issued": {
"date-parts": [
[
2026,
5,
22
]
]
}
}

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.1126/sciadv.aee1002 [code]
Theta oscillations are an organizational unit of odor processing in the olfactory bulb.
Journal: Science advances
In common: Signal Processing Toolbox, Statistics and Machine Learning Toolbox, 2 authors
[2] doi:10.1038/s41586-024-08016-5 [code]
Single-neuron representations of odours in the human brain.
Journal: Nature
In common: Statistics and Machine Learning Toolbox, cognitive, 7 references
[3] doi:10.1371/journal.pbio.3002849 [code]
The human olfactory bulb communicates perceived odor valence to the piriform cortex in the gamma band and receives a refined representation back in the beta band.
Journal: PLoS biology
In common: Statistics and Machine Learning Toolbox, 7 references
[4] doi:10.1073/pnas.2101209118 [code]
The human olfactory bulb processes odor valence representation and cues motor avoidance behavior.
Journal: Proceedings of the National Academy of Sciences of the United States of America
In common: Signal Processing Toolbox, Statistics and Machine Learning Toolbox, cognitive, 6 references
[5] doi:10.1073/pnas.2114966119 [code]
Spatiotemporal dynamics of odor representations in the human brain revealed by EEG decoding.
Journal: Proceedings of the National Academy of Sciences of the United States of America
In common: cognitive, 7 references
[6] doi:10.1371/journal.pbio.3003829 [code]
Identity-specific reward expectations in orbitofrontal cortex guide goal-directed choices.
Journal: PLoS biology
In common: Statistics and Machine Learning Toolbox, cognitive, 3 references, author Thorsten Kahnt
[7] doi:10.1073/pnas.2310433121 [code]
Brain representations of affective valence and intensity in sustained pleasure and pain.
Journal: Proceedings of the National Academy of Sciences of the United States of America
In common: SPM, Signal Processing Toolbox, Statistics and Machine Learning Toolbox, 4 references
[8] doi:10.1126/sciadv.adp0453
The human social cognitive network contains multiple regions within the amygdala.
Journal: Science advances
In common: cognitive, 2 references, author Christina Zelano
[9] doi:10.1038/s41467-024-45880-1 [code]
Midbrain signaling of identity prediction errors depends on orbitofrontal cortex networks.
Journal: Nature communications
In common: SPM, Statistics and Machine Learning Toolbox, cognitive, 1 reference, author Thorsten Kahnt
[10] doi:10.1038/s41467-026-69345-9 [code]
A 7T fMRI dataset of synthetic images for out-of-distribution modeling of vision.
Journal: Nature communications
In common: GLMsingle, SPM, Statistics and Machine Learning Toolbox, 3 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.

Add the badge to the code's README

OSCR: the badge of this paper

If you are an author or a maintainer of this paper's code, you can add this badge. It says what OSCR knows of the paper (its code, its validated tracing map) and links the code to this page. Paste one of these snippets under the README's title. Keep the two marks around it, so that the badge can be replaced in place and is never added twice. OSCR changes nothing in your repository.

Markdown
<!-- oscr-badge:start -->
[![OSCR](https://openscicode.org/badge/doi/10.1038/s41467-026-73001-7.svg)](https://openscicode.org/badge/doi/10.1038/s41467-026-73001-7)
<!-- oscr-badge:end -->
reStructuredText
.. oscr-badge:start

.. image:: https://openscicode.org/badge/doi/10.1038/s41467-026-73001-7.svg
   :target: https://openscicode.org/badge/doi/10.1038/s41467-026-73001-7
   :alt: OSCR

.. oscr-badge:end
HTML
<!-- oscr-badge:start -->
<a href="https://openscicode.org/badge/doi/10.1038/s41467-026-73001-7"><img src="https://openscicode.org/badge/doi/10.1038/s41467-026-73001-7.svg" alt="OSCR"></a>
<!-- oscr-badge:end -->

On GitHub, open the README, choose Edit (the pencil), paste the snippet under the title, then "Commit changes".

If you choose to, you can have the badge kept up to date for you, with oscr badge --write from the command line or with the GitHub Action in your repository's workflows. Every other form and option (a card, AsciiDoc, LaTeX, shields.io) is on the badge 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: code errors and mismatches between the code and the paper about this paper and its code, from readers and its authors, beside the paper and its tracing map.

Report a mismatch between the code and the paper · Report a code error (signed in)

Reproductions: reports from readers who ran the authors' code and did not get the paper's result, what they ran, with which environment, commit and data.

Report a reproduction failure (signed in)

Versions of its code: the releases of its code tied to a version of this paper (the preprint, the accepted manuscript, the version of record…), each with the tracing map versioned with it.

Activity: what happens around this paper: new versions of its record, its map's validation, discussions and reproductions. It opens with sign-in.