May 26, 2026
  • Evan Kyzar1,
  • Alejandro Ramirez1,
  • Ruby Setara1,
  • Lydia Rogerson1,
  • C. Daniel Salzman1,
  • Luke Hammond2
  • 1Columbia University;
  • 2The Ohio State University
Icon indicating open access to content
QR code linking to this content
Protocol Citation: Evan Kyzar, Alejandro Ramirez, Ruby Setara, Lydia Rogerson, C. Daniel Salzman, Luke Hammond 2026. TTP-S Protocol. protocols.io https://dx.doi.org/10.17504/protocols.io.5qpvo1x2zg4o/v1
Manuscript citation:
Ramirez A, Kyzar EJ, Rogerson L, Berland C, Rodriguez E, Guerrero J, Setara R, Eisengart M, Virkar S, Hammond LA, Ferrante AW, Salzman CD. A two-timepoint framework for sensitive and specific single-cell activity screening. Neuron. 2026 Jun 25:S0896-6273(26)00418-6. doi: 10.1016/j.neuron.2026.05.026. Epub ahead of print. PMID: 42349406.
License: This is an open access  protocol  distributed under the terms of the  Creative Commons Attribution License,  which permits unrestricted use, distribution, and reproduction in any medium, provided the original author and source are credited
Protocol status: Working
We use this protocol and it's working
Created: December 18, 2025
Last Modified: May 26, 2026
Protocol  Integer ID: 235364
Keywords: whole brain imaging, whole brain analysis, automated cell counting, brain registration, brain neural activity patterns across distinct behavioral epoch, significant neuronal overlap, identifying brain region, standard brainj volumetric reconstruction, brain regions with significant neuronal overlap, labeled neuron, neural activity pattern, timepoint statistical inference with subtraction, distinct behavioral epoch, timepoint statistical inference, assisted image restoration, brain, volumetric reconstruction, specialized matlab inference engine, image restoration, ai12 mice, standard brainj
Funders Acknowledgements:
BBRF-NARSAD
Grant ID: Young Investigator Award (to AR)
New York Obesity and Nutrition Research Center
Grant ID: Pilot and Feasibility Grant (to AR and EJK)
NIDDK
Grant ID: K08 - DK132493 (to AR)
NIMH
Grant ID: L70 - MH134315 and T32 - MH015144 (to EJK)
Boehringer-Ingelheim
Grant ID: Columbia-BI Collaboration (to CDS)
Disclaimer
DISCLAIMER – FOR INFORMATIONAL PURPOSES ONLY; USE AT YOUR OWN RISK

The protocol content here is for informational purposes only and does not constitute legal, medical, clinical, or safety advice, or otherwise; content added to protocols.io is not peer reviewed and may not have undergone a formal approval of any kind. Information presented in this protocol should not substitute for independent professional judgment, advice, diagnosis, or treatment. Any action you take or refrain from taking using or relying upon the information presented here is strictly at your own risk. You agree that neither the Company nor any of the authors, contributors, administrators, or anyone else associated with protocols.io, can be held responsible for your use of the information contained in or linked to this protocol or any of our Sites/Apps and Services.
Abstract
This protocol delineates the computational workflow for Two-Timepoint Statistical Inference with Subtraction (TTP-S), a method for quantifying whole-brain neural activity patterns across distinct behavioral epochs using Trap2:Ai12 mice. Building upon the standard BrainJ volumetric reconstruction and registration pipeline, this updated framework integrates custom Python-based algorithms for deep-learning-assisted image restoration and the automated quantification of single- and double-labeled neurons. The expected outcome is a statistically validated dataset identifying brain regions with significant neuronal overlap, facilitated by a specialized MATLAB inference engine and subsequent graph-theoretical network analysis.
Materials
  • Trap2xAi14 mice (Fos2A-iCreER[TRAP2 - JAX 030323] x B6.Cg-Gt(ROSA)26Sortm14(CAG-tdTomato)Hze/J [Ai14 - JAX 007914])
  • 4-hydroxytamoxifen
  • Castor oil
  • Sunflower oil
  • Sterile PBS
  • 4% paraformaldehyde in PBS
  • 20% sucrose in PBS
  • Brain molds (e.g., Peel-A-Way molds from Sigma)
  • OCT (e.g., TissueTek OCT from Sakura Finetek)
  • Microscope slides and coverslips
  • Confocal microscope with multi-point capabilities (e.g., Yokogawa W1 spinning disk confocal microscope)

Recommended antibodies
  • Rabbit monoclonal anti-cFos (Cell Signaling #2250)
  • Mouse monoclonal anti-NeuN (Millipore #MAB377)
  • Donkey anti-rabbit IgG (H+L)secondary, Alexa Fluor 647 (Thermo #A-31573)
  • Donkey anti-mouse IgG (H+L)secondary, Alexa Fluor 488 (Thermo #A-21202)
  • DAPI (Sigma #D9542)
  • Donkey serum (Jackson Immunoresearch #017-000-121)

Necessary software

See Key Resources Table of cited publication for full materials list used in our paper. Note that our pipeline is designed to flexibly adapted to other use cases.


Experimental design considerations
1w 4d
Groups of Trap2:Ai14 mice [1] should be exposed to discrete stimuli of interest. We recommend sample sizes of at least n=5. Prior to timepoint 1 (TP1), mice should be given sham i.p. injections for at least 3 days to habituate to injection stress.

If utilizing the subtraction procedure, researchers should also have a "subtraction" group of mice that are exposed to homecage conditions at both TP1 and timepoint 2 (TP2), or that are exposed to the stimulus of interest at one timepoint and an alternative stimulus at another timepoint.
3d
Timepoint 1 (TP1)
For TP1, mice should be injected with 4-hydroxytamoxifen (4-OHT) at a dose of 50mg/kg. 4-OHT is first fully dissolved in 100% ethanol to a concentration of 20mg/mL. This is then mixed with an equal volume of a 1:4 mixture of castor oil:sunflower oil and vacuum centrifuged at 43°C for 45min.

Each mouse receives 50mg/kg of 4-OHT. In order to minimize capture of non-stimulus-related activity in the "trapped" engrams, mice remain socially isolated and in a dark environment following the stimulus exposure and 4-OHT administration.
1w
Timepoint 2 (TP2)
At least 7 days after TP1 (though this can be shortened by using anti-tdTomato antibody to boost the red channel signal following TP1), mice are exposed to the same stimulus and sacrificed for c-Fos labeling.
1d
Tissue preparation
2d 3h
Our protocol is adaptable and can be used with any tissue preparation method that preserves the ability to stain for c-Fos and for an estimation of total cell count (i.e., through DAPI or NeuN staining). This includes traditional immunohistochemistry (IHC) as well as brain clearing methods. Here, we describe the approach using traditional IHC.
Mice are anesthetized (e.g., with ketamine/xylazine) and transcardially perfused with 20mL of PBS followed by 20mL of 4% paraformaldehyde (PFA). The brain is removed and placed in 4% PFA overnight at 4°C.
1d
Brains are removed from 4% PFA and placed in 20% sucrose (in PBS) at 4°C until the brain sinks, typically 24-36 hours.

Note that you can skip the sucrose step and place brains into PBS if sectioning the brain using a vibratome.
1d
Brains are removed from sucrose and dried using a Kimwipe prior to embedding in OCT in a brain mold (e.g,. Peel-A-Way molds; Sigma-Aldrich) and flash freezing in a 100% EtOH solution with dry ice. Brains can be stored at -80°C until IHC is performed.
3h
Immunohistochemistry (IHC)
2d 3h
Brains can be sliced coronally on a cryostat (if frozen) or vibratome. Our protocol describes frozen brain sliced on a cryostat, as in our experience this allows us to stain and mount more brain slices (particularly in caudal brain regions). Regardless of brain slicing method, we recommend 50 micron sections.
1h
Following brain slicing, wash sections 3x in cold PBS for 5 min each.
20m
Block with 5% normal donkey serum in PBST (3% Triton in PBS) for 1 hr on shaker at room temperature.
1h
Incubate with primary antibodies dissolved in blocking solution (see step 10 above) overnight (~18 hrs) on shaker at 4°C. We recommend the primary antibody from Cell Signaling (#2250S; 1:1000 dilution) and the NeuN antibody from EMD Millpore (#MAB377; 1:1000 dilution). Note that our protocol can be adapted for use with other primary and secondary antibodies.
18h
Wash sections 3x in PBST for 5 min each.
20m
Incubate with secondary antibodies for 2 hrs on shaker at room temperature. We recommend the Invitrogen donkey anti-rabbit AF647 (#A31573; 1:1000 dilution) and the Life Technologies donkey anti-mouse AF488 (#A21202; 1:1000 dilution), as well as a DAPI stain (e.g., Sigma Aldrich #D9542; 1:5000 dilution).
2h
Wash sections 3x in PBS for 5 min each.
20m
Mount sections. We recommend mounting 6-8 sections per microscope slide to minimize imaging time. Note that automatic registration to the Allen Brain Atlas (ABA) is greatly improved in well-mounted sections with minimal damage.
4h
After coverslipping, sections should be allowed to dry for at least 24 hours prior to imaging.
1d
Imaging
4h
Note that imaging can be performed on any high-sensitivity confocal microscope, though a high-speed system is recommended to minimize imaging time. We use a W1-Yokogawa inverted spinning disk confocal with a 4 slide stage to image 32 brain sections serially (8 sections per slide), with an estimated imaging time of 3-4 hours for an entire coronally sliced brain.
Images should be captured at 4x magnification and tiled across each brain slice. Four channels can be imaged, with settings for the W1-Yokogawa spinning disk in parentheses: 1) DAPI - 405nm wavelength (100% laser power, 50ms exposure); 2) NeuN - 488nm wavelength (100%, 100ms); 3) tdTomato - 568nm wavelength (100%, 100ms); 4) cFos - 647nm wavelength (100%, 300ms). Note that these settings should be optimized for each individual imaging setup.
4h
Whole-brain reconstruction and registration with BrainJ
3h 45m
We use the BrainJ plugin [2] in FIJI to register brain sections to the Allen Brain Atlas Common Coordinate Framework. BrainJ and dependencies can be downloaded from https://github.com/lahammond/BrainJ

We use Advanced Renamer to renumber and order all brain slice images sequentially based on file name. Advanced Renamer can be downloaded from https://www.advancedrenamer.com/
30m
Open Advanced Renamer. Under "Add batch method" click "Renumber." Keep the settings as follows:

- Number position: 1
- Change to: Absolute number
- New number: 01
- Skip: 1
- Zero padding: Automatic
- Apply to: Name
1m
Under "Add batch method" click "Add." Keep the settings as follows:

- Add: 0
- At index: 1
- Apply to: Name
2m
Click "Folders" then navigate to the folder with the brain you would like to run BrainJ on. Click on the folder containing the first set of slides (e.g. "1-4"). Select this folder.
2m
Under the "Renumber" tab in Advanced Renamer, change the "New Number" value to 01. Each file will automatically relabel to three figures (e.g. 001, 002, 003...). Click "Start batch" to confirm the new file names.

The previous file names will be overwritten. Note the final new file name. That number will be the next number placed in the "New number" section under the "Renumber" tab. For example, if the final file name in this batch was 032, your "New number" section will start with 033.
10m
Click "Clear" to clear the workspace.

Repeat steps 22-24 for the rest of the folders containing brain slice images.

Note: when the file names reach triple digits, go to the "Add" tab and delete the "0" next to "Add" to keep file names within three figures (e.g. 120 instead of 0120).
20m
Once all files have been renamed, place all renamed files into a single folder labeled "BrainJ."
1m
Open the "ImageJ" app. On the top menu navigate to Plugins > BrainJ > 1 Set Experiment Parameters
1m
Set the parameters as follows:

- Select folders: File path to BrainJ folder of brain of interest
- Analysis type: Whole brain
- Sample type: Mouse brain: Coronal Sections
- Input image type: 2D Slices
- Do the sections require rotation?: No rotation
- Do the sections require flipping?: No flipping
- File order (alphanumeric or using slide coordinates): Alphanumeric
- Order of sections on slide: Right (adjust depending on your section orientation)
- Lateral (XY) resolution of input (um): 1.615
- Final resolution of image output (um/px): 1.615
- Section cut thickness: Input your section thickness
- Counterstain channel (DAPI or NeuroTrace): Input your counterstain channel (DAPI in our use-case)
- Background intensity of counterstain channel: To find this, open a random image from the brain of interest and hover cursor over blank space surrounding brain. Take an average of the values that appear on the bottom left of the screen. Ours is typically 98, though this depends on the specific imaging set-up.
- Perform automatic tissue detection: Check the box
- Click "OK"
5m
In ImageJ, navigate to Plugins > BrainJ > 2 Reformat sections. If the file path to the BrainJ folder doesn't automatically appear, click "Add files..." and navigate to the folder.

- Threshold method for section detection: Mean
- Click OK

A window summarizing experimental parameters and section processing progress will appear.
1m
Once completed, open your file explorer and navigate to the BrainJ folder of the brain in progress. Click into the folder titled "2_Section Preview" and drag the file named "Section Preview Stack" to ImageJ. A window named "Section_Preview_Stack.tif" will appear.

If the window shows a black image or barely visible section, adjust visibility by ImageJ > Adjust > Brightness/Contrast.
1m
Flip through the stack containing all images and note which sections need to be flipped. All sections must be in the same orientation. Also note all sections that are severely damaged and need to be replaced.
10m
In ImageJ navigate to Plugins > BrainJ > 3 Section Flipper and Replacer.

- Which sections require horizontal flipping?: insert your section numbers here
- Which sections require vertical flipping?: insert your section numbers here
- Which sections require replacing?: insert your section numbers here
- Method for replacement: Replace DAPI/registration channel, clear the other channels
10m
Download .ijm file entitled "Background_subtraction_looped new.ijm" from Github. Link to download here: https://github.com/ekyzar/ttps_pipeline/tree/main/background_subtraction

Drag it to ImageJ > Run > navigate to BrainJ folder of brain in progress > "1_Reformatted Sections" > select folder representing the counterstain channel.

A window with the sections will appear.
5m
In the ImageJ menu, select the Circle shape > draw a tight circle around the section.

If the section needs to be straightened, draw a circle around it then go to ImageJ > Transform > Rotate... > Click "Preview" > use the slider to straighten as needed > Hit "OK" > Hit "OK" on the ROI manager to proceed to the next brain section.

Repeat step 33 until all sections are circled and straightened.
1h
Open your file explorer > BrainJ folder of the brain in progress > "2_Section Preview" > drag the file named "Section Preview Stack" to ImageJ. Flip through the stack and find an undamaged section around the middle of your stack. For example, if you have 150 sections, your section of choice should be around 75.

In ImageJ navigate to Plugins > BrainJ > 4_Set Analysis Settings. Set the analysis settings as follows:

- Select folder: file path to the BrainJ folder of the brain in progress
- Reference section for registration: insert your chosen reference section
- Background removal prior to segmentation: 7
- Generate full resolution registered image of reference channel: Checked
- Perform a second pass section registration: Checked

-------- Cell Analysis Settings --------
- Method for cell detection: No Cell Analysis
- Channel for cell detection/analysis: 0

Additional channels for cell detection/analysis: 0

The minimum intensity threshold and minimum cell area values do not matter as we are not doing cell analysis.

-------- Mesoscale Mapping/Projection Analysis Settings --------
- Method for mesoscale mapping axon/dendrite detection: No projection analysis
- Channel for mesoscale mapping analysis: 0
- Additional channel for mesoscale mapping analysis: 0

The additional channel for mesoscale mapping analysis values do not matter as we are not doing mesoscale mapping/projection analysis.

Ensure that the correct file paths are set for Ilastik and Elastix (installed with BrainJ and dependencies in Step 19) then hit "OK."

5m
In ImageJ navigate to Plugins > BrainJ > 5 Registration and Atlas Analysis. Ensure the file path leads to the BrainJ folder of the brain in progress.

- Select template/annotation directory to be used: ensure the file path leads to the ABA registration file
- Perform section registration?: Checked
- Perform atlas registration?: Checked
- All other boxes can be left unchecked
- Click "OK"

Note: You may additionally click "Transform original channel images into template space" and "extract specific regions at full resolution". This will allow you to check your registered brain against the Allen Brain Atlas registration. This adds significant time to the analysis performed in Step 36 (~1-2 additional hours), but is useful to check the registration of smaller/dense regions of interest such as the hypothalamus.
1m
Atlas registration time depends on your computer's capabilities.

Once registration is complete, you can view registration by navigating to the brain's BrainJ folder > 5_Analysis Output" > drag the file entitled "Template brain aligned" into ImageJ. Scroll through the stack to review template alignment.
1h
If atlas registration fails or is not adequate, you can attempt to remove, flip, or re-orient problematic sections and run the registration again. In our experience, approximately 5-10% of brains are not able to be adequately registered, typically due to tissue distortion during staining and mounting.
Automated cell counting
1d 0h 11m
Following registration, move the following folders/files generated by BrainJ to a new folder on your analysis computer: "3_Registered_Sections", "4_Processed_Sections", "5_Analysis_Output", "Ilastik_Projects", and "Analysis_Settings.csv"

10m
Ensure that this computer has the following packages and files downloaded:
- Allen Brain Atlas Common Coordinate Framework (available in the BrainJ package: https://github.com/lahammond/BrainJ)
- Elastix (https://elastix.dev/download.php). Note that the pipeline was built on Elastix v5.0.1
- The BrainJ-Python extension package available at https://github.com/lahammond/brainj-py
- Restoration/Segmentation models - the models used in our use-case are available with the BrainJ-Python package, but we recommend that each user utilize models that are specific to their imaging set-up.
Make a copy of the Analysis_Settings.yaml file (in BrainJ -> Templates folder of the BrainJ-Python package) and move to the folder containing the BrainJ output for the brain you want to analyze. Open the yaml file in your preferred development environment (e.g., VSCode, spyder) and change the reference section to the section used in your registration.
1m
Open the BrainJ_Batch_script_template.py script and update the file path to the folder containing your brain. Run the script.

Note that this step requires a high-performance computing setup. For example, we analyze this data on an HP z840 with 16GB of RAM and an NVIDIA Quadro P5000 GPU, and are able to complete most analyses in 24 hours.
1d
Two-timepoint statistical inference (TTPi) and two-timepoint statistical inference with subtraction (TTP-S)
13h 15m
Our two-timepoint statistical analyses are extensively described in our accompanying paper and in the statistical analysis package at https://github.com/ekyzar/ttps_pipeline. The pipeline is run one step at a time from the MATLAB Command Window. All steps operate on data in the BrainJ output folder structure.

The expected outputs of the cell counting step are .csv files containing the number of counted cells (as well as double-labeled or 'overlapping' cells) in each brain region for each hemisphere.
10m
Run the TTP_combine_hemispheres.m script on each brain's BrainJ Cell_Analysis folder. It reads the four channel CSVs (DAPI, NeuN, c-Fos, tdTomato) and produces hemisphere-specific combined tables with statistics.

Example MATLAB code:
% Standard 0.70-overlap analysis: TTP_combine_hemispheres('F:\TRAP_Brains\Brain_A1\Cell_Analysis', false); % Include the four per-region adaptive-mask sensitivity variants: TTP_combine_hemispheres('F:\TRAP_Brains\Brain_A1\Cell_Analysis', true); % Interactive folder picker: TTP_combine_hemispheres();

When useMask=true, four additional sensitivity-analysis variants are produced. Each variant uses a per-region overlap threshold derived from the data rather than a fixed 0.70 cutoff.

SuffixThreshold
_MeanMaskmean of confident double-positives' overlap, per region
_MinMaskminimum (after IQR outlier removal) of confident double-positives' overlap, per region
_P10Mask10th percentile, per region
_Distuses physical 3D distance instead of mask overlap fraction

Regions with fewer than 10 confident double-positives fall back to the 0.70 threshold. The published analyses use _MinMask.
1h
After combining hemispheres, data must be loaded using a batch script for multi-brain processing. The GitHub repo explains how to create a spreadsheet suitable for batch loading (https://github.com/ekyzar/ttps_pipeline#batch-spreadsheet-format). Then run the Batch_Load_Data_BrainJ_Both_Hemi_Working.m script.

% Interactive: prompts for the xlsx file
Batch_Load_Data_BrainJ_Both_Hemi_Working

% Or pre-set the batch file and mask suffix: batchFile = 'C:\path\to\BatchProcess.xlsx'; maskSuffix = 'MinMask'; % '' for standard 0.70; 'MeanMask'/'P10Mask'/'Dist' for variants
Batch_Load_Data_BrainJ_Both_Hemi_Working

After this runs, each brain in the spreadsheet has a corresponding MATLAB workspace variable, named according to the batch spreadsheet. The subsequent analysis references these variables directly.
5m
Optional: The Allen Brain Atlas has 840 regions by default, and some of these are summary regions that are essentially empty in our analysis pipeline (leaving ~660 measured brain regions). While our published analysis use all of these brain regions, we have built an optional extension to collapse brain regions in a customizable manner at (https://github.com/ekyzar/ttps_pipeline#step-6-optional--brain-area-collapse).

We recommend performing this step prior to running the subtraction, if desired.
Now we perform TTP-S statistical inference using the TTPS_pval_loop.m script.

Compare two groups of brains and write a subtraction-test p-values CSV:

results = TTPS_pval_loop( ... {'A1c','A2c','A3c','A4c','A5c'}, ... % group AA: brain variable names {'H1c','H2c','H3c','H4c'}, ... % group AB (subtraction group) 'AA_AB_Subtraction.csv'); % output filename

%Optional parameters
opts.numSamples = 300; % hypergeometric draws per brain (default 300) opts.alpha = 0.05; % per-comparison alpha (default 0.05) opts.nRegionsBonferroni = 500; % Bonferroni divisor (default 500) opts.saveWorkspaceMat = ''; % path to save full workspace, default off results = TTPS_pval_loop({'A1c',...,'A5c'}, {'H1c',...,'H4c'}, ... 'AA_HH_Subtraction.csv', opts);

The output CSV has one row per ABA region with four combined p-values (Harmonic, Fischer, Stouffer, Exp). The returned 'results' struct contains both the table and the raw per-pair p-values matrix for downstream analyses. Our published analyses utilize the Harmonic p-value.

By default the test is right-tailed (testing for more double-labeling than expected). To run a left-tailed (lack-of-overlap) test, edit TTPS_pval_loop.m lines 340 and 386, changing both >= to <=
12h
Further data analysis with graph theory
4h
We utilize graph theoretical analysis the Brain Connectivity Toolbox (https://sites.google.com/site/bctnet/) [3] in MATLAB for additional graph theoretical analysis on brain areas considered significant by TTP-S.

Sample analysis scripts are shown in the GitHub repo (https://github.com/ekyzar/ttps_pipeline#step-6-optional--graph-theory), though we encourage users to design and implement their own secondary analyses.
4h
Protocol references
1. DeNardo LA, Liu CD, Allen WE, Adams EL, Friedmann D, Fu L, Guenthner CJ, Tessier-Lavigne M, Luo L. Temporal evolution of cortical ensembles promoting remote memory retrieval. Nature neuroscience. 2019 Mar;22(3):460-9.

2. Botta P, Fushiki A, Vicente AM, Hammond LA, Mosberger AC, Gerfen CR, Peterka D, Costa RM. An amygdala circuit mediates experience-dependent momentary arrests during exploration. Cell. 2020 Oct 29;183(3):605-19.

3. Rubinov M, Sporns O. Complex network measures of brain connectivity: uses and interpretations. Neuroimage. 2010 Sep 1;52(3):1059-69.