OSCR

Protocol for longitudinal two-photon calcium imaging and holographic optogenetic manipulation to investigate memory in mice.

Code ↔ Paper

2 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.

2 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 2 matches · 1 of them tie a paragraph to a whole file without given lines: a weak match, whose lines are not tinted
  1. [1] § Step-by-step method details › Imaging data processing pipeline ↔ CalciumDataProcessing/Preprocessing/MotionCorrection/DriftCorrection.m, lines 85 to 120 · score 0.59 · motion correction, imaging stacks, raw · block oscr:b:YQQK3WZFNTEY8-T · Report a mismatch
  2. [2] § Before you begin ↔ BehavioralDataProcessing/FigS1E_SimulationTtestCpr.m, the whole file · a weak match · score 0.55 · Remote memory, memory retrieved, behaviorally, manipulation · block oscr:b:G1GMXH91J242W-B · 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 · 120 lines · 4.1 KB · GPL-3.0 · 1 match

  1. clc; clear;
  2. addpath("E:\Data Analysis\2P Imaging\Programs\Fiji.app\scripts");
  3. addpath('D:\Git\FindUSN\CalciumDataProcessing\Preprocessing\MotionCorrection');
  4. % Select the root folder to process
  5. rootFolder = uigetdir(pwd, 'Select Root Folder to Process');
  6. if rootFolder == 0
  7. error('Folder selection canceled.');
  8. end
  9. fprintf('Selected folder: %s\n', rootFolder);
  10. % Start MIJ once
  11. Miji(false);
  12. % Use a queue to hold folders to process (start with root)
  13. foldersToProcess = {rootFolder};
  14. processedFolders = {}; % To avoid repeated processing if needed
  15. while ~isempty(foldersToProcess)
  16. currentFolder = foldersToProcess{1};
  17. foldersToProcess(1) = []; % Dequeue
  18. % Check if folder contains any .raw files
  19. rawFiles = dir(fullfile(currentFolder, '*.raw'));
  20. hasRaw = ~isempty(rawFiles);
  21. % Check if folder contains Image.tif (skip if yes)
  22. tifFiles = dir(fullfile(currentFolder, 'Image.tif'));
  23. hasTif = ~isempty(tifFiles);
  24. if hasRaw && ~hasTif
  25. fprintf('Processing folder: %s\n', currentFolder);
  26. % Use the first .raw file found
  27. rawFileName = rawFiles(1).name;
  28. rawFilePath = fullfile(currentFolder, rawFileName);
  29. % Open raw file in MIJ
  30. openRawInMIJ(rawFilePath);
  31. % Get reference frame (first frame)
  32. img = uint8(MIJ.getCurrentImage);
  33. ref = img(:,:,1);
  34. % Save Reference.tif in current folder
  35. imwrite(ref, fullfile(currentFolder, 'Reference.tif'));
  36. % Load Reference.tif back for registration
  37. imref = mijread(fullfile(currentFolder, 'Reference.tif'));
  38. % Perform motion correction and processing
  39. performMotionCorrection(rawFilePath, currentFolder);
  40. % Clear variables before next iteration
  41. clear img ref imref;
  42. end
  43. % Enqueue subfolders to process
  44. subItems = dir(currentFolder);
  45. % Remove '.' and '..' and files (keep folders only)
  46. subFolders = subItems([subItems.isdir] & ~ismember({subItems.name}, {'.','..'}));
  47. for i = 1:length(subFolders)
  48. foldersToProcess{end+1} = fullfile(currentFolder, subFolders(i).name);
  49. end
  50. end
  51. % Exit MIJ once after all processing
  52. MIJ.exit;
  53. disp('All folders processed.');
  54. %% --- Subfunctions ---
  55. function openRawInMIJ(rawPath)
  56. % Opens raw file in MIJ with fixed parameters (modify if needed)
  57. [folder, fileName, ext] = fileparts(rawPath);
  58. fprintf('Opening raw file in MIJ: %s\n', rawPath);
  59. MIJ.run('Raw...', ['open=', fileName, ext, ' image=[16-bit Unsigned] width=512 height=512 offset=0 number=2800 gap=0 little-endian']);
  60. MIJ.run('Size...', 'width=256 height=256 depth=2800 constrain average interpolation=None');
  61. MIJ.run('8-bit');
  62. end
  63. function performMotionCorrection(rawFilePath, currentFolder)
  64. % Perform motion correction steps in MIJ
  65. [~, rawFileName, ext] = fileparts(rawFilePath);
  66. % Open raw file again for registration
  67. MIJ.run('Raw...', ['open=', rawFileName, ext, ' image=[16-bit Unsigned] width=512 height=512 offset=0 number=2800 gap=0 little-endian']);
  68. MIJ.run('Size...', 'width=256 height=256 depth=2800 constrain average interpolation=None');
  69. MIJ.run('8-bit');
  70. % Concatenate all open images
  71. MIJ.run('Concatenate...', 'all_open title=[Corrected]');
  72. % Run StackReg rigid body registration
  73. MIJ.run('StackReg Ming', 'transformation=[Rigid Body]');
  74. % Get corrected image stack
  75. temp = uint8(MIJ.getCurrentImage);
  76. % Max intensity projection
  77. MIJ.run('Z Project...', 'projection=[Max Intensity]');
  78. AVG = uint8(MIJ.getCurrentImage);
  79. % Close all open images in MIJ
  80. MIJ.run('Close All');
  81. % Save processed images in current folder
  82. IMG = temp(:,:,2:end); % skip first image (reference)
  83. imwrite(IMG(:,:,1), fullfile(currentFolder, 'Image.tif'));
  84. for k = 2:size(IMG,3)
  85. imwrite(IMG(:,:,k), fullfile(currentFolder, 'Image.tif'), 'WriteMode', 'append');
  86. end
  87. imwrite(AVG, fullfile(currentFolder, 'Average.tif'));
  88. fprintf('Motion correction done for folder: %s\n', currentFolder);
  89. end

DriftCorrection.m at commit 43b3ef0, under GPL-3.0 · at the source

Overview

Authors: Huaiqin Guo1, He Yang1, Feng Su2, Yuzhi Zhu1, Qingyi Tang1, Rui Cao3, Qiao Wang3, Siyi Tong1, Shaoli Wang1, Chen Zhang4,5,6, Wei Lu1,7,8
  1. Department of Neurosurgery, Huashan Hospital, Institute for Translational Brain Research, State Key Laboratory of Brain Function and Disorders, MOE Frontiers Center for Brain Science, Fudan University, Shanghai, China
  2. National Biomedical Imaging Center, College of Future Technology, Peking University, Beijing, China
  3. School of Information Science and Engineering and Yau Shing-Tung Center, Southeast University, Nanjing 210096, China
  4. School of Basic Medical Sciences, Laboratory of Organ Synergy and Intelligent Regenerative Manufacturing, Capital Medical University, Beijing 100069, China
  5. College of Basic Medicine, Inner Mongolia Medical University, Hohhot 010110, China
  6. State Key Laboratory of Translational Medicine and Innovative Drug Development, Nanjing, Jiangsu 210000, China
  7. MOE Innovative Center for New Drug Development of Immune Inflammatory Diseases, Fudan University, Shanghai, China
  8. MOE Key Laboratory of Developmental Genes and Human Disease, School of Life Science and Technology, Southeast University, Nanjing, Jiangsu Province 210096, China
Journal: STAR protocols, volume 7, issue 3, article 104678
Dates: published online 2 July 2026; in print July 2026
Type: Research article · Language: English
License: CC BY-NC
Identifiers: DOI 10.1016/j.xpro.2026.104678 · PMID 42391006 · PMCID PMC13352386 · OpenAlex W7167031753
Open access: gold, a free copy (OpenAlex)
Status: code verified (how the code is found and verified)
Categories: histology / microscopy (modality), optical imaging (calcium, voltage, 2-photon) (modality), mouse (organism)
Methods: fMRI & imaging, Single-unit activity, calcium imaging, Physiology & signal measures
Keywords: Microscopy, Cognitive Neuroscience, Behavior
Topic: Memory and Neural Mechanisms (Cognitive Neuroscience, Neuroscience), according to OpenAlex
Funding: Brain-like Intelligence Technology; National Science and Technology Major Project (2021ZD0203502); National Natural Science Foundation of China (T2394531, 32200835); Ministry of Science and Technology of the People’s Republic of China (2021YFA1101302); China Postdoctoral Science Foundation (2021M700847, 2024T170168)
Citations: not cited yet (Europe PMC); 22 references in the paper
Research resources: MATLAB R2021b RRID:SCR_001622, GraphPad Prism 9.3.0 RRID:SCR_002798, ImageJ 1.47v RRID:SCR_003070, pClamp10.1 RRID:SCR_01132

Abstract

Here, we present a protocol for longitudinal two-photon calcium imaging and holographic optogenetic manipulation to investigate memory in mice. We describe chronic cranial window implantation, stereotaxic viral delivery, and head-fixed contextual fear conditioning synchronized with imaging acquisition and optical stimulation of identified neurons. We further detail procedures for image data processing pipelines for cross-session registration and longitudinal tracking of the same neuronal population. This protocol enables simultaneous neuronal activity recording, behavioral monitoring, and causal interrogation of neuronal ensembles.

For complete details on the use and execution of this protocol, please refer to Wang et al.1

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

Repositories

Its files are read in the Code ↔ Paper reader above, with 2 matches between paragraphs and lines of code.

Zenodo 16830880

License: GPL-3.0
State: the link answers, verified on 27 September 2026
Evidence: files inventoried
Size: 1 file
Software Heritage: not checked
Found in: “Data and code availability”
Not found: README, license file, CITATION.cff, environment file, tests, continuous integration, documentation
Tools: NumPy (24 files), Matplotlib (6 files), SciPy (5 files), Statistics and Machine Learning Toolbox (4 files), seaborn (4 files), pandas (2 files), PyTorch (2 files), Parallel Computing Toolbox (1 file)
Availability: 1 check, the latest on 27 September 2026: the link answers (HTTP 200)
  • 27 September 2026: the link answers (HTTP 200)
114 files

ariadneunsworth/findusn

License: GPL-3.0
State: the link answers, verified on 27 September 2026
Evidence: files inventoried
Commit: 43b3ef039fb1b34c373d2799671ffbbec3546602, 13 August 2025
Languages: MATLAB (73), Python (36), Jupyter (3)
Size: 163 files, 112 scripts
Software Heritage: not archived
Found in: the Zenodo archive record
Holds: README, license file, environment (CalciumDataProcessing/Preprocessing/SpikeInference/Deconvolution/requirements.txt, CalciumDataProcessing/Preprocessing/SpikeInference/DeepSpike/requirements.txt), 13 notebooks
Not found: CITATION.cff, tests, continuous integration, documentation
Tools: NumPy (24 files), Matplotlib (6 files), SciPy (5 files), Statistics and Machine Learning Toolbox (4 files), seaborn (4 files), pandas (2 files), PyTorch (2 files), Parallel Computing Toolbox (1 file)
Availability: 1 check, the latest on 27 September 2026: the link answers
  • 27 September 2026: the link answers
114 files

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:

  • 2 repositories of the authors' code, each at its verified commit, with its license and how the link was found in the paper;
  • 224 scripts, each with its path and the digest of its content;
  • 2 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

No dataset and no data link were found in the paper.

Data and code availability

• All data necessary to understand and assess the conclusions of the manuscript are presented in the main text and the supplementary materials. Raw calcium data will be shared by the lead contact upon request. • All original code has been deposited at Zenodo (https://doi.org/10.5281/zenodo.16830880) and is publicly available as of the date of publication. • Any additional information required to reanalyze the data reported in this paper is available from the lead contact upon request.

Reproduced under the paper's license (CC BY-NC), 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, 11 authors, 3 keywords, 5 funders, 22 references, 4 RRIDs.

Cite

This paper

Guo, H., Yang, H., Su, F., Zhu, Y., Tang, Q., Cao, R., Wang, Q., Tong, S., Wang, S., Zhang, C., & Lu, W. (2026). Protocol for longitudinal two-photon calcium imaging and holographic optogenetic manipulation to investigate memory in mice. STAR protocols, 7(3), 104678. https://doi.org/10.1016/j.xpro.2026.104678

BibTeX

@article{guo2026protocol,
author = {Guo, Huaiqin and Yang, He and Su, Feng and Zhu, Yuzhi and Tang, Qingyi and Cao, Rui and Wang, Qiao and Tong, Siyi and Wang, Shaoli and Zhang, Chen and Lu, Wei},
title = {{Protocol for longitudinal two-photon calcium imaging and holographic optogenetic manipulation to investigate memory in mice}},
journal = {STAR protocols},
year = {2026},
month = jul,
volume = {7},
number = {3},
pages = {104678},
publisher = {Elsevier},
issn = {2666-1667},
doi = {10.1016/j.xpro.2026.104678},
url = {https://doi.org/10.1016/j.xpro.2026.104678},
pmid = {42391006},
pmcid = {PMC13352386}
}

RIS

TY - JOUR
AU - Guo, Huaiqin
AU - Yang, He
AU - Su, Feng
AU - Zhu, Yuzhi
AU - Tang, Qingyi
AU - Cao, Rui
AU - Wang, Qiao
AU - Tong, Siyi
AU - Wang, Shaoli
AU - Zhang, Chen
AU - Lu, Wei
TI - Protocol for longitudinal two-photon calcium imaging and holographic optogenetic manipulation to investigate memory in mice
T2 - STAR protocols
J2 - STAR Protoc
PY - 2026
DA - 2026/07/02
VL - 7
IS - 3
SP - 104678
SN - 2666-1667
PB - Elsevier
DO - 10.1016/j.xpro.2026.104678
UR - https://doi.org/10.1016/j.xpro.2026.104678
LA - en
ER -

CSL-JSON

{
"id": "10.1016/j.xpro.2026.104678",
"type": "article-journal",
"title": "Protocol for longitudinal two-photon calcium imaging and holographic optogenetic manipulation to investigate memory in mice",
"container-title": "STAR protocols",
"author": [
{
"family": "Guo",
"given": "Huaiqin"
},
{
"family": "Yang",
"given": "He"
},
{
"family": "Su",
"given": "Feng"
},
{
"family": "Zhu",
"given": "Yuzhi"
},
{
"family": "Tang",
"given": "Qingyi"
},
{
"family": "Cao",
"given": "Rui"
},
{
"family": "Wang",
"given": "Qiao"
},
{
"family": "Tong",
"given": "Siyi"
},
{
"family": "Wang",
"given": "Shaoli"
},
{
"family": "Zhang",
"given": "Chen"
},
{
"family": "Lu",
"given": "Wei"
}
],
"container-title-short": "STAR Protoc",
"volume": "7",
"issue": "3",
"page": "104678",
"DOI": "10.1016/j.xpro.2026.104678",
"PMID": "42391006",
"PMCID": "PMC13352386",
"ISSN": "2666-1667",
"publisher": "Elsevier",
"URL": "https://doi.org/10.1016/j.xpro.2026.104678",
"language": "en",
"issued": {
"date-parts": [
[
2026,
7,
2
]
]
}
}

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.1038/s41596-022-00691-w [code]
All-optical interrogation of neural circuits in behaving mice.
Journal: Nature protocols
In common: Parallel Computing Toolbox, seaborn, Statistics and Machine Learning Toolbox, 3 other tools, mouse, 7 references
[2] doi:10.1016/j.crmeth.2025.101180 [code]
A real-time all-optical interface for dynamic perturbation of neural activity during behavior.
Journal: Cell reports methods
In common: Parallel Computing Toolbox, Statistics and Machine Learning Toolbox, SciPy, 2 other tools, optical imaging (calcium, voltage, 2-photon), histology / microscopy, mouse, 3 references
[3] doi:10.1038/s41467-024-46484-5 [code]
The influence of cortical activity on perception depends on behavioral state and sensory context.
Journal: Nature communications
In common: Parallel Computing Toolbox, seaborn, Statistics and Machine Learning Toolbox, 3 other tools, mouse, 3 references
[4] doi:10.1117/1.nph.11.1.015006 [code]
Contribution of optical resolution to the spatial precision of two-photon optogenetic photostimulation <i>in vivo</i>.
Journal: Neurophotonics
In common: seaborn, pandas, SciPy, 2 other tools, optical imaging (calcium, voltage, 2-photon), histology / microscopy, 3 references
[5] doi:10.1038/s41467-025-62069-2 [code]
Temporal coding carries more stable cortical visual representations than firing rate over time.
Journal: Nature communications
In common: Parallel Computing Toolbox, seaborn, Statistics and Machine Learning Toolbox, 4 other tools, mouse, 2 references
[6] doi:10.1186/s40708-022-00166-4 [code]
SmaRT2P: a software for generating and processing smart line recording trajectories for population two-photon calcium imaging.
Journal: Brain informatics
In common: Parallel Computing Toolbox, Statistics and Machine Learning Toolbox, optical imaging (calcium, voltage, 2-photon), histology / microscopy, 4 references
[7] doi:10.1093/biomethods/bpaf090 [code]
The protocol for mesoscopic wide-field optical imaging in mice: from zero to hero.
Journal: Biology methods & protocols
In common: seaborn, pandas, SciPy, 2 other tools, optical imaging (calcium, voltage, 2-photon), mouse, 3 references
[8] doi:10.1038/s41592-026-03043-8 [code]
Designer indicators for two-photon recording of subthreshold voltage dynamics.
Journal: Nature methods
In common: seaborn, pandas, SciPy, 2 other tools, optical imaging (calcium, voltage, 2-photon), histology / microscopy, mouse, 2 references
[9] doi:10.1016/j.celrep.2024.114189 [code]
Highly local activation of inhibition at the seizure wavefront in vivo.
Journal: Cell reports
In common: Parallel Computing Toolbox, seaborn, Statistics and Machine Learning Toolbox, 4 other tools, optical imaging (calcium, voltage, 2-photon), mouse, 1 reference
[10] doi:10.3389/fncel.2022.917713 [code]
Real-Time Image Processing Toolbox for All-Optical Closed-Loop Control of Neuronal Activities.
Journal: Frontiers in cellular neuroscience
In common: Parallel Computing Toolbox, Statistics and Machine Learning Toolbox, optical imaging (calcium, voltage, 2-photon), 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.

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.1016/j.xpro.2026.104678.svg)](https://openscicode.org/badge/doi/10.1016/j.xpro.2026.104678)
<!-- oscr-badge:end -->
reStructuredText
.. oscr-badge:start

.. image:: https://openscicode.org/badge/doi/10.1016/j.xpro.2026.104678.svg
   :target: https://openscicode.org/badge/doi/10.1016/j.xpro.2026.104678
   :alt: OSCR

.. oscr-badge:end
HTML
<!-- oscr-badge:start -->
<a href="https://openscicode.org/badge/doi/10.1016/j.xpro.2026.104678"><img src="https://openscicode.org/badge/doi/10.1016/j.xpro.2026.104678.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.