Longitudinal tracking of neuronal activity from the same cells in the developing brain using Track2p Authors: Jure Majnik, Manon Mantez, Sofia Zangila, Stéphane Bugeon, Léo Guignard, Jean-Claude Platel, Rosa Cossart, Leopoldo Petreanu, Jure Majnik, Manon Mantez, Sofia Zangila, Stéphane Bugeon, Léo Guignard, Jean-Claude Platel, Rosa Cossart Published: 2025 ABSTRACT Understanding cortical circuit development requires tracking neuronal activity across days in the growing brain. While in vivo calcium imaging now enables such longitudinal studies, automated tools for reliably tracking large populations of neurons across sessions remain limited. Here, we present a novel cell tracking method based on sequential image registration, validated on calcium imaging data from the barrel cortex of mouse pups over 1 postnatal week. Our approach enables robust long-term analysis of several hundreds of individual neurons, allowing quantification of neuronal dynamics and representational stability over time. Using this method, we identified a key developmental transition in neuronal activity statistics, marking the emergence of arousal state modulation. Beyond this key finding, our method provides an essential tool for tracking developmental trajectories of individual neurons, which could help identify potential deviations associated with neurodevelopmental disorders. Introduction Early postnatal development in rodents is a period of intense circuit wiring and remodelling at several scales through various major processes that include neuronal growth, synaptogenesis, apoptosis, migration, rise of intracortical connectivity, functional maturation of inhibitory synapses, and the disappearance of transient connectivity schemes (Cossart and Garel, 2022; Molnár et al., 2020; Blankenship and Feller, 2010; Reh et al., 2020). Critical periods for various sensory systems open and close during this time, further highlighting the profound reshaping of cortical networks (Reh et al., 2020). This developmental period of remodelling is crucial for establishing the functional architecture of the mature cortex. Most importantly, all of these developmental processes are activity-dependent, with collective dynamics playing a critical role in the proper integration of neurons into functional networks (Wu et al., 2024). These network dynamics sequentially unfold while relying on different mechanisms and circuits for their generation (Cossart and Garel, 2022; Wu et al., 2024). The emergence of functional brain circuits during development is therefore a precisely timed choreography, the timing of which is inherently tied to the age of the organism under study. However, developmental age lacks precision due to significant variations in physical characteristics and growth patterns, even among offspring from the same genetic lineage (Figure 1). Hence, longitudinal imaging from the same animal across days is the optimal solution to better capture the evolution of circuit dynamics during development. Additionally, developmental variability extends beyond the organism level, becoming even more pronounced at the single neuron level (Figure 1). While population-level descriptions of cortical circuit development are crucial, individual neurons exhibit unique developmental trajectories rooted in their specific origin, birth timing, and cellular identity (Cossart and Garel, 2022). In addition, the singular dynamics of sparse individual neurons can matter, as demonstrated for the rare hub cells (Bollmann et al., 2023; Wang et al., 2024). Thus, in order to fully understand the circuit basis of cortical development in health and disease, it is crucial to track neuronal activity at both population and individual cell levels in the growing brain of the same animal. This hurdle spans both experimental methodology and data analysis. Tracking developmental trajectories at the organismal and cellular level. Postnatal development in mammals is not a strictly stereotyped process (left) but rather shows variability across individual organisms, as well as across individual cells of the same organism (right). Performing an acute experiment (dashed grey line) only provides a single snapshot of the developmental trajectory of an individual organism (or cell). Alternatively, a longitudinal experiment (grey arrow) allows tracking the properties of the same individual (or cell) throughout development, which is especially important in the case of variability in developmental trajectories (right). Significant progress has been made over the recent years to develop innovative solutions to meet this challenge on the experimental side, using two-photon calcium imaging. Technical improvements included modified head plates and specialised surgical and care protocols (Bollmann et al., 2023; Che and De Marco García, 2021; Duan et al., 2020; Wong et al., 2018; He et al., 2018; Modol et al., 2020). Still, in many cases, different neurons from the same mouse were recorded at different ages, or the tracking of individual cells could only be achieved through visual inspection and manual annotation of relatively sparse, often genetically subscribed neuronal populations expressing a calcium fluorescent reporter. The gold standard for developmental circuit analysis would be automated tracking of densely labelled neuronal populations, enabling efficient longitudinal monitoring while eliminating the burden of manual cell tracking. An algorithm capable of accurate automatic tracking of the same neurons across multiple days of brain development is thus essential. Methods for tracking the activity of large populations of cells across days have been successfully developed and deployed in the adult brain (van Beest et al., 2025; Lee et al., 2020; Ziv et al., 2013; Johnston et al., 2022). In adult circuits, cell tracking is indeed relatively straightforward due to their structural stability, with minimal tissue growth, negligible morphological changes, and constant numbers of neurons. In contrast, the first weeks of mouse neocortical development are characterised by rapid and critical developmental changes spanning several scales from synapses to single neurons and networks. These include extensive brain growth (Lyck et al., 2007; Thompson et al., 2014), substantial morphological changes (Nakazawa et al., 2018), as well as changes to cell numbers due to programmed cell death (Wong et al., 2018). This makes tracking the same cells across sessions substantially more difficult during development compared to the adult brain. To overcome the technical limitations detailed above, we developed an experimental protocol using chronic calcium imaging in mice and a novel cell tracking algorithm (Track2p), specifically tailored to development. This allowed us to track the activity of large, densely labelled, populations of neurons during early postnatal development, which has not been possible before. The algorithm overcomes the challenges of cell tracking during brain growth by applying sequential registration and cell matching steps, using the spatial overlap of cells on adjacent recordings as a matching criterion. Track2p is freely available as an open-source package with an interactive graphical user interface (GUI), enabling researchers to analyse longitudinal calcium imaging data from both developing and mature circuits. Applying the algorithm to a dataset recorded during the second postnatal week in mouse barrel cortex, a critical period for the formation of topographic maps in that region, yielded hundreds of identified neurons tracked across all days. Assessing the quality of the algorithm by benchmarking it on a newly generated ground truth dataset showed high tracking performance (Sheintuch et al., 2017). Leveraging ground truth benchmarking, we demonstrate that explicitly accounting for developmental processes, such as brain growth, is critical for accurately tracking cells during postnatal development. Our work thus shows that chronic calcium imaging and cell tracking using Track2p can be used to monitor the changing physiological properties of large populations of matched neurons during early cortical development. We demonstrate that the statistics of activity patterns in the tracked population display two periods of stability, with a critical transition point around postnatal day 11 (P11), marking the emergence of a stable behavioural state representation. Results Cell tracking using image registration and overlap-based matching Tracking neuronal activity across multiple days presents unique challenges due to the dynamic nature of brain development. We developed a novel tracking algorithm, called Track2p. As in other tracking algorithms for calcium imaging data (van Beest et al., 2025; Johnston et al., 2022; Tolu et al., 2010), the final goal of Track2p is to follow individual cells across sessions allowing the user to compare their functional properties in downstream analyses. To achieve this goal, the algorithm takes as input a set of preprocessed recordings, each consisting of a set of regions of interest (ROIs, i.e. putative neurons detected based on activity, see Methods) and their respective calcium fluorescence traces, as well as a mean image of the field of view (FOV). Briefly, the algorithm aims to match ROIs in any given pair of consecutive sessions based on their spatial overlap, assuming that the more the two overlap in anatomical space, the more likely they correspond to the same neuron. Due to developmental processes such as brain growth and other experimental factors, it is necessary to account for day-to-day changes that occur between the two recordings before computing spatial overlaps. This is achieved by performing affine image registration on the mean FOV images between consecutive days. We apply the registration and spatial matching iteratively, starting with the first pair of sessions (s0 and s1) as follows (Figure 2A). Firstly, we estimate the spatial transformation between s0 and s1 using affine image registration (Ntatsis et al., 2023) (i.e. allowing shifting, rotation, scaling, and shearing, see Figure 2B, the transformation is denoted as T). We employ affine transformation, since it can account for both rigid transformations (rotations and translations arising from minor mismatches in FOV alignment across experiments) and scaling and shearing (mostly due to brain growth). The changes across the two consecutive recordings are approximated as the transformation registering the mean FOV from session s1 (green in Figure 2B) to the mean FOV of s0 serving as reference (red in Figure 2B). The Track2p pipeline for tracking cells across recordings. (A) Schematic overview of the Track2p algorithm and the graphical user interface (GUI) capabilities. Dashed squares represent optional steps in the pipeline. (B) The transformation (T) between 2 consecutive days is computed by registering the mean field of view (FOV) images. Top: An overlay of the reference (red, s0) and the moving (green, s1) images before registration. Bottom: Same two images after registration. Scale bar: 50 μm. (C) Applying the transform to regions of interest (ROIs) from Suite2p segmentation. The ROI colour code is the same as in B, the intersection of the ROIs is shown in yellow. Top: Overlap before T. Bottom: Overlap after T. Note: Only a few example ROIs are displayed for explanation purposes. (D) Cell matching using linear sum assignment. ROIs are the same as C with indexes for the two recordings added for illustrative purposes. Cells from one recording are matched to cells from another, maximising the sum of the intersection over union (IoU) across all matches. (E) Filtering putative false and true matches by thresholding the IoU distribution. Top: The distribution of IoU values for matched ROI pairs shows a bimodal distribution, which is used to reject putative false positive matches. Bottom: Final result of the cell linking for a pair of recordings. (F) Top: In the case of tracking across more than two imaging sessions, the steps from B to D are repeated sequentially to link the cells across all days. Bottom: Example matches for five cells (rows) successfully tracked across 5 consecutive days (columns). Note: The figures shown are for illustrative purposes only; see Figure 3 for application to real data. Figure 2—figure supplement 1.Overview of the graphical user interface for interactive visualisation and curation of tracked cells.(A) The menu bar allows the users to run the Track2p algorithm (under ‘Run’), import the results of a previous run (under ‘File’), or to visualise population activity (under ‘Visualisation’; opens the raster window in F). (B) The interface displays the mean image for each day of the recording (the channel can be chosen by the user), with regions of interest (ROIs) of the cells tracked across all days overlaid. This plot allows the user to select which cell to visualise across days. This visualisation corresponds to Figure 3D. (C) Once a cell is selected, this section provides a high-magnification image of the field of view (FOV) for all days. Underneath each high-magnification image, the Suite2p index on that day (i) and the Suite2p cell probability (p) are displayed. This visualisation corresponds to Figure 2E. (D) The activity traces are presented in order from the first (top) to the last (bottom) session of the tracking. (The type of traces can be chosen by the user.) (E) Curation bar on the bottom of the window allows browsing all tracked cells to perform the manual curation. If a track is considered faulty during the manual inspection, its state can be set to zero (by clicking on the cross). (The ‘Apply curation’ is used to update the FOV visualisations by colouring all contours of tracks assigned as bad in white.) (F) Raster visualisation window allows the users to visualise the time series of the whole population and sort the rasters to show population-level features and their stability across days. Overview of the graphical user interface for interactive visualisation and curation of tracked cells. (A) The menu bar allows the users to run the Track2p algorithm (under ‘Run’), import the results of a previous run (under ‘File’), or to visualise population activity (under ‘Visualisation’; opens the raster window in F). (B) The interface displays the mean image for each day of the recording (the channel can be chosen by the user), with regions of interest (ROIs) of the cells tracked across all days overlaid. This plot allows the user to select which cell to visualise across days. This visualisation corresponds to Figure 3D. (C) Once a cell is selected, this section provides a high-magnification image of the field of view (FOV) for all days. Underneath each high-magnification image, the Suite2p index on that day (i) and the Suite2p cell probability (p) are displayed. This visualisation corresponds to Figure 2E. (D) The activity traces are presented in order from the first (top) to the last (bottom) session of the tracking. (The type of traces can be chosen by the user.) (E) Curation bar on the bottom of the window allows browsing all tracked cells to perform the manual curation. If a track is considered faulty during the manual inspection, its state can be set to zero (by clicking on the cross). (The ‘Apply curation’ is used to update the FOV visualisations by colouring all contours of tracks assigned as bad in white.) (F) Raster visualisation window allows the users to visualise the time series of the whole population and sort the rasters to show population-level features and their stability across days. Secondly, the computed transformation is applied to the ROIs from session s1 (green in Figure 2C) to align them to ROIs from session s0 (red in Figure 2C). The amount of spatial overlap after registration (yellow in Figure 2C, bottom) can indicate the accuracy of the estimated transformation between the 2 days. Assuming that the transformation is accurately estimated, ROIs corresponding to the same cells display substantial spatial overlap, with some ROIs from one recording also potentially overlapping poorly, if not at all, with any ROI from another. Thirdly, once the ROIs are aligned, the algorithm proceeds with the matching (Figure 2D). This is done by computing a spatial similarity metric (intersection over union [IoU]) between each ROI from session s0 and each transformed ROI from session s1. Matches are then assigned in a globally optimal way by maximising the sum of IoU values across all matches using a linear sum assignment algorithm (Crouse, 2016). Finally, since two consecutive sessions contain different sets of detected cells (see * in Figure 2D, bottom) and since ROIs can overlap even if the signal does not come from the same cells (see + in Figure 2D, bottom), we perform an additional filtering step on the assigned matches. Assuming that the IoU values for putative true and putative false matches come from different distributions, we would expect a bimodal distribution of IoU values across all assigned matches (see histogram in Figure 2E). To reject the putative false positives, we compute a threshold based on automatic thresholding methods (Otsu’s method; Ulman et al., 2017). This ensures that assigned matches with low spatial similarity are rejected (see + in Figure 2D and E) while the matches with high similarity are accepted (see x in Figure 2D and E). This yields the final matching for the first pair of consecutive imaging sessions (s0 and s1). In the case of more than two recordings, this tracking procedure is then iteratively applied for all consecutive pairs of sessions (s0 to s1, s1 to s2 … sN-1 to sN, and so on), with tracks being extended sequentially from s0 to sN based on the identified matches, and terminated if a match was not identified at any particular session (Figure 2F). We provide an open-source implementation of the algorithm, combined with a user-friendly GUI, allowing non-specialist users to run the algorithm and interact with its outputs (see Figure 2A top, Figure 2—figure supplement 1, and Appendix 1). Both the algorithm and the GUI come with a simple installation procedure and extensive documentation to facilitate the ease of use and accessibility of Track2p. Tracking neurons across days in the early postnatal neocortex In order to validate our method on experimental data, we next applied Track2p to a longitudinal dataset consisting of daily recordings of the same 720×720 μm2 FOV throughout the second postnatal week of mouse barrel cortex development (P8 to P14, n=7 imaging sessions from one mouse; for more details, see Methods and (Video 1)) In addition to the calcium indicator (GCaMP8m), we virally expressed a sparse anatomical marker (tdTomato) targeting GABAergic neurons using conditional expression in GAD67-Cre mice (Pachitariu et al., 2017). This dual-labelling strategy facilitated reliable FOV identification across sessions and provided an anatomical reference for Track2p’s initial cross-session registration and tracking (Figure 3, for comparison with tracking based on GCaMP8m registration, see the ‘Benchmarking on manually tracked cells’ section). Before running Track2p, each recording was preprocessed using Suite2p (Otsu, 1979) for active cell detection (segmentation) and calcium fluorescence trace extraction (see Methods). The outputs of Suite2p (ROIs, traces, and FOV images) were then used as inputs to the Track2p algorithm. Example of videography and two-photon calcium imaging data acquired throughout the second postnatal week. Note the substantial growth of the mouse, the development of the whisker pad, and opening of the eyes, and the loss of synchrony and spatial organisation in the calcium imaging data. For visualisation purposes, the videos were manually aligned using Fiji. Track2p tracks hundreds of cells throughout the second postnatal week of development in the mouse neocortex despite substantial brain growth. (A) Top left and right: Mean images of the ‘anatomical’ channel (tdTomato in GABAergic cells) for the first two imaging days (postnatal day 8 [P8] and P9). Scale bar: 100 μm. Bottom left: Overlay of the two images after registration (pseudocoloured as red and green, respectively). Bottom middle: Overlay of the regions of interest (ROIs) after registration (same colour code for P8 and P9). Bottom right: Distribution of intersection over union (IoU) values for matched pairs showing the automatic threshold (grey dashed line). (B) Same as A but for the last two imaging days (P13 and P14). (C) Nine representative examples of matches visualised in the mean ‘functional’ channel (signal from pan-neuronal GCaMP8m expression) on the first and last days of recording (P8 and P14). The blue dot indicates the centroid of the ROI. (D) Overlay of all ROIs successfully tracked across all days (N=728) on the mean ‘functional’ channel image of the first (P8, left) and last (P14, right) imaging days. Each tracked ROI is shown in the same colour across the plots. Note the expansion of the field of view (FOV) at P14 compared to P8. Scale bar: 100 μm. (E) Graph plotting the proportion (y-axis) and absolute number (grey text) of cells successfully tracked from the first day of imaging onwards. (F) Brain growth quantified as the relative increase in pairwise distances between tracked cells normalised to the first day. Grey dots represent the mean for each recording. Note: For visualisations in panels A, B, C, and D across all days, see Figure 3—figure supplement 1. Figure 3—figure supplement 1.Track2p outputs across all days for the example mouse.(A) Top: Mean field of view (FOV) of the sparse anatomical marker (tdTomato) expressed in GABAergic neurons for all days. Middle: Overlay of two neighbouring days before registration. Red: reference image, green: moving image. Bottom: Overlay after registration. (B) Histogram of intersection over union (IoU) values for all assigned region of interest (ROI) matches in each pair of subsequent recordings. Statistical threshold for filtering matches is shown with a dashed line. (C) Overlay of all ROIs successfully tracked across all days on the mean FOV image of the GCaMP8m channel for all imaging days. Each tracked ROI is shown with the same contour colour across all days. Track2p outputs across all days for the example mouse. (A) Top: Mean field of view (FOV) of the sparse anatomical marker (tdTomato) expressed in GABAergic neurons for all days. Middle: Overlay of two neighbouring days before registration. Red: reference image, green: moving image. Bottom: Overlay after registration. (B) Histogram of intersection over union (IoU) values for all assigned region of interest (ROI) matches in each pair of subsequent recordings. Statistical threshold for filtering matches is shown with a dashed line. (C) Overlay of all ROIs successfully tracked across all days on the mean FOV image of the GCaMP8m channel for all imaging days. Each tracked ROI is shown with the same contour colour across all days. The Track2p algorithm appeared to successfully register the mean FOV for each successive pair of imaging sessions (based on visual inspection of Track2p outputs; for the first and last pairs, see Figure 3A and B, bottom left; for the equivalent of Figure 3 across all days, see Figure 3—figure supplement 1A). Registering the ROIs for each pair of consecutive recordings showed a great degree of overlap for the majority of ROIs (yellow area in Figure 3A and B, bottom). We did, however, observe several ROIs that were only present in one session from the pair, likely due to differences in cell detection and developmental factors such as growth, silencing, or cell death. When matching ROIs across sessions using spatial overlap (IoU), we would expect these ROIs to show significantly lower IoU values compared to the cells that were present in both sessions. Indeed, the IoU distribution of assigned matches revealed a bimodal distribution for each pair of imaging sessions, allowing us to use classical histogram thresholding methods (Ulman et al., 2017) to clearly separate the distributions of putative true and false matches (Figure 3A and B, bottom right, Figure 3—figure supplement 1B). Propagating the putative matches yielded a total of 728 ROIs that were tracked across all days in this example mouse (out of 1988 ROIs detected in the first recording, Figure 3E). We used the subset of cells successfully tracked across all days for all our future analyses. Plotting ROIs overlaid on top of the mean image of the GCaMP8m imaging channel (Figure 3D for contours on whole FOV, C for magnified example matches) and visually inspecting the matches using the Track2p GUI indicated excellent tracking with Track2p. These visualisations also revealed the substantial growth of the neocortex during the course of the experiment (FOV area covered by ROIs at P8 compared to P14 in Figure 3D), with some cells growing out of the FOV (see top and left in Figure 3D) and the pairwise distances between matched ROIs increasing by approximately 15% (Figure 3F). Applying Track2p on an example longitudinal imaging dataset thus demonstrated that it can successfully track activity from a large number of putatively matched neurons throughout early postnatal development in mice, as confirmed by visual inspection. To assess the tracking performance in a more quantitative and objective way, we next benchmarked Track2p’s performance on manually generated ground truth for our specific experimental setting. Benchmarking on manually tracked cells In order to benchmark Track2p, expert annotators manually tracked cells across sessions (similarly as in the Cell Tracking Challenge; Sheintuch et al., 2017; Rochefort et al., 2009). Benchmarking was performed based on a dataset from three mouse pups imaged under the same experimental conditions as described in the previous section (including the dataset shown in Figure 3). For each experiment, we chose 64 homogeneously distributed ROIs detected on the first day and tracked them based on visual inspection across consecutive sessions (for more details, see Methods and Figure 4—figure supplement 1). This left us with, on average, 20 neurons per experiment that we were able to manually track across all days (‘GT’ in Figure 4). We then proceeded to compare these to cell tracks identified by Track2p. For the purposes of evaluation, we used a fully automatic tracking procedure (without manual curation and with default Track2p parameters). Evaluation of tracking performance on a manually tracked ground truth dataset during the second postnatal week of development in the mouse neocortex. (A) A schematic representation of possible cases when comparing ground truth tracks (GT, solid lines) with those reconstructed by Track2p (T2P, dashed lines). The CT metric favours perfect matches (top row) and penalises all types of mismatches (bottom four rows). (B) Graph showing the CT score for all three GT datasets across evaluated conditions. Mean CT scores of 0.93, 0.91, 0.22, and 0.00 for ‘Anatomical’, ‘Functional’, ‘Rigid’, and ‘CellReg’, respectively. Blue denotes the example mouse illustrated in Figure 3. (C) Proportion of fully correctly reconstructed GT traces for increasing time spans starting from postnatal day 8 (P8) for the baseline (‘Anatomical’) condition. (D, E, and F) Same as C but for the ‘Functional’, ‘Rigid’, and ‘CellReg’ conditions, respectively. Figure 4—figure supplement 1.Generating a ground truth dataset for Track2p evaluation.(A) Overlay of regions of interest (ROIs) selected for manual tracking on top of the mean image of the GCaMP8m channel on the first day of the recording for all three datasets used in the evaluation. Blue crosses indicate an 8×8 grid of equidistant points used to select ROIs for manual tracking. Contours denote the closest ROI to each point in the grid, with the number denoting the index of this ROI in the first dataset. Green ROIs denote ROIs that were manually tracked across all days, orange shows those that could not be manually tracked in at least one of the sessions. Note that green cells show a relatively homogenous distribution across the field of view (FOV). (B) Example showing the manual tracking procedure. Left: An ROI chosen for manual tracking (index 141, green circle) visualised in the Suite2p graphical user interface (GUI) on the first day of recording (postnatal day 8 [P8]). Right: The same ROI identified manually on the next day (purple circle). Surrounding contours denote other surrounding ROIs detected on that imaging day. Generating a ground truth dataset for Track2p evaluation. (A) Overlay of regions of interest (ROIs) selected for manual tracking on top of the mean image of the GCaMP8m channel on the first day of the recording for all three datasets used in the evaluation. Blue crosses indicate an 8×8 grid of equidistant points used to select ROIs for manual tracking. Contours denote the closest ROI to each point in the grid, with the number denoting the index of this ROI in the first dataset. Green ROIs denote ROIs that were manually tracked across all days, orange shows those that could not be manually tracked in at least one of the sessions. Note that green cells show a relatively homogenous distribution across the field of view (FOV). (B) Example showing the manual tracking procedure. Left: An ROI chosen for manual tracking (index 141, green circle) visualised in the Suite2p graphical user interface (GUI) on the first day of recording (postnatal day 8 [P8]). Right: The same ROI identified manually on the next day (purple circle). Surrounding contours denote other surrounding ROIs detected on that imaging day. Different metrics exist for evaluating cell tracking. Since we are aiming to track cells across all days, a robust cell tracking metric should reward perfect track matches with ground truth while imposing penalties for missed or incorrectly identified tracks. For this reason, we used a biologically inspired ‘complete tracks’ quality metric, which corresponds to the F1 score for completely reconstructed full tracks (we refer to this value as ‘CT’ according to Sheintuch et al., 2017; Rochefort et al., 2009). A CT score of 1 would correspond to perfect tracking, while a CT score of 0 would correspond to no matches or a large proportion of wrong matches (see Figure 4A and Methods for more details). Additionally, to assess tracking performance over time, we quantified the proportion of reconstructed ground truth tracks over progressively longer time intervals (first 2 days, first 3 days, etc. ‘Prop. correct’ in Figure 4C–F, see Methods). This allowed us to understand how tracking accuracy depends on the number of successive sessions, as well as at which time points the algorithm might fail to successfully track cells. Track2p was evaluated under three different scenarios and compared to the performance of a widely used algorithm developed for longitudinal tracking in the adult brain (CellReg; Tolu et al., 2010, see Methods). The initial evaluation was done using day-to-day registration based on a sparse anatomical marker (as in Figure 3). Calculating the CT score in this condition showed remarkably high tracking performance for all datasets (see ‘Anatomical’ in Figure 4B, mean CT = 0.93). To test whether a sparse marker was strictly necessary for successful tracking, we next ran the algorithm using the mean image of the GCaMP8m channel as a comparison. Interestingly, this evaluation showed a similar performance (see ‘Functional’ in Figure 4B, mean CT = 0.91), indicating that dense calcium indicator labelling alone can provide comparable tracking performance, eliminating the requirement for sparse anatomical labelling. To show the importance of a method tailored to the growing brain, we next compared the baseline tracking performance with two alternative conditions: firstly, by using Track2p without explicitly accounting for day-to-day growth, performing a rigid instead of affine registration of consecutive recordings; and secondly, by comparing Track2p to CellReg tracking (Tolu et al., 2010). In both scenarios, tracking performance significantly deteriorated compared to our baseline method (see ‘Rigid’ and ‘CellReg’ in Figure 4B, mean CT = 0.22 and CT = 0, respectively). Interestingly, however, these methods still managed to correctly reconstruct a portion of tracks across shorter age spans in certain cases (Figure 4E and F), with the performance dropping significantly for longer tracks in comparison to the baseline condition (Figure 4C and D). These comparisons demonstrate Track2p’s robust cell tracking performance in the developing brain, maintaining high accuracy over extended periods of development. However, tracking performance certainly depends on the type of experimental data (age, model system, brain area, imaging parameters, FOV alignment, etc.), hence, we also provide additional resources and documentation (https://track2p.github.io/home.html), allowing users to benchmark Track2p tracking for their particular use case. Development of firing statistics from hundreds of tracked neurons across postnatal development Having validated the performance of cell tracking, we next analysed the development of functional properties of the tracked population of neurons across the second postnatal week of mouse barrel cortex development. For this, we used a full dataset of six mice imaged daily for a minimum of 6 consecutive days within the second postnatal week (P7 to P14, see Figure 5B for summary; we used this dataset for all subsequent analyses). On average, 526 (±190 std) neurons per mouse were successfully tracked across all days using Track2p, corresponding to 33% (±11% std) of the neurons detected on the first day for each mouse. Based on the high tracking performance on ground truth (see Figure 4), we conclude that this drop is due to a failure in detection rather than tracking. During the course of the experiment, the weight of a mouse increased on average by 55% (±18% std), with the pairwise distance between neurons increasing on average by 15% (±7% std) (Figure 5C, Figure 5—figure supplement 2F). Weight was found to vary significantly across mice, as early as the first experimental day, and to correlate with brain growth (r=0.92, Figure 5—figure supplement 2F). Our robust tracking capability provides a comprehensive view of the evolution of neuronal dynamics within single mice, while also allowing us to take into account the heterogeneity of the developmental timelines across mice. Evolution of neuronal activity statistics from hundreds of tracked neurons during the second postnatal week of mouse development. (A) Raster plots showing the activity of all 728 tracked neurons as a function of time for the example mouse at postnatal day 8 (P8) (top) and P14 (bottom). Each row in the raster corresponds to the trace of a single cell with the sorting determined by their Rastermap embedding computed at P14. Grey traces underneath the raster show a metric of global motion of the mouse computed from videography (see Methods). (B) Overview of the dataset, indicating the imaging days for each mouse (left), the total number of cells successfully tracked across all recording days (N cells, right); * indicates mice used in the evaluation of the algorithm (Figure 3); blue denotes the example mouse. % cells: N cells as a proportion of all cells detected on the first day. (C) Graphs plotting mouse weight (left) and the mean pairwise distance between tracked neurons (right; normalised to P9 corresponding to the earliest common day across all mice) as a function of imaging days t. (D) Graphs plotting the distribution of calcium fluorescence event rates in all tracked neurons from the example mouse as a function of age (left), the mean value across days for all mice (middle), and a statistical comparison between the early (≤P11) and late (>P11) epochs (right). Example mouse is shown in blue; same in E, F, and G. *: Mann-Whitney U test, p=7.6 × 10–6. For standard deviation, see Figure 5—figure supplement 1G. (E) Same as D but for pairwise correlations. *: Mann-Whitney U test, p=1.8 × 10–6. For standard deviation, see Figure 5—figure supplement 1H. (F) Graphs plotting pairwise correlations as a function of anatomical distance for all pairs of tracked neurons across all ages in the example mouse (left), the estimated pairwise correlation of neighbouring neurons as a function of age for all mice (middle), and a statistical comparison across the two epochs (right). *: Mann-Whitney U test, p=2.7 × 10–7. (G) Cumulative distribution plot of the explained variance as a function of the number of principal components (PCs) for the example mouse across ages (left), number of PCs accounting for 90% of the variance as a function of age for all mice (right), and a statistical comparison across the two epochs (right). *: Mann-Whitney U test, p=4.0 × 10–6. Figure 5—figure supplement 1.Activity of tracked cells across all days for the example mouse.(A) Raster plots and simultaneously recorded mouse movements (blue traces) for all tracked neurons on each subsequent day from postnatal day 8 (P8) (top) to P14 (bottom) for the example mouse (related to Figure 4A). (B) Representative example dF/F traces of individual tracked neurons, with the trace of each neuron displayed in the same colour across days. Neurons were chosen in equal increments along the rows of the corresponding raster plots in A. Activity of tracked cells across all days for the example mouse. (A) Raster plots and simultaneously recorded mouse movements (blue traces) for all tracked neurons on each subsequent day from postnatal day 8 (P8) (top) to P14 (bottom) for the example mouse (related to Figure 4A). (B) Representative example dF/F traces of individual tracked neurons, with the trace of each neuron displayed in the same colour across days. Neurons were chosen in equal increments along the rows of the corresponding raster plots in A. Figure 5—figure supplement 2.Development of neuronal activity statistics in the tracked population of neurons for the full dataset.(A) Distributions of calcium event rates (related to Figure 5D). (B) Distributions of pairwise correlations (related to Figure 5E). (C) Pairwise correlations as a function of distance (related to Figure 5F). (D) Cumulative proportion of total variance explained by principal component analysis (PCA) (related to Figure 5G). (E) Relationship between the initial weight of each mouse and its brain growth estimated as the slope of the line of pairwise cell distances (Figure 5C). (F) Statistical comparison of mouse weight (left) and normalised mean distance between cells (right) between the two developmental epochs (related to Figure 5C). (G) Standard deviation of the calcium fluorescence event rates population of tracked neurons across days for all mice (left) and a statistical comparison between the early and late epochs (right) (related to Figure 5D). (H) Same as G but for pairwise correlations (related to Figure 5E). Development of neuronal activity statistics in the tracked population of neurons for the full dataset. (A) Distributions of calcium event rates (related to Figure 5D). (B) Distributions of pairwise correlations (related to Figure 5E). (C) Pairwise correlations as a function of distance (related to Figure 5F). (D) Cumulative proportion of total variance explained by principal component analysis (PCA) (related to Figure 5G). (E) Relationship between the initial weight of each mouse and its brain growth estimated as the slope of the line of pairwise cell distances (Figure 5C). (F) Statistical comparison of mouse weight (left) and normalised mean distance between cells (right) between the two developmental epochs (related to Figure 5C). (G) Standard deviation of the calcium fluorescence event rates population of tracked neurons across days for all mice (left) and a statistical comparison between the early and late epochs (right) (related to Figure 5D). (H) Same as G but for pairwise correlations (related to Figure 5E). The early postnatal period of cortical development studied here is characterised by the transition from synchronous calcium events recruiting many neurons to progressively more decorrelated population dynamics (Golshani et al., 2009; Mizuseki and Buzsáki, 2013). In order to visualise these global changes in our dataset of longitudinally imaged mice, we first plotted raster plots of calcium fluorescence traces as a function of time for all tracked neurons on each imaging day in our example mouse (Figure 5A for P8 and P14, all days in Figure 5—figure supplement 1A). Visual inspection of these raster plots clearly indicates the disappearance of recurring periods of highly synchronous activity from around P11 onwards, as well as a global increase in single-neuron activity rates. Accordingly, quantifying calcium event rates as a function of age indicated a gradual increase in the mean and a widening of the distribution with age (Figure 5D, Figure 5—figure supplement 2A and G, all statistical comparisons were done between an ‘early’ [≤P11] and ‘late’ [>P11] set of recordings). This evolution also signalled the transition towards long-tailed firing rate distributions, which are ubiquitous in adult brain circuits (Avitan and Stringer, 2022). Next, we analysed the distributions of pairwise correlations between activity traces from all longitudinally tracked neurons as a function of mouse age (Figure 5D, Figure 5—figure supplement 2B and H). Consistent with the disappearance of highly synchronous network events observed in the raster plots, we found a significant decrease in mean pairwise correlations, indicating a progressive decorrelation of neuronal activity (Figure 5E). The spatial distribution of pairwise correlations also evolved across days from highly correlated locally to more broadly distributed (Figure 5F), suggesting the gradual breakdown of spatially clustered cell assemblies (Wu et al., 2024). We finally turned to characterising the dominant population patterns of neural activity using principal component analysis (PCA). Interestingly, we observed an increase in the number of components required to explain a fixed amount of variance in the neural data across days, suggesting a developmental increase in dimensionality (Figure 5G), consistent with the statistics of spontaneous activity described in the adult brain (Stringer et al., 2019a). Notably, the plots of summary statistics for our entire dataset indicated a clear outlier, consistent across all quantifications (Figure 5D, E, F, and G). This outlier mouse displayed a similar but delayed developmental trajectory, compared to the other mice. Interestingly, it also showed the lowest initial weight and a less pronounced growth in weight and cortical size (Figure 5C), likely indicating a lower maturation stage at the onset of the experiments, although the contribution of other experimental factors cannot be excluded given the invasiveness of imaging surgery. To fully leverage our longitudinal approach, we next turned to comparing the functional properties of the same neurons across development, which is only possible when tracking cells across days. A marked reorganisation of the functional network structure during the second postnatal week We first examined the stability of the correlation structure, which we will refer to as ‘functional connectivity’ (FC). Two alternative possibilities could be envisaged (see Figure 6A): (i) FC could be conserved across days, meaning that a highly connected pair on a given day would remain highly connected on the next (Figure 6A, left); (ii) FC could reorganise, losing the structure from the previous day (Figure 6A, right). In the first case, the FC values for all pairs would remain similar across the 2 days (Figure 6A, bottom left), whereas in the second case, they would be different (Figure 6A, bottom right). To discriminate between the two cases, we defined an ‘FC similarity’ score for any pair of imaging days with matched neurons for a given mouse (Pearson correlation (r) across all neuron pairs, see Figure 6A, bottom). Such an FC similarity metric encapsulates a variety of possible sources of network changes, from local or long-range connectivity, intrinsic excitability to neuromodulation. Transition between two stable functional network structures during the second postnatal week of barrel cortex development. (A) Schematic explanation of the framework to compare functional connectivity (FC) across days; grey nodes represent neurons, strength of a functional connection is denoted by the opacity of the blue edge between two nodes. For a network of four neurons and a given connectivity Cd (16 connections, top), we can imagine that the connectivity on the next day (Cd+1) could be ‘conserved’ (middle left) or it could be ‘reorganised’ (middle right). A scatter plot comparing all 16 functional connections between Cd and Cd+1 would indicate a high correlation in the ‘conserved’ case (bottom left) and low correlation in the reorganised case (bottom right). We refer to this correlation as ‘FC similarity’. (B) Scatter plots of FC for three different pairs of recording days: a pair of early sessions (postnatal day 8 [P8] to P9, top left), an early and a late session (P8 to P14, top middle), and a pair of late sessions (P13 to P14, top right). Within-session FC similarity (bottom scatter plots), i.e., comparing the first and second half of an imaging session at early (P81/2 to P82/2, bottom left) and late ages (P141/2 to P142/2, bottom right). For visualisation purposes, a random subset of 200 pairs is displayed; Linear fit and r (Pearson correlation or ‘FC similarity’) are computed on all pairs; symbols next to r values indicate the same values in panels C and D. (C) FC similarity between P8 and all other days for the example mouse (left). Sigmoid fit: solid grey line; inflection point (‘transition age’, see Methods): dotted grey vertical line; linear portion of the sigmoid (‘transition time’, see Methods: two dashed grey vertical lines). Transition age (middle) and transition time (right) as a function of initial weight at P7 are plotted for all mice. (D) FC similarity matrix (left) for all pairs of recording days (off diagonal), with within-session FC similarity on the diagonal for the example mouse (left) and average FC similarity across all mice for the same period (right). (E) Box plots comparing within-day (left) or across-day (right) FC similarity for early (≤P11) and late (>P11) developmental epochs pooled across all mice. *: statistically significant; ns: not statistically significant (Kruskal-Wallis test: p=3.6 × 10–22; post hoc Mann-Whitney U tests with Bonferroni correction, ‘early within’ to ‘late within’: p=3.3 × 10–3, ‘early to early’ to ‘late to late’: p=n. s., ‘early to early’ to ‘early to late’: p=1.7 × 10–12, ‘late to late’ to ‘early to late’: p=4.2 × 10–5, for all possible comparisons, see Figure 6—figure supplement 1K). Figure 6—figure supplement 1.Stability of neural activity statistics for all mice in the dataset. Stability of neural activity statistics for all mice in the dataset. Quantifying FC similarity across two early sessions for an example animal (P8 to P9, Figure 6B, top left) indicated remarkable stability, almost identical to the FC similarity within a given imaging day session which we took as a reference (computed as FC similarity between the first and second half of a same day recording, Figure 6B, bottom left). Conversely, when comparing across more distant developmental ages, we noticed that a large part of the correlation structure was lost, resulting in lower FC similarity (P8 to P14, Figure 6B, top middle). Interestingly, FC similarity between a pair of later developmental sessions was again comparable to within-session similarity (P13 to P14 and P14 within, Figure 6B, right), indicating that the functional network structure was stable, but different from that of earlier ages. Of note, within-session stability was consistently lower later than earlier. Quantifying calcium event rate similarity across days indicated a similar pattern (see Figure 6—figure supplement 1F–J). To investigate this further, we proceeded to compute the FC similarity for all possible combinations of sessions in all mice. Interestingly, we observed a sigmoid-like decay of FC similarity when taking P8 as a reference (Figure 6C). Plotting the full FC similarity matrix for all possible combinations of sessions also indicated two stable FC regimes with seemingly two blocks along the diagonal (Figure 6D, left for example, Figure 6D right for average, and Figure 6E for statistical comparison). Interestingly, the sharpness of the transition in FC varied across mice (Figure 6—figure supplement 1C) and could in part be explained by the weight of the mouse at the onset of the experiment (Figure 6C, linear part of sigmoid fit). Such variation across mice could reflect either inherent individual differences in developmental processes or experimental factors, where mice with a lower initial weight may have experienced delayed development due to higher sensitivity to the imaging procedure. Altogether, our analyses indicate that the second postnatal week marks a transition between two stable functional network structures in the barrel cortex of developing mice. Additionally, this shows how tracking cells during development opens new analysis possibilities using self-referencing between neurons, providing new insights into how the developmental choreography unfolds in the same population of neurons across days. Developmental emergence of stable behavioural state modulation As a first attempt to investigate the mechanisms underlying this network transition, we examined neural activity in relation to behavioural state. The second postnatal week marks the emergence of active sensation, suggesting that changes in arousal state modulation might drive this network reorganisation. In the adult cortex, arousal strongly shapes both global firing rates and neural correlations (Benisty et al., 2024; Niell and Stryker, 2010; Gentet et al., 2010; Stringer et al., 2025), making it a promising candidate for orchestrating the developmental shift we observed. To this aim, we sorted the neurons based on the similarity of their activity patterns, using Rastermap (Lütcke et al., 2013), and examined the relationship between neuronal activity and behavioural states. We assessed behavioural state indirectly using the videos capturing spontaneous mouse movement and quantifying them using a ‘motion energy’ metric (as in Benisty et al., 2024, for more details, see Methods). Interestingly, this sorting revealed a subpopulation of neurons that were highly correlated with the animal’s motion at later, but not earlier, developmental stages (Figure 5A, see Figure 5—figure supplement 1A for all days). We first quantified this relationship by computing the temporal correlation between the first principal component of neuronal activity and the animal’s motion. Interestingly, this correlation showed a steep increase after P11 for most mice (Figure 7D). This suggested that global fluctuations in neural activity are more strongly modulated by active movement at later than earlier developmental stages. Regression analysis to study the development and stability of neural representations. (A) Left: A decoding model is fitted on each day to predict a behavioural variable (y, mouse motion) from the simultaneously recorded calcium imaging data (X, activity raster). Right: The model is then tested on the same day (using cross-validation) to assess the encoding of the variable on that given day. (B) Overlay of animal’s motion (grey) and the predicted signal from neural activity (green) fit on the same day for example early (postnatal day 8 [P8], top) and late recordings (P14, bottom). Symbols indicate the corresponding R2 values in panels C and G. Only the first 5 min of the recording are shown for visualisation purposes; for full traces of all recordings, see Figure 7—figure supplement 1. (C) Graphs indicating R2 values for same-day cross-validated decoding performance as a function of mouse age. Green indicates the example mouse (also in D). (D) Graph plotting the correlation between the animal’s motion and the first principal component signal across days (left) and a statistical comparison of the early (≤P11) and late (>P11) epochs (right). *: Mann-Whitney U test, p=1.2 × 10–3. (E) Left: Same as in A, an individual model is fitted on each day. Right: To assess the stability of the representation, each model is tested across different days, which is only possible when tracking neurons across sessions. (F) Same as B but for examples of cross-day decoding early to early (P9 to P8), late to late (P13 to P14), and early to late (P8 to P14). Symbols indicate the corresponding R2 values in panel G. (G) Full prediction performance matrix showing R2 values for all combinations of fit and test datasets (rows and columns, respectively) for the example mouse (left) and average across all mice for the same period (right). Diagonal entries correspond to same-day decoding, off-diagonal entries to cross-day recording. (H) Box plots comparing R2 values for same-day (left) or across-day (right) decoding for early (≤P11) and late (>P11) developmental epochs pooled across all mice. *: Statistically significant; ns: not statistically significant (Kruskal-Wallis test: p=4.5 × 10–10; post hoc Mann-Whitney U tests with Bonferroni correction, ‘early within’ to ‘late within’: p=1.6 × 10–3, ‘early to early’ to ‘late to late’: p=6.5 × 10–6, ‘early to early’ to ‘early to late’: p=ns, ‘late to late’ to ‘early to late’: p=2.4 × 10–5; for all possible comparisons, see Figure 7—figure supplement 1I). Figure 7—figure supplement 1.Relationship between spontaneous behaviour and neural activity for all mice in the dataset.(A) Cross-validated same-day prediction for all recording days in the example mouse (related to Figure 6B and C). (B) Prediction of a decoder fit on postnatal day 14 (P14) across all days (related to Figure 6F and G). (C) Prediction of a decoder fit on P8 across all days (related to Figure 6F and G). (D) Example dF/F trace of a highly predictive neuron for a model fit at P14. Notice that the activity closely corresponds to the movement trace also on two earlier days (P12 and P13). (E) Full matrices of R2 values for all combinations of train and test recordings in each mouse. Example mouse (*). (F) Mean R2 matrix averaged across all mice in the dataset. (G) Box plots of the distribution of individual R2 values in different conditions pooled across mice (same as Figure 5E). (H) Statistical significance of pairwise comparisons of data from G. (I) p-Values for all statistical comparisons of decoder performance for all comparisons (related to D and E in this figure and Figure 7H). Relationship between spontaneous behaviour and neural activity for all mice in the dataset. (A) Cross-validated same-day prediction for all recording days in the example mouse (related to Figure 6B and C). (B) Prediction of a decoder fit on postnatal day 14 (P14) across all days (related to Figure 6F and G). (C) Prediction of a decoder fit on P8 across all days (related to Figure 6F and G). (D) Example dF/F trace of a highly predictive neuron for a model fit at P14. Notice that the activity closely corresponds to the movement trace also on two earlier days (P12 and P13). (E) Full matrices of R2 values for all combinations of train and test recordings in each mouse. Example mouse (*). (F) Mean R2 matrix averaged across all mice in the dataset. (G) Box plots of the distribution of individual R2 values in different conditions pooled across mice (same as Figure 5E). (H) Statistical significance of pairwise comparisons of data from G. (I) p-Values for all statistical comparisons of decoder performance for all comparisons (related to D and E in this figure and Figure 7H). Finally, we asked whether behavioural state could be decoded from population activity dynamics using regression analysis. Despite substantial variability, the same-day decoding performance increased with development (Figure 7A–C). Since we tracked the same neurons across days, we could also probe the stability of this representation across days, by fitting a model on 1 day and testing it on all other days (cross-day decoding, Figure 7E–H, Figure 7—figure supplement 1B and C; Ziv et al., 2013; Lütcke et al., 2013). Interestingly, this analysis showed that, once developed, this representation was indeed stable, allowing for accurate cross-day decoding, with the same neurons showing either consistently positive or negative modulation across days (see Figure 7—figure supplement 1D for the activity traces of an example cell with a high weight for decoding). Hence, by combining Track2p longitudinal cell tracking with decoding approaches, one can systematically map the emergence and stability of cortical representations in the developing brain. Discussion Here, we described Track2P, a cell tracking algorithm that can be used to follow the changing dynamics of hundreds of matched neurons from daily calcium imaging recordings in the growing brain of living mouse pups. At the core of the method lies sequential affine registration followed by cell matching for each subsequent pair of recordings, which leads to a better tracking performance during development when using Track2p compared to other methods. Using this benchmarked approach, we observed a sharp developmental transition from highly synchronised activity to multidimensional, behaviour state-dependent neural dynamics. Beyond this key finding, our method opens a much-needed tool for investigating the developmental functional trajectories of individual neurons during early postnatal brain development, and their deviations caused by genetic mutations or environmental perturbations. Developing and benchmarking Track2p showed that it is able to track large populations of neurons despite substantial brain growth and other developmental changes through extended periods of time during development. We suggest this is mostly due to affine transform being a good approximation of the growth processes that occur between 2 consecutive days of imaging, with the cell matching step allowing to account for slight non-linearities in tissue growth day-by-day. Currently available methods typically register all imaging FOVs to a single reference, which we believe results in the accumulation of non-linearities, making registration more difficult and resulting in poorer tracking performance. From a practical perspective, Track2p reduces manual cell tracking time by transforming a tedious process of manual annotation into a fast and automated procedure. Indeed, considering the time needed for manually tracking all cells in our dataset, we estimate that it would require approximately 5 person-days (120 hr) of work per subject under our experimental conditions, highlighting the necessity of automatic tracking in large-scale calcium imaging recordings. To aid future research, we provide Track2p fully open-source, with substantial documentation and an accompanying GUI facilitating the use of the algorithm by users without previous coding knowledge. Besides developing the algorithm, we also showcase analysis techniques that can be used to gain unique insights from longitudinal calcium recordings, drawing inspiration from previous research studying plasticity, learning, and representational drift in the adult brain (Ziv et al., 2013; Driscoll et al., 2017; Colonnese, 2014). We specifically highlight: (1) quantifications of functional statistics of the tracked population across days (Figure 4); (2) correlation analyses to compare these across days (Figure 5); (3) regression analyses to study the emergence and stability of neural representations across recording days (Figure 6). Last, we would like to emphasise that this analytical advancement is grounded on optimised experimental procedures to image daily cortical dynamics through a glass window mounted on the developing pup head. Previous studies had described adaptations of the surgical procedure or head fixation to developing pups (Che and De Marco García, 2021); however, by measuring the increase in pairwise distance between tracked neurons as a function of age per animal, we now provide a quantitative metric to estimate the invasiveness of the procedure. Interestingly, we observed a growth rate that closely matched ex vivo quantifications (Thompson et al., 2014), indicating a minimal impact of our experimental preparation on anatomical brain growth, also confirmed by mouse weight measurements. While we observed a slightly slower weight gain in imaged pups compared to their littermates, further investigation is needed to definitively assess whether repetitive daily imaging might influence cognitive developmental trajectories, e.g., through maternal separation. Applying these techniques in our dataset during early postnatal development, we observed a significant and fast change in the nature of neuronal dynamics and state modulation in the barrel cortex, centred on P11, that manifests in several ways: (1) an increase in activity rates; (2) a decrease in pairwise correlations; (3) a shift from locally clustered to widely distributed correlations; (4) an increase in the dimensionality of spontaneous activity; (5) a remapping of the functional pairwise correlation structure; and (6) the emergence of a stable representation of spontaneous active movement. If the first three changes had already been described previously in different cortical areas (Wu et al., 2024; Golshani et al., 2009; Mizuseki and Buzsáki, 2013; Stringer et al., 2019a; Colonnese et al., 2010; Dard et al., 2022; Mòdol et al., 2024; Rio‐Bermudez and Blumberg, 2021), the last two could not be observed without the dense longitudinal tracking of the same neurons across several days in the growing brain permitted by Track2P. This multifaceted transition likely reflects several concurrent developmental processes, including changes in sleep architecture and neuromodulatory tone (Dard et al., 2022; Ahmad et al., 2024; Marques-Smith et al., 2016; Anastasiades et al., 2016), maturation and rewiring of local inhibitory circuits (Bollmann et al., 2023; Modol et al., 2020; Colonnese et al., 2010; Rio‐Bermudez and Blumberg, 2021; Tuncdemir et al., 2016; Chini et al., 2022; Gribizis et al., 2019; Minlebaev et al., 2011) or disengagement from peripheral sensory inputs (Dard et al., 2022; Shen and Colonnese, 2016). This postnatal spurt is correlated with sparsification, disappearance of the spindle-burst oscillations, and increase in dimensionality of the representations (Golshani et al., 2009; Mizuseki and Buzsáki, 2013; Stringer et al., 2019a; Colonnese et al., 2010; Dard et al., 2022; Micheva and Beaulieu, 1996; Luhmann and Khazipov, 2018; Blumberg et al., 2022; Tiriac et al., 2014). Such drastic and fast changes are accompanied by significant behavioural changes, maybe the most salient ones being the change in the nature and duration of sleep, as well as the start of active exploration (Tiriac and Blumberg, 2016). The start of behavioural state modulation and dimensionality increase could reflect the same phenomenon by which spontaneous motor behaviour, including facial movements, drives multidimensional brainwide activity in the adult visual cortex (Benisty et al., 2024). This representation is present and stable from P11 onwards, as revealed using our decoding approach. The early absence of representation of spontaneous motor behaviour is in agreement with the previously reported lack of reafferent brain activity in response to self-generated wake movement until P11 (Dooley and Blumberg, 2018; Khazipov et al., 2004; Inacio et al., 2023). Thus, although we did not explicitly distinguish here between sleep and wake-generated movements, it is likely that the ‘motion energy’ metric combined with the decoding mostly took into account wake behaviour, given the long periods of motor activity observed. Hence, we cannot exclude that twitching activity occurring during active sleep could contribute to an earlier representation of spontaneous motion, as reported previously (Domínguez et al., 2021). More refined behavioural analysis, particularly of sleep-wake transitions and twitches, could provide additional insights. Therefore, the mid-second postnatal week marks a transition between two stable FC structures, indicating that globally, early and late functional connectivities differ. However, singular developmental trajectories cannot be excluded. Future studies could examine whether different cell types transition at different times or different paces, e.g., depending on their time of birth (Cossart and Garel, 2022), or whether unique neurons, such as hub cells, could maintain exceptional and stable FC (Bollmann et al., 2023). One population of particular interest for tracking is the neurons that contribute the most to behavioural prediction. Indeed, these could form a distinct population of movement-correlated neurons embedded in specific wiring schemes, as recently demonstrated (Tasnim et al., 2024). This developmental transition centred around P11, which corresponds roughly to birth in human brain development, spans a period between 1 and 4 days, depending on the initial weight of the imaged pup. This transition may not yet be the last step before a mature adult-like network but instead represent a transient state (Ratsifandrihamanana et al., 2023) preceding the emergence of mature activity patterns. Its timing, correlated with animal weight, suggests it may represent a conserved developmental milestone. Hence, comparative studies across brain regions and species, including potential parallels in human development, would be valuable. We believe that combining Track2p tracking and the analysis methods described here provides a template for future investigations of more complex developmental phenomena, such as the emergence of sensory representations and cognitive functions. Also, longitudinal imaging uniquely enables investigation of activity-dependent development, including how early activity patterns predict later functional properties and assembly formation of the same cells. Indeed, there is nothing precluding further studies to continue tracking the activity of the same cells until adulthood. Additionally, this approach opens possibilities for targeted manipulation studies to examine how early perturbations affect subsequent circuit development. The ability to track the same cells throughout early postnatal development should thus open doors to entirely new classes of experiments not possible before, providing deeper mechanistic insights into developmental principles and pathologies. This is even more important considering that alterations of developmental trajectories at early postnatal time points are starting to be pointed out as the roots for many developmental disorders (Wu et al., 2024; Stringer et al., 2019b). Resource availability All code is available at the Track2p repository: https://github.com/juremaj/track2p (copy archived at Mantez and Majnik, 2025) with more extensive documentation and demos available at: https://track2p.github.io/home.html. The data, including preprocessed neural data for the tracked cells, behavioural data, and ground truth data for cell tracking, are available at: https://zenodo.org/records/17091226. Methods Data acquisition Animals All experimental procedures were approved by the French ethics committee (Ministère de l'Enseignement Supérieur, de la Recherche et de l’Innovation [MESRI]; Comité d’éthique CEEA-014; APAFiS # 30716-2021032215171216 v8) and conducted in agreement with the European Council Directive 86/609/EEC. GAD67-Cre mice were kindly donated by Dr. Hannah Monyer (Heidelberg University). Mice were bred and stored in an animal facility with room temperature (RT) and relative humidity maintained at 22 ± 1°C and 50 ± 20%, respectively. Mice were provided ad libitum access to water and food. A total of six mice were used in the study, all heterozygous GAD67-Cre transgenics. Virus injections We performed viral injections at P0 as previously described (Ntatsis et al., 2023). Briefly, we prepared a solution of AAV-hSyn-GCaMP8m and AAV-FLEX-tdTomato (2:1 volumetric ratio, 1012 genome copies per millilitre; Addgene) with a small volume (10:1) of 0.05% trypan blue (T8154 Sigma) to verify the success of the injection. We then briefly anaesthetised the mouse on ice and injected 2 μL of the solution in the right lateral ventricle using a glass micropipette. Pups were left to recover on a heating pad at 37°C before being returned to the dam. Cranial window surgery All procedures were performed as in Bollmann et al., 2023. Surgeries were performed at P7 for all mice. Briefly, betadine and lidocaine cream were applied topically, covering the area of the intended incision. Isoflurane was used for induction of global anaesthesia and maintained via a nose cone throughout the procedure. A heating pad was used to maintain body temperature. After skin removal, a head plate (4 mm inner diameter, Luigs and Neumann) was fixed to the part of the skull covering the barrel cortex using glue (SuperGlue3) and Super Bond (DSM Dentaire). A craniotomy was performed within the head plate opening before finally applying a thin layer of Kwik-Sil (WPI) to the surface of the dura and covering it with a glass cover slip (3 mm, Warner Instruments). The cover slip was last fixed to the headplate and the skull again using glue and Super Bond. Mice were left to recover on a heating pad at 37°C for at least 1 hr before returning them to the home cage. Chronic two-photon calcium imaging Longitudinal two-photon calcium imaging was performed for each mouse for at least 6 consecutive days (see Figure 5 for details). Imaging was performed using a Bruker (Ultima 2P) microscope with a Coherent Mai-Tai excitation laser (950 nm excitation light) and a 16× Nikon objective (NA 0.8). Before detection, emitted light was split into two optical paths, each associated with a filter (red and green, 580–620 and 500–550 nm, respectively), allowing us to simultaneously record the GCaMP8m and the tdTomato signal. The acquisition was performed using the Prairie View software. All recordings were performed in layer 2/3 (depth between 100 and 200 µm from the pial surface) with a 720×720 µm2 FOV and 512×512 pixel resolution. Imaging rate was 30 Hz (resonant scanner) and each session lasted 20 min. All experiments were performed in the dark, under sensory-minimised conditions, with mice being free to spontaneously run on a non-motorised treadmill (Luigs and Neumann). To facilitate alignment and cell tracking, we kept the alignment of the head mount with respect to the microscope fixed across all sessions for the same mouse. To record from the same region across days, we manually aligned the imaging plane in x, y, and z to best match the reference images of the red channel (tdTomato) from all previous recording days. During the course of each recording, pups were kept warm by a heating element mounted to the imaging setup. After each imaging session, the pups were returned to their home cage with the dam and their littermates. Videography All videography was performed using a Basler camera (Basler ACE2 1920), with an infrared LED light source (ThorLabs 850 nm) pointed at the mouse. Videos were recorded at 30 Hz, with the microscope acquisition acting as a trigger for camera frame acquisition, also allowing for simple synchronisation across the two modalities. All acquisition was done using custom Python scripts using the PyPylon wrapper for the Basler camera software (Pylon Camera Software Suite, https://github.com/basler/pypylon; Möller et al., 2025). Processing of calcium imaging data Calcium imaging data was preprocessed using the Suite2p pipeline, sequentially performing motion correction, ROI detection, signal extraction, and spike deconvolution (Otsu, 1979) for each recording separately. Suite2p additionally provides a cell classification feature, providing a probability of a classifier categorising an ROI as being a true cell. We considered all ROIs above the default threshold of 0.5 as true cells. We used baseline-corrected fluorescence traces as our dF/F (using the default Suite2p parameters) for all subsequent analyses. To facilitate the use of Track2p with other preprocessing pipelines, we implemented a data loader that takes as input three simple NumPy arrays corresponding to ROIs, FOV, and traces (for more information, see https://track2p.github.io/run_inputs_and_parameters). Preprocessing videography We used the global movements of the mouse as a proxy of its arousal state. Similarly to Crouse, 2016, we quantified these by looking at the pixel-wise difference of consecutive frames in the videography recording. Namely, we first took each two consecutive frames and computed their pixel-wise difference. We then squared all individual pixel-wise values and summed across pixels. This yielded a scalar value quantifying the motion of the mouse at each time point, which was used for all subsequent analyses. Cell tracking Image and ROI registration As explained in the main text, Track2p aligns the ROIs based on mean FOV image registration. The implementation allows the user to choose which channel to use for computing the transformation (‘anatomical’ or ‘functional’ channel), as well as which types of transformation to estimate (rigid or affine). Unless otherwise stated, we used the ‘anatomical’ (tdTomato in GAD67-Cre expressing cells) channel with affine transformation (referred to as the ‘baseline’ condition). For the purposes of evaluation, we additionally ran tracking using the functional channel with affine registration (‘functional’ in Figure 4) and using the anatomical channel with rigid registration (‘rigid’ in Figure 4). Once registering the images, we applied the same transform to all ROIs from the subsequent session that were considered as cells (see main text). All Track2p image registration is done using the itk-elastix toolbox (Varoquaux et al., 2017). Cell matching Cell matching was done in a way to maximise the sum of the IoU across all matches of ROIs between two sessions. For this reason, we defined a cost matrix M with entries corresponding to:Mi,j=1−IoU(rsk,i,r`sk+1,j)\begin{document}$$\displaystyle M_{i,j}=1- IoU\left (r_{sk,i},r^{'}_{s_{k+1},j}\right)$$\end{document} where rs_k, i is the ith ROI in session sk and r’s_(k+1), j is the jth ROI in the subsequent session sk+1 after registering it to the coordinate system of sk. Assigning matches between the two sets of ROIs in this way corresponds to a linear sum assignment problem, with the goal to find a matrix X that yields the optimal assignment cost:minX∑i=1ms∑j=1ms+1Mi,jXi,j\begin{document}$$\displaystyle \underset{X}{min}\sum _{i=1}^{m_{s}}\sum _{j=1}^{m_{s}+1}M_{i,j}X_{i,j}$$\end{document} where Xi,j equals 1 if and only if ROI rs,i is assigned to rs+1,i and 0 otherwise. Additionally, since the number of ROIs is not necessarily the same across two sessions, M and X are not necessarily square. In this case, if there are more rows than columns, then not every row needs to be assigned to a column, and vice versa. We solve this problem by using the algorithm described in Glaser et al., 2020, and implemented in SciPy. Additionally, some of the matches can be putative false positives. To avoid this issue, we use an approach similar to the one described in Tolu et al., 2010, using a statistical threshold to filter matches based on their IoU distribution. To do this, we use the Skimage implementation of Otsu’s method applied to the IoU histogram (Ulman et al., 2017). Generating a ground truth dataset Since manually tracking all cells would require prohibitive amounts of time (see Discussion), we decided to generate sparse manual annotations, only tracking a subset of all cells from the first recording day onwards. To do this, we took the first recording (s0), and we defined a grid of 8×8 (64) equidistant points over the FOV and, for each point, identified the closest ROI in terms of Euclidean distance from the median pixel of the ROI (see Figure 4—figure supplement 1A). We then manually tracked these 64 ROIs across subsequent days. The manual tracking was done using the Suite2p GUI, by visualising the FOV and masks from two recordings side by side and choosing the matching ROI from the subsequent recording or terminating the track if we could not find a match (see Figure 4—figure supplement 1B). Only neurons that were detected and tracked across all sessions were taken into account and referred to as our ground truth dataset (‘GT’ in Figure 4). When comparing the GT to Track2p tracks, we only considered Track2p tracks that originated from one of the 64 ROIs chosen for evaluation initially. All manual tracking was performed blind to the Track2p outputs. Tracking evaluation metrics For the evaluation of Track2p under different conditions and comparison to CellReg, we used the ‘Complete tracks’ metric (Sheintuch et al., 2017; Rochefort et al., 2009, Figure 3B), defined as:CT=2⋅TrcTc+T\begin{document}$$\displaystyle CT=\frac{2\cdot T_{rc}}{T_{c}+T}$$\end{document} where Trc is the number of perfectly reconstructed tracks, Tc is the number of total tracks identified by Track2p for the 64 s0 ROIs chosen for manual tracking, and Tgt is the number of total tracks in the ground truth dataset (from the same 64 s0 ROIs). In the case of perfect tracking, CT will be equal to 1 (where all computed tracks are equivalent to the ground truth tracks [Trc = Tc = Tgt]). Conversely, in the case of failed tracking, the value of CT will be close to 0 (e.g. when there is a poor match between ground truth and reconstructed tracks [Trc≈0] or when there are many falsely reconstructed tracks not present in the ground truth [Tc >>Tgt]). The CT metric is mathematically equivalent to an F1 score where true positives are defined as perfectly reconstructed tracks (Figure 4A, row 1), false negatives as tracks from GT without a match in Track2p (Figure 4A, row 2) and false positives as tracks from Track2p without a match in GT (Figure 4A, rows 3, 4, and 5). In the final step of evaluation, we looked at when the algorithms from the original evaluation failed in their tracking of the ground truth neurons. For this, we used a metric of the proportion of correctly reconstructed tracks for an increasingly longer number of sessions (s) (referred to as ‘Prop. correct’ in Figure 4C–F):Trc(s)=Trc(s)T\begin{document}$$\displaystyle T_{rc}\left (s\right)=\frac{T_{rc}\left (s\right)}{T}$$\end{document} where Tgt is equivalent as above and Trc(s) is equivalent as Trc but for full tracks up to session s. Since in this case we kept the GT consistent with the initial evaluation, including only the neurons identified across all days, this metric is agnostic to possible false positives at shorter time epochs. To facilitate evaluation by individual users under different experimental conditions, we provide a helper script (Jupyter notebook) aiding the whole evaluation process by both defining a grid of cells to manually track (see previous section), as well as to compute the tracking quality metrics once the ground truth dataset is completed. CellReg tracking To compare Track2p with CellReg, we ran the MATLAB implementation of CellReg tracking (https://github.com/zivlab/CellReg; Sheintuch, 2024) according to the provided user manual. We first attempted tracking using the default rigid registration, which yielded an error, terminating the algorithm and indicating that subsequent sessions do not resemble the reference session and suggesting to use non-rigid registration. We then re-launched the algorithm with non-rigid registration and used those results to evaluate the tracking the same way as for Track2p (see Results). Notably, even when running CellReg using non-rigid registration, we noticed that the algorithm did not find any tracks spanning all days (Trc = 0), which explains the CT score of 0 for all day evaluation. Functional properties of tracked neurons Calcium event rates To quantify the calcium event rate statistics, we used SciPy’s peak detection algorithm (Python). For this, we first denoised the traces slightly by averaging using a bin size of 10 frames and then proceeded to detect any peaks with a height and prominence of at least one standard deviation. We then calculated the rate as the number of peaks per minute within the recording. When quantifying the stability of the rates across days, we computed the Pearson correlation coefficient across all neurons for each possible combination of sessions recorded from the same mouse. Pairwise correlations and PCA We quantified pairwise correlations by computing the Pearson correlation between the full traces of all pairs of simultaneously recorded neurons within each session. To quantify the spatial properties of pairwise correlations, we additionally calculated the Euclidean distance between ROI centroids for each corresponding pair of neurons. When plotting the pairwise correlations as a function of pairwise distance, we averaged in bins of 30 µm. The correlation of neighbouring neurons was estimated as the intercept of an exponential fit to the full data. When comparing the stability of the correlation structure across days, we refer to this as ‘FC stability’, which we calculate as the Pearson correlation between all pairs of original correlation matrices for a given mouse. When fitting a sigmoid using the first day as the reference, we fix the upper limit of the sigmoid to within-day FC stability for that day and leave the other parameters free. We calculate the inflection point (‘transition age’) and the linear portion (‘transition time’) of the sigmoid using the extrema of the first and fourth derivatives, respectively. For PCA, we used the scikit-learn implementation (Pedregosa et al., 2012, Python). Decoding All decoding was done using linear regression with ridge regularisation (ridge regression) to avoid overfitting given the large number of neurons. Ridge regression optimises the weights (β) that minimise the following loss function:L(β)=‖y−Xβ‖22+λ‖β‖22\begin{document}$$\displaystyle \mathcal{L}(\boldsymbol{\beta}) = \|\mathbf{y} - \mathbf{X}\boldsymbol{\beta}\|_2^2 + \lambda \|\boldsymbol{\beta}\|_2^2$$\end{document} where in our case y is behavioural data, X is neural data, and λ is a regularisation parameter. To choose the optimal λ and to reliably estimate the model performance on same-day decoding, we used nested cross-validation (see for example Varoquaux et al., 2017; Glaser et al., 2020), ensuring data efficiency and a splitting between training, validation, and test data. Briefly, a grid search for the optimal λ is performed by using the training set to fit models with different λ values and choosing the value corresponding to the model with the best performance on the held-out validation set (model selection). This model is then evaluated on the test data that was used neither in model fitting nor in the hyperparameter optimisation (model evaluation). To ensure data efficiency, nested cross-validation repeats this procedure for all possible splits of the data, with an outer cross-validation loop used for model evaluation and an inner loop for model selection. We used fivefold splits for both the inner and outer loops; splits were done on consecutive 2 min blocks of the recording. For cross-day decoding, we fit a new model with the optimal lambda for that given day and evaluated it on all other days. For all decoding analysis, we slightly denoised the dF/F, as well as the behaviour traces by averaging in bins of 10 consecutive timestamps. All models were implemented and fitted using PyTorch (Python). This fundamental study presents a new method for longitudinally tracking cells in two-photon imaging data that addresses the specific challenges of imaging neurons in the developing cortex. It provides compelling evidence demonstrating reliable longitudinal identification of neurons across the second postnatal week in mice. The study should be of interest to development neuroscientists engaged in population-level recordings using two-photon imaging. Summary: This manuscript presents a compelling and innovative approach that combines Track2p neuronal tracking with advanced analytical methods to investigate early postnatal brain development. The work provides a powerful framework for exploring complex developmental processes such as the emergence of sensory representations, cognitive functions, and activity-dependent circuit formation. By enabling the tracking of the same neurons over extended developmental periods, this methodology sets the stage for mechanistic insights that were previously inaccessible. Strengths: (1) Innovative Methodology: The integration of Track2p with longitudinal calcium imaging offers a unique capability to follow individual neurons across critical developmental windows. (2) High Conceptual Impact: The manuscript outlines a clear path for using this approach to study foundational developmental questions, such as how early neuronal activity shapes later functional properties and network assembly. (3) Future Experimental Potential: The authors convincingly argue for the feasibility of extending this tracking into adulthood and combining it with targeted manipulations, which could significantly advance our understanding of causality in developmental processes. (4) Broad Applicability: The proposed framework can be adapted to a wide range of experimental designs and questions, making it a valuable resource for the field. Weaknesses: None major. The manuscript is conceptually strong and methodologically sound. Future studies will need to address potential technical limitations of long-term tracking, but this does not detract from the current work's significance and clarity of vision Comments on revisions: I have no further requests. I think this is an excellent manuscript Summary: The manuscript by Majnik and colleagues introduces "Track2p", a new tool designed to track neurons across imaging sessions of two-photon calcium imaging in developing mice. The method addresses the challenge of tracking cells in the growing brain of developing mice. The authors showed that "Track2p" successfully tracks hundreds of neurons in the barrel cortex across multiple days during the second postnatal week. This enabled identification of the emergence of behavioral state modulation and desynchronization of spontaneous network activity around postnatal day 11. Strengths The authors have satisfactorily addressed the majority of our questions and comments, and the revisions substantially improve the manuscript. The expansion of Track2p to accept general NumPy array inputs makes the tool more accessible to researchers using different analysis pipelines. While the absence of benchmarking standards remains a limitation across the field, the release of the ground-truth dataset is an important step forward that will allow other researchers to evaluate and compare algorithms. Minor point (1) The authors tested the robustness of the algorithm across non-consecutive days. As expected, performance drops significantly under these conditions. We agree that this limitation reflects biological constraints due to brain growth rather than shortcomings of the algorithm itself. This is relevant for researchers planning to use Track2p for longitudinal imaging or benchmarking new algorithms, and we recommend including some of this information in the Supplementary Information along with a brief discussion. Comments on revisions: We acknowledge the extended documentation for using Track2p and converting between Suite2p outputs and NumPy arrays. This addition is of great utility. We would also suggest further expanding the documentation for the NumPy array implementation, as we ran into some errors when testing this feature using NumPy arrays generated from deltaF traces, TIFF FOVs, and Cellpose masks. Summary: In this manuscript Majnik et al. developed a computational algorithm to track individual developing interneurons in the rodent cortex at postnatal stages. Considerable development in cortical networks takes place during the first postnatal weeks, however, tools to study them longitudinally at a single cell level are scarce. This paper provides a valuable approach to study both single cell dynamics across days and state-drive network changes. The authors used Gad67Cre mice together with virally introduced TdTom to track interneurons based on their anatomical location in the FOV and AAVSynGCaMP8m to follow their activity across the second postnatal week, a period during which the cortex is known to undergo marked decorrelation in spontaneous activity. Using Track2P, the authors show feasibility to track populations of neurons in the same mice capturing with their analysis previously described developmental decorrelation and uncovering stable representations of neuronal activity, coincident with the onset of spontaneous active movement. The quality of the imaging data is compelling, and the computational analysis is thorough, providing a widely applicable tool for the analysis of emerging neuronal activity in the cortex. Below are some points for the authors to consider. Major points The authors use a viral approach to label cortical interneurons. It is unclear how Track2P will perform in dense networks of excitatory cells using GCaMP transgenic mice. The authors used 20 neurons to generate a ground truth data set. The rational for this sample size is unclear. Figure 1 indicates capability to track ~728 neurons. A larger ground truth data set will increase the robustness of the conclusions. It is unclear how movement was scored in the analysis shown in Fig 5A. Was the time that the mouse spent moving scored after visual inspection of the videos? Were whisker and muscle twitches scored as movement or was movement quantified as amount of time in which the treadmill was displaced? The rational for binning the data analysis in early P11 is unclear. As the authors acknowledged, it is likely that the decoder captured active states from P11 onwards. Because active whisking begins around P14, it is unlikely to drive this change in network dynamics at P11. Does pupil dilation in the pups change during locomotor and resting states? Does the arousal state of the pups abruptly change at P11? Comments on revisions: The authors have addressed carefully all my comments. This is an interesting paper. The following is the authors’ response to the original reviews. Reviewer #1 (Public review): We thank the reviewer for very enthusiastic and supportive comments on our manuscript. Summary: This manuscript presents a compelling and innovative approach that combines Track2p neuronal tracking with advanced analytical methods to investigate early postnatal brain development. The work provides a powerful framework for exploring complex developmental processes such as the emergence of sensory representations, cognitive functions, and activity-dependent circuit formation. By enabling the tracking of the same neurons over extended developmental periods, this methodology sets the stage for mechanistic insights that were previously inaccessible. Strengths: (1) Innovative Methodology: The integration of Track2p with longitudinal calcium imaging offers a unique capability to follow individual neurons across critical developmental windows. (2) High Conceptual Impact: The manuscript outlines a clear path for using this approach to study foundational developmental questions, such as how early neuronal activity shapes later functional properties and network assembly. (3) Future Experimental Potential: The authors convincingly argue for the feasibility of extending this tracking into adulthood and combining it with targeted manipulations, which could significantly advance our understanding of causality in developmental processes. (4) Broad Applicability: The proposed framework can be adapted to a wide range of experimental designs and questions, making it a valuable resource for the field. Weaknesses: No major weaknesses were identified by this reviewer. The manuscript is conceptually strong and methodologically sound. Future studies will need to address potential technical limitations of long-term tracking, but this does not detract from the current work's significance and clarity of vision. Reviewer #2 (Public review): Summary: The manuscript by Majnik and colleagues introduces "Track2p", a new tool designed to track neurons across imaging sessions of two-photon calcium imaging in developing mice. The method addresses the challenge of tracking cells in the growing brain of developing mice. The authors showed that "Track2p" successfully tracks hundreds of neurons in the barrel cortex across multiple days during the second postnatal week. This enabled the identification of the emergence of behavioral state modulation and desynchronization of spontaneous network activity around postnatal day 11. Strengths: The manuscript is well written, and the analysis pipeline is clearly described. Moreover, the dataset used for validation is of high quality, considering the technical challenges associated with longitudinal two-photon recordings in mouse pups. The authors provide a convincing comparison of both manual annotation and "CellReg" to demonstrate the tracking performance of "Track2p". Applying this tracking algorithm, Majnik and colleagues characterized hallmark developmental changes in spontaneous network activity, highlighting the impact of longitudinal imaging approaches in developmental neuroscience. Additionally, the code is available on GitHub, along with helpful documentation, which will facilitate accessibility and usability by other researchers. Weaknesses: (1) The main critique of the "Track2p" package is that, in its current implementation, it is dependent on the outputs of "Suite2p". This limits adoption by researchers who use alternative pipelines or custom code. One potential solution would be to generalize the accepted inputs beyond the fixed format of "Suite2p", for instance, by accepting NumPy arrays (e.g., ROIs, deltaF/F traces, images, etc.) from files generated by other software. Otherwise, the tool may remain more of a useful add-on to "Suite2p" (see https://github.com/MouseLand/suite2p/issues/933) rather than a fully standalone tool. We thank the reviewer for this excellent suggestion. We have now implemented this feature, where Track2p is now compatible with ‘raw’ NumPy arrays for the three types of inputs. For more information, please check the updated documentation: https://track2p.github.io/run_inputs_and_parameters.html#raw-npy-arrays. We have also tested this feature using a custom segmentation and trace extraction pipeline using Cellpose for segmentation. (2) Further benchmarking would strengthen the validation of "Track2p", particularly against "CaIMaN" (Giovannucci et al., eLife, 2019), which is widely used in the field and implements a distinct registration approach. This reviewer suggested further benchmarking of Track2P. Ideally, we would want to benchmark Track2p against the current state-of-the-art method. However, the field currently lacks consensus on which algorithm performs best, with multiple methods available including CaIMaN, SCOUT (Johnston et al. 2022), ROICaT (Nguyen et al. 2023), ROIMatchPub (recommended by Suite2p documentation and recently used by Hasegawa et al. 2024), and custom pipelines such as those described by Sun et al. 2025. The absence of systematic benchmarking studies—particularly for custom tracking pipelines—makes it impossible to identify the current state-of-the-art for comparison with Track2p. While comparing Track2p against all available methods would provide comprehensive evaluation, such an analysis falls beyond the scope of this paper. We selected CellReg for our primary comparison because it has been validated under similar experimental conditions—specifically, 2-photon calcium imaging in developing hippocampus between P17-P25 (Wang et al. 2024)—making it the most relevant benchmark for our developmental neocortex dataset. That said, to support further benchmarking in mouse neocortex (P8-P14), we will publicly release our ground truth tracking dataset. (3) The authors might also consider evaluating performance using non-consecutive recordings (e.g., alternate days or only three time points across the week) to demonstrate utility in other experimental designs. Thank you for your suggestion. We have performed a similar analysis prior to submission, but we decided against including it in the final manuscript, to keep the evaluation brief and to not confuse the reader with too many different evaluation methods. We have included the results inAuthor response images 1 and 2 below. To evaluate performance in experimental designs with larger time spans between recordings (>1 day) we performed additional evaluation of tracking from P8 to each of the consecutive days while omitting the intermediate days (e. g. P8 to P9, P8 to P10 … P8 to P14). The performance for the three mice from the manuscript is shown below: As expected with increasing time difference between the two recordings the performance drops significantly (dropping to effectively zero for 2 out of 3 mice). This could also explain why CellReg struggles to track cells across all days, since it takes P8 as a reference and attempts to register all consecutive days to that time point before matching, instead of performing registration and matching in consecutive pairs of recordings (P8-P9, P9-P10 … P13-P14) as we do. Finally for one of the three mice we also performed an additional test where we asked how adding an additional recording day might rescue the P8-P14 tracking performance. This corresponds to the comment from the reviewer, answering the question if we can only perform three days of recording which additional day would give the best tracking performance. As can be seen from the plot, adding the P10 or P11 recording shows the most significant improvement to the tracking performance, however the performance is still significantly lower than when including all days (see Fig. 4). This test suggests that including a day that is slightly skewed to earlier ages might improve the performance more than simply choosing the middle day between the two extremes. This would also be consistent with the qualitative observation that the FOV seems to show more drastic day-to-day changes at earlier ages in our recording conditions. Reviewer #3 (Public review): Summary: In this manuscript, Majnik et al. developed a computational algorithm to track individual developing interneurons in the rodent cortex at postnatal stages. Considerable development in cortical networks takes place during the first postnatal weeks; however, tools to study them longitudinally at a single-cell level are scarce. This paper provides a valuable approach to study both single-cell dynamics across days and state-driven network changes. The authors used Gad67Cre mice together with virally introduced TdTom to track interneurons based on their anatomical location in the FOV and AAVSynGCaMP8m to follow their activity across the second postnatal week, a period during which the cortex is known to undergo marked decorrelation in spontaneous activity. Using Track2P, the authors show the feasibility of tracking populations of neurons in the same mice, capturing with their analysis previously described developmental decorrelation and uncovering stable representations of neuronal activity, coincident with the onset of spontaneous active movement. The quality of the imaging data is compelling, and the computational analysis is thorough, providing a widely applicable tool for the analysis of emerging neuronal activity in the cortex. Below are some points for the authors to consider. We thank the reviewer for a constructive and positive evaluation of our MS. Major points: (1) The authors used 20 neurons to generate a ground truth dataset. The rationale for this sample size is unclear. Figure 1 indicates the capability to track ~728 neurons. A larger ground truth data set will increase the robustness of the conclusions. We think this was a misunderstanding of our ground truth dataset analysis which included 192 and not 20 neurons. Indeed, as explained in the methods section, since manually tracking all cells would require prohibitive amounts of time, we decided to generate sparse manual annotations, only tracking a subset of all cells from the first recording day onwards. To do this, we took the first recording (s0), and we defined a grid 64 equidistant points over the FOV and, for each point, identified the closest ROI in terms of euclidean distance from the median pixel of the ROI (see Fig. S3A). We then manually tracked these 64 ROIs across subsequent days. Only neurons that were detected and tracked across all sessions were taken into account and referred to as our ground truth dataset (‘GT’ in Fig. 4). This was done for 3 mice, hence 3X64 neurons and not 20 were used to generate our GT dataset. (2) It is unclear how movement was scored in the analysis shown in Figure 5A. Was the time that the mouse spent moving scored after visual inspection of the videos? Were whisker and muscle twitches scored as movement, or was movement quantified as the amount of time during which the treadmill was displaced? Movement was scored using a ‘motion energy’ metric as in Stringer et al. 2019 (V1) or Inácio et al. 2025 (S1). This metric takes each two consecutive frames of the videography recordings and computes the difference between them by summing up the square of pixelwise differences between the two images. We made the appropriate changes in the manuscript to further clarify this in the main text and methods in order to avoid confusion. Since this metric quantifies global movements, it is inherently biased to whole-body movements causing more significant changes in pixel values around the whole FOV of the camera. Slight twitches of a single limb, or the whisker pad would thus contribute much less to this metric, since these are usually slight displacements in a small region of the camera FOV. Additionally, comparing neural activity across all time points (using correlation or R2) also favours movements that last longer (such as wake movements / prolonged periods of high arousal) since each time point is treated equally. As we suggested in the discussion, in further analysis it would be interesting to look at the link between twitches and neural activity, but this would likely require extensive manual scoring. We could then treat movements not as continuous across all time-points, but instead using event-based analysis for example peri-movement time histograms for different types of movements at different ages, which is however outside of the scope of this study. (3) The rationale for binning the data analysis in early P11 is unclear. As the authors acknowledged, it is likely that the decoder captured active states from P11 onwards. Because active whisking begins around P14, it is unlikely to drive this change in network dynamics at P11. Does pupil dilation in the pups change during locomotor and resting states? Does the arousal state of the pups abruptly change at P11? We agree that P11 does not match any change in mouse behavior that we have been able to capture. However, arousal state in mice does change around postnatal day 11. This period marks a transition from immature, fragmented states to more organized and regulated sleep-wake patterns, along with increasing influence from neuromodulatory and sensory systems. All of these changes have been recently reviewed in Wu et al. 2024 (see also Martini et al. 2021). In addition, in the developing somatosensory system, before postnatal day 11 (P11), wake-related movements (reafference) are actively gated and blocked by the external cuneate nucleus (ECN, Tiriac et al. 2016 and all excellent recent work from the Blumberg lab). This gating prevents sensory feedback from wake movements from reaching the cortex, ensuring that only sleep-related twitches drive neural responses. However, around P11, this gating mechanism abruptly lifts, enabling sensory signals from wake movements to influence cortical processing—signaling a dramatic developmental shift from Wu et al. 2024 Reviewer #1 (Recommendations for the authors): This manuscript represents a significant advancement in the field of developmental neuroscience, offering a powerful and elegant framework for longitudinal cellular tracking using the Track2p method combined with robust analytical approaches. The authors convincingly demonstrate that this integrated methodology provides an invaluable template for investigating complex developmental processes, including the emergence of sensory representations and higher cognitive functions. A major strength of this work is its emphasis on the power of longitudinal imaging to illuminate activity-dependent development. By tracking the same neurons over time, the authors open up new possibilities to uncover how early activity patterns shape later functional outcomes and the organization of neuronal assemblies-insights that would be inaccessible using conventional cross-sectional designs. Importantly, the manuscript highlights the potential for this approach to be extended even further, enabling continuous tracking into adulthood and thus offering an unprecedented window into long-term developmental trajectories. The authors also underscore the exciting opportunity to incorporate targeted perturbation experiments, allowing researchers to causally link early circuit dynamics to later outcomes. Given the increasing recognition that early postnatal alterations can underlie the etiology of various neurodevelopmental disorders, this work is especially timely. The methods and perspectives presented here are poised to catalyze a new generation of developmental studies that can reveal mechanistic underpinnings of both typical and atypical brain development. In summary, this is a technically impressive and conceptually forward-looking study that sets the stage for transformative advances in developmental neuroscience. Thank you for the thoughtful feedback—it's greatly appreciated! Reviewer #2 (Recommendations for the authors): Minor points: (1) Figure 1. Consider merging or moving to Supplemental, as its rationale is well described in the text. We would like to retain the current figure as we believe it provides an effective visual illustration of our rationale that will capture readers' attention and could serve as a valuable reference for others seeking to justify longitudinal tracking of the developing brain. We hope the reviewer will understand our decision. (2) Some axis labels and panels are difficult to read due to small font sizes (e.g. smaller panels in Figures 5-7). Modified, thanks (3) Supplementary Figures. The order of appearance in the main text is occasionally inconsistent. This was modified, thanks (4) Line 132. Add a reference to the registration toolbox used (elastix). A brief description of the affine transformation would also be helpful, either here or in the Methods section (p. 27). We have added reference to Ntatsis et al. 2023 and described affine transformation in the main text (lines 133-135): Firstly, we estimate the spatial transformation between s0 and s1 using affine image registration (i.e. allowing shifting, rotation, scaling and shearing, see Fig. 2B, the transformation is denoted as T). (5) Lines 147-151. If this method is adapted from another work, please cite the source. Computing the intersection over union of two ROIs for tracking is a widely established and intuitive method used across numerous studies, representing standard practice rather than requiring specific citation. We have however included the reference to the paper describing the algorithm we use to solve the linear sum assignment problem used for matching neurons across a pair of consecutive days (Crouse 2016). (6) Line 218. "classical" or automatic? We meant “classical” in the sense of widely used. (7) Lines 220-231. Did the authors find significant variability of successfully tracked neurons across mice? While the data for successfully tracked cells is reported (Figure 5B), the proportions are not. Could differences in neuron dropout across days and mice affect the analysis of neuronal activity statistics? We thank the reviewer for raising this important point. We computed the fraction of successfully tracked cells in our dataset and found substantial variability: Cells detected on day 0: [607, 1849, 2190, 1988, 1316, 2138] Proportion successfully tracked: [0.47, 0.20, 0.36, 0.37, 0.41, 0.19] Notably, the number of cells detected on the first day varies considerably (607–2138 cells). There appears to be a trend whereby datasets with fewer initially detected cells show higher tracking success rates, potentially because only highly active cells are identified in these cases. To draw more definitive conclusions about the proportion of active cells and tracking dropout rates, we would require activity-independent cell detection methods (such as Cellpose applied to isosbestic 830 nm fluorescence, or ideally a pan-neuronal marker in a separate channel, e.g., tdTomato). We have incorporated the tracking success proportions into the revised manuscript. (8) Line 260. Please briefly explain, here or in the Methods, the rationale for using data from only 3 mice (rather than all 6) for evaluating tracking performance. We used three mice for this analysis due to the labor-intensive nature of manually annotating 64 ROIs across several days. Given the time constraints of this manual process, we determined that three subjects would provide adequate data to reliably assess tracking performance. (9) Line 277. Consider clarifying or rephrasing the phrase "across progressively shorter time intervals"? Do you mean across consecutive days? This has been rephrased as follows: Additionally, to assess tracking performance over time, we quantified the proportion of reconstructed ground truth tracks over progressively longer time intervals (first two days, first three days etc. ‘Prop. correct’ in Fig. 4C-F, see Methods). This allowed us to understand how tracking accuracy depends on the number of successive sessions, as well as at which time points the algorithm might fail to successfully track cells. (10) Line 306. "we also provide additional resources and documentation". Please add a reference or link. Done, thanks Track2p (11) Lines 342-344. Specify that the raster plots refer to one example mouse, not the entire sample. Done, thanks. (12) Lines 996-1002. Please confirm whether only successfully tracked neurons were used to compute the Pearson correlations between all pairs. Yes of course, this only applies to tracked neurons as it is impossible to compute this for non-tracked pairs. (13) Line 1003. Add a reference to scikit-learn. Reference was added to: Pedregosa, F., Varoquaux, G., Gramfort, A., Michel, V., Thirion, B., Grisel, O., Blondel, M., Prettenhofer, P., Weiss, R., Dubourg, V., Vanderplas, J., Passos, A., Cournapeau, D., Brucher, M., Perrot, M., & Duchesnay, E. (2011). Scikit-learn: Machine Learning in Python. Journal of Machine Learning Research, 12, 2825–2830. (14) Typos.Correct spacing between numeric values and units. We did not find many typos regarding spacing between the numerical value and the unit symbol (degrees and percent should not be spaced right?). Reviewer #3 (Recommendations for the authors): The font size in many of the figures is too small. For example, it is difficult to follow individual ROIs in Figure S3. Figure font size has been increased, thanks. In Figure S3 there might have been a misunderstanding, since the three FOV images do not correspond to the FOV of the same mouse across three days but rather to the first recording for each of the three mice used in evaluation (the ROIs can thus not be followed across images since they correspond to a different mouse). To avoid confusion we have labelled each of the FOV images with the corresponding mouse identifier (same as in Fig. 4 and 5).