Midbrain somatostatin-expressing cells control pain-suppression during defensive states.
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 · 137 lines · 5.2 KB · MIT
- % getThermoVIDFzIntervals:
- % Detect freezing periods from thermographic videos (TESTO 885).
- % Code used in "Brainstem somatostatin-expressing cells promote analgesia during negative emotional states". Winke, et al. 2022.
- % [v0.1, Daniel Jercog 2022, see: github.com/djercog/TestoFreez]
- %
- % function [fzIntervals,tm,areaChange,areaMouse]=getThermoVIDFzIntervals(videoFullpath,ffmpegBinPath)
- % function [fzIntervals,tm,areaChange,areaMouse]=getThermoVIDFzIntervals(videoFullpath,ffmpegBinPath,immobilityThreshold,minFzDur,minNonFzMerge)
- %
- % Input:
- % videoFullpath: full path to thermographic video (e.g, videoFullpath='E:\Videos\WT_FCA_IR\24-CSP.wmv';)
- % ffmpegBinPath: Path to ffmpeg/bin instalation folder (e.g., ffmpegBinPath='E:\ffmpeg\bin';)
- % immobilityThreshold: Threshold for immobility detection (default immobilityThreshold=0.003;)
- % minFzDur: Minimum immobility period duration to be considered freezing (default minFzDur=0.5;)
- % minNonFzMerge: Minimum non-freezing period to be merged between consecutive freezing periods (default minNonFzMerge=0.1;)
- %
- % Output:
- % fzIntervals: Freezing intervals detected.
- % tm: Time
- % areaChange: % pixels changed between consecutive video image frames within the ROI defined.
- % areaMouse: mouse area detected in pixels.
- %
- % Requires:
- % - videoframets (https://www.mathworks.com/matlabcentral/fileexchange/61235-video-frame-time-stamps)
- % - ffmpeg (https://ffmpeg.org/download.html)
- function [fzIntervals,tm,areaChange,areaMouse]=getThermoVIDFzIntervals(videoFullpath,ffmpegBinPath,immobilityThreshold,minFzDur,minNonFzMerge)
- if nargin < 3
- immobilityThreshold = 0.003;
- minFzDur=0.5;
- minNonFzMerge=0.1;
- else
- if (nargin~=5)
- error('Wrong number of input arguments.')
- end
- end
- %check if ffmpeg exists (for vidoframerets0
- if exist(ffmpegBinPath)==0
- error('ffmpeg directory not found.')
- end
- tm=videoframets(ffmpegBinPath,videoFullpath); %get video frame timestamps based on ffmpeg
- %set HP roi
- vidObj = VideoReader(videoFullpath);
- vidFramesAux = read(vidObj,4500);
- fAux=figure('color','w');
- ax=subplot(1,1,1);hold on;
- title('Define HP area:','fontsize',12);
- roiHP=roipoly(vidFramesAux);
- roiHP=double(roiHP);
- roiHP(roiHP==0)=nan;
- close(fAux);
- %Load entire video
- display('Loading video....')
- vidFramesAux = read(vidObj);
- %Calculate %area change within ROI between binarized downsampled video consecutive frames
- display('Processing video....');
- clear areaChange areaMouse;
- for j=2:length(vidFramesAux)
- %obtain 2 consecutive video frames
- auxF1=roiHP.*double(vidFramesAux(:,:,3,j-1)); %process blue channel only
- auxF2=roiHP.*double(vidFramesAux(:,:,3,j)); %process blue channel only
- thresh=min(auxF1(:))+ graythresh(auxF1)*(max(auxF1(:))-min(auxF1(:))); %Otsu's thresholding
- auxF1(auxF1<=thresh)=0;auxF1(auxF1>thresh)=1;
- thresh=min(auxF2(:))+ graythresh(auxF2)*(max(auxF2(:))-min(auxF2(:))); %Otsu's thresholding
- auxF2(auxF2<=thresh)=0;auxF2(auxF2>thresh)=1;
- %invert scale: 1 on mouse;
- indTo1=find(auxF1==0);indTo0=find(auxF1==1);auxF1(indTo1)=1;auxF1(indTo0)=0;
- indTo1=find(auxF2==0);indTo0=find(auxF2==1);auxF2(indTo1)=1;auxF2(indTo0)=0;
- areaMouse(j-1)=(length(find(auxF1==1))+length(find(auxF2==1)))/2; %avg between the 2 frames
- areaChange(j-1)=length(find(auxF2-auxF1==1 | auxF2-auxF1==-1))/length(find(roiHP==1)); % %change relative to ROI
- end
- %detecting freezing
- tm=tm(2:end);
- fzAux=zeros(length(areaChange),1);
- fzAux(find(areaChange<immobilityThreshold))=1;
- endFzPer=find(diff(fzAux)==-1);
- begFzPer=find(diff(fzAux)==1)+1;
- if ~isempty(begFzPer) && ~isempty(endFzPer)
- if endFzPer(1)<begFzPer(1)
- begFzPer=[1;begFzPer];
- end
- if begFzPer(end)>endFzPer(end)
- endFzPer=[endFzPer;length(fzAux)];
- end
- fzOns=tm(begFzPer);
- fzOffs=tm(endFzPer);
- else
- fzOns=[];
- fzOffs=[];
- end
- %remove short nFZ periods if neighboring periods are fz periods
- indAux=find(fzOns(2:end)-fzOffs(1:end-1)<=minNonFzMerge);
- toRemove=[];
- for s=1:length(indAux)
- %if (fzOffs(indAux(s)-1)-fzOns(indAux(s)-1)>minFzDur && fzOffs(1+indAux(s))-fzOns(1+indAux(s))>minFzDur)
- if (fzOffs(1+indAux(s))-fzOns(1+indAux(s))>minNonFzMerge)
- toRemove=[toRemove,indAux(s)];
- end
- end
- fzOffs(toRemove)=[];
- fzOns(toRemove+1)=[];
- %remove shor fz
- indAux=find(fzOffs-fzOns<=minFzDur);
- fzOns(indAux)=[];
- fzOffs(indAux)=[];
- fzIntervals=[fzOns,fzOffs];
- verifyDet = input('Verify detection? Y/N [N]:','s');
- if strcmp(verifyDet,'Y')
- % Verify detection
- f = figure('color','w');
- ax(1)=subplot(5,1,5);hold on;
- plot(tm,areaChange,'k');
- axis tight;ylim([-0.005,0.02]);
- plot(fzIntervals,[0.01,0.01],'r','linewidth',2);
- ylabel('% Area Change');xlabel('Time (s)');
- set(gca,'tickdir','out');
- ax(2)=subplot(5,1,1:4,'fontsize',5);hold on;
- title('Verify detection...','fontsize',14);
- axis ij;
- set(gca,'xtick',[],'ytick',[],'xcolor','w','ycolor','w');
- for i=1:size(vidFramesAux,4)-1
- if ishandle(f)
- im=imagesc(vidFramesAux(:,:,:,i));
- p=plot(ax(1),[tm(i),tm(i)],[-0.005,0.02],'m','linewidth',1);
- pause(0.02);
- delete(im);
- delete(p);
- end
- end
- close(f);
- end
getThermoVIDFzIntervals.m at commit d68940d, under MIT · at the source
Overview
- Univ. Bordeaux, Neurocentre Magendie, Bordeaux, France
- INSERM, Neurocentre Magendie, Bordeaux, France
- Univ. Bordeaux, CNRS, Institute for Neurodegenerative Diseases, Bordeaux, France
- Université de Montpellier, Institut de génomique fonctionnelle (IGF), CNRS, Montpellier, France
- INM, Univ. Montpellier, Inserm, Montpellier, France
Abstract
In threatening situations, animals exhibit a broad range of behavioral and autonomic responses. As such, a crucial adaptive response is the inhibition of pain, which facilitates relevant defensive behaviors that promote survival. Whereas the structures and mechanisms involved in fear and pain behaviors are well documented, little is known about the precise neuronal mechanisms mediating the emotional regulation of endogenous pain-suppression. Here, we used a combination of behavioral, anatomical, optogenetic, and electrophysiological approaches to investigate, in male mice, the role of somatostatin-expressing cells in the ventrolateral periaqueductal gray matter (SST+ vlPAG cells) in the control of analgesia induced during defensive states. Our data indicate that optogenetic inhibition of SST+ vlPAG cells promotes analgesia irrespective of animal defensive state. In contrast, optogenetic activation of long-range SST+ vlPAG cells that project to the rostral ventromedial medulla (RVM) abolishes the analgesia mediated by fear behavior. Together, these results identify a novel circuit mechanism composed of long-range SST+ vlPAG cells projecting to the RVM that regulate analgesia elicited during defensive states.
Reproduced under the paper's license (CC BY), from the paper cited above.
Repository
Its files are read in the Code ↔ Paper reader above.
djercog/TestoFreez
d68940d92134eb61d42ea267541ada195c9f1cb2, 5 October 2026Availability: 1 check, the latest on 12 November 2026: the link answers
- 12 November 2026: the link answers
3 files
- getThermoVIDFzIntervals.
m , MATLAB, 137 lines - LICENSE, License, 21 lines
- README.md, Text, 16 lines
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;
- 1 script, 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
- doi:10.5061/
dryad.63xsj3vj3 , at Dryad; found in DataCite
Data availability
All data generated or analysed during this study, including the source data underlying every figure, have been deposited in the Dryad Digital Repository under DOI https://
The following dataset was generated:
Cyril H, Nanci W, Frank A, Daniel J, Coline R. 2026. Midbrain somatostatin-expressing cells control pain-suppression during defensive states. Dryad Digital Repository.
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, 12 November 2026: the first record
Recorded: type, language, journal, volume, pages, dates, 14 authors, 1 keyword, 12 MeSH terms, 3 funders, 40 references.
Cite
This paper
Winke, N., Aby, F., Jercog, D., Riffault, C., Bouali-Benazzouz, R., Viellard, J., Girard, D., Grivet, Z., Landry, M., Castell, L., Valjent, E., Valerio, S., Fossat, P., & Herry, C. (2026). Midbrain somatostatin-expressing cells control pain-suppression during defensive states. eLife, 14, RP106826. https://
BibTeX
@article{winke2026midbra
author = {Winke, Nanci and Aby, Frank and Jercog, Daniel and Riffault, Coline and Bouali-Benazzouz, Rabia and Viellard, Juliette and Girard, Delphine and Grivet, Zoe and Landry, Marc and Castell, Laia and Valjent, Emmanuel and Valerio, Stephane and Fossat, Pascal and Herry, Cyril},
title = {{Midbrain somatostatin-expressing cells control pain-suppression during defensive states}},
journal = {eLife},
year = {2026},
month = nov,
volume = {14},
pages = {RP106826},
publisher = {eLife Sciences Publications, Ltd},
issn = {2050-084X},
doi = {10.7554/
url = {https://
pmid = {43004867},
pmcid = {PMC13750795}
}
RIS
TY - JOUR
AU - Winke, Nanci
AU - Aby, Frank
AU - Jercog, Daniel
AU - Riffault, Coline
AU - Bouali-Benazzouz, Rabia
AU - Viellard, Juliette
AU - Girard, Delphine
AU - Grivet, Zoe
AU - Landry, Marc
AU - Castell, Laia
AU - Valjent, Emmanuel
AU - Valerio, Stephane
AU - Fossat, Pascal
AU - Herry, Cyril
TI - Midbrain somatostatin-expressing cells control pain-suppression during defensive states
T2 - eLife
J2 - eLife
PY - 2026
DA - 2026/
VL - 14
SP - RP106826
SN - 2050-084X
PB - eLife Sciences Publications, Ltd
DO - 10.7554/
UR - https://
LA - en
ER -
CSL-JSON
{
"id": "10.7554/
"type": "article-journal",
"title": "Midbrain somatostatin-expressing cells control pain-suppression during defensive states",
"container-title": "eLife",
"author": [
{
"family": "Winke",
"given": "Nanci"
},
{
"family": "Aby",
"given": "Frank"
},
{
"family": "Jercog",
"given": "Daniel"
},
{
"family": "Riffault",
"given": "Coline"
},
{
"family": "Bouali-Benazzouz",
"given": "Rabia"
},
{
"family": "Viellard",
"given": "Juliette"
},
{
"family": "Girard",
"given": "Delphine"
},
{
"family": "Grivet",
"given": "Zoe"
},
{
"family": "Landry",
"given": "Marc"
},
{
"family": "Castell",
"given": "Laia"
},
{
"family": "Valjent",
"given": "Emmanuel"
},
{
"family": "Valerio",
"given": "Stephane"
},
{
"family": "Fossat",
"given": "Pascal"
},
{
"family": "Herry",
"given": "Cyril"
}
],
"container-title-short":
"volume": "14",
"page": "RP106826",
"DOI": "10.7554/
"PMID": "43004867",
"PMCID": "PMC13750795",
"ISSN": "2050-084X",
"publisher": "eLife Sciences Publications, Ltd",
"URL": "https://
"language": "en",
"issued": {
"date-parts": [
[
2026,
11,
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.1016/j.isci.2023.108110
- Microglial P2X4 receptors are essential for spinal neurons hyperexcitability and tactile allodynia in male and female neuropathic mice.Journal: iScienceIn common: pain, mouse, 1 reference, author Pascal Fossat
- [2] doi:10.1038/s41586-026-10296-y [code]
- Deconstruction of a spino-brain-spinal cord circuit that drives chronic pain.Journal: NatureIn common: Image Processing Toolbox, pain, systems, mouse, 3 references
- [3] doi:10.1186/s12916-024-03634-2
- YTHDF1 in periaqueductal gray inhibitory neurons contributes to morphine withdrawal responses in mice.Journal: BMC medicineIn common: mouse, 4 references
- [4] doi:10.1038/s41467-023-35826-4
- Topographic representation of current and future threats in the mouse nociceptive amygdala.Journal: Nature communicationsIn common: pain, mouse, 4 references
- [5] doi:10.7554/elife.96724
- A septo-hypothalamic-medul
lary circuit directs stress-induced analgesia. Journal: eLifeIn common: pain, systems, mouse, 3 references - [6] doi:10.1038/s41586-024-07440-x [code]
- Distinct µ-opioid ensembles trigger positive and negative fentanyl reinforcement.Journal: NatureIn common: pain, mouse, author Emmanuel Valjent
- [7] doi:10.1038/s41467-025-61180-8
- Nicotine engages a VTA-NAc feedback loop to inhibit amygdala-projecting dopamine neurons and induce anxiety-like behaviors.Journal: Nature communicationsIn common: systems, mouse, author Emmanuel Valjent
- [8] doi:10.1002/adhm.202402132 [code]
- Dye-Based Fluorescent Organic Nanoparticles, New Promising Tools for Optogenetics.Journal: Advanced healthcare materialsIn common: systems, mouse, author Cyril Herry
- [9] doi:10.7554/elife.78689
- Targeted anatomical and functional identification of antinociceptive and pronociceptive serotonergic neurons that project to the spinal dorsal horn.Journal: eLifeIn common: pain, mouse, 3 references
- [10] doi:10.1038/s41467-023-42969-x
- CA3 hippocampal synaptic plasticity supports ripple physiology during memory consolidation.Journal: Nature communicationsIn common: mouse, author Cyril Herry
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, 1 script, 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:d5acec2f6d97b793…
Add the badge to the code's README
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 -->
[](https://openscicode.org/badge/doi/10.7554/elife.106826)
<!-- oscr-badge:end -->reStructuredText
.. oscr-badge:start
.. image:: https://openscicode.org/badge/doi/10.7554/elife.106826.svg
:target: https://openscicode.org/badge/doi/10.7554/elife.106826
:alt: OSCR
.. oscr-badge:endHTML
<!-- oscr-badge:start -->
<a href="https://openscicode.org/badge/doi/10.7554/elife.106826"><img src="https://openscicode.org/badge/doi/10.7554/elife.106826.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.
