High-precision registration between zebrafish brain atlases using symmetric diffeomorphic normalization

Abstract Atlases provide a framework for spatially mapping information from diverse sources into a common reference space. Specifically, brain atlases allow annotation of gene expression, cell morphology, connectivity, and activity. In larval zebrafish, advances in genetics, imaging, and computational methods now allow the collection of such information brain-wide. However, due to technical considerations, disparate datasets may use different references and may not be aligned to the same coordinate space. Two recent larval zebrafish atlases exemplify this problem: Z-Brain, containing gene expression, neural activity, and neuroanatomical segmentations, was acquired using immunohistochemical stains, while the Zebrafish Brain Browser (ZBB) was constructed from live scans of fluorescent reporters in transgenic larvae. Although different references were used, the atlases included several common transgenic patterns that provide potential “bridges” for transforming each into the other's coordinate space. We tested multiple bridging channels and registration algorithms and found that the symmetric diffeomorphic normalization algorithm improved live brain registration precision while better preserving cell morphology than B-spline-based registrations. Symmetric diffeomorphic normalization also corrected for tissue distortion introduced during fixation. Multi-reference channel optimization provided a transformation that enabled Z-Brain and ZBB to be co-aligned with precision of approximately a single cell diameter and minimal perturbation of cell and tissue morphology. Finally, we developed software to visualize brain regions in 3 dimensions, including a virtual reality neuroanatomy explorer. This study demonstrates the feasibility of integrating whole brain datasets, despite disparate reference templates and acquisition protocols, when sufficient information is present for bridging. Increased accuracy and interoperability of zebrafish digital brain atlases will facilitate neurobiological studies.

the entire brain to be rapidly scanned at cellular resolution using diffraction-limited microscopy. In 31 principle, this enables researchers to systematically analyze effects of manipulations on a brain-wide 32 level. However, such efforts have been hampered by the absence of a comprehensive digital atlas that 33 would provide researchers with a unified framework in which to aggregate data from different 34 experiments and gain deeper insights from correlations between neuronal cell identity, connectivity, gene 48 ViBE-Z was the first comprehensive 3D digital brain atlas in zebrafish that used a nuclear stain for the 49 alignment of 85 high resolution scans comprising 17 immunohistochemical patterns at 2-4 days post-50 fertilization (dpf) [3,4]. In ViBE-Z, custom algorithms were developed to correct for variations in 51 fluorescent intensity with scan depth, and a landmark approach taken to perform accurate image 52 registration and segmentation into 73 neuroanatomic regions.

54
In contrast, two more recent approaches (Z-Brain and ZBB) have generated brain atlases at 6 dpf through 55 non-linear B-spline registration using the freely available Computational Morphometry Toolkit (CMTK) 56 [5,6]. Z-Brain includes 29 immunohistochemical patterns from 899 scans which form the basis for expert 57 manual segmentation of the brain into 294 neuroanatomic regions. These partitions facilitate the analysis 58 of phospho-ERK expression for mapping neural activity [2]. In Z-Brain, each expression pattern was co-59 scanned with tERK immunoreactivity, and registered to a single tERK-stained reference brain. For ZBB, 60 we live-imaged 354 brains from 109 transgenic lines and manually annotated the expression found in 61 each [1]. In place of tERK, a single vglut2a:dsRed transgenic brain was used as the reference in ZBB with 62 transgenic lines crossed and co-imaged with this channel for registration. Brain browser software enables 63 researchers to select a transgenic line labeling a selected set of neurons for monitoring and manipulating 64 circuit function.

138
Binary masks corresponding to 25 anatomical regions from Z-Brain aligned to ZBB were converted into 139 meshes using the Create Surfaces tool in the IntSeg_3D.jar plugin for ImageJ [27]. Edges for individual 140 meshes were iteratively reduced below 5000 and vertices (single-precision floating-points of the 141 triangular meshes) written as OBJ files. As there is no intrinsic color or color conventions as of yet for 142 these brain structures, we used color hue as a nominal categorical coding for each region. To maximize 143 accessibility, we rendered meshes in Extensible 3D (X3D) format, an ISO (International Organization for 144 Standardization) standard developed by the not-for-profit Web3D Consortium [28]. This format allows 145 portability between numerous tools and applications as well as deployment across a broad spectrum of Hausdorff distance for each cell after registration compared to its original shape (see Methods).

234
Next we plotted the MLD against the Hausdorff distance and located points along the Pareto frontier ( Fig.  9 maximal elongation (Fig. 1d). Three transformations showed statistically significantly reduced distortion 239 compared to CMTK for both measures, and we selected the one (Fig. 1b, point d) with the greatest 240 precision for further testing. With this set of parameters (see Table 1, live registration), mean registration 241 error was within the diameter of a single neuron for both ANTs and CMTK (MLD for ANTs 6.7 ± 0.3 242 μm, for CMTK 7.6 ± 0.4 μm ; N = 6 brains, paired t-test p=0.056). However, cell morphology was better 243 preserved using ANTs (Hausdorff Distance for ANTs 2.30 ± 0.14, CMTK 2.37 ± 0.14 ; N = 107 cells, 244 paired t-test p=0.013), especially within ventral structures such as the hypothalamus and the caudal 245 medulla oblongata (Fig. 1e).

247
We next examined whether these registration parameters also improved precision for the co-aligned We next recompiled ZBB using ANTs to register the entire set of 354 brain scans from 109 different 262 transgenic lines that were part of ZBB, then as before, averaged multiple larvae to create a representation 263 of each transgenic line, masked the average stacks to remove expression outside the brain and re-imported 264 the resulting images into our Brain Browser software. We refer to this new recompilation of the atlas as 265 ZBB1.2. Unprocessed and registered brain images are available online [35].

267
To determine whether ZBB1.2 was a quantitative improvement over ZBB, we identified two 268 conspicuously labeled cells or landmarks in each of 12 transgenic lines from the atlas (Additional File 3).

269
We marked these positions in each of the three brain scans for each line, then, after registration, 270 calculated the distance between corresponding points in each pair of brains. The mean of these distances 271 measures how precisely landmarks are registered across the three brains. We performed this procedure 10 first for brains registered using CMTK, then for the same set of brains registered using ANTs, allowing us 273 to compare MLDs for the two methods ( Fig. 2a-b). Overall, landmark distances decreased from ZBB to 274 ZBB1.2 (10.8 ± 1.02 μm to 8.1 ± 0.83 μm ; N = 24 landmarks, paired t-test p=0.008), indicating that 275 ZBB1.2 has significantly improved precision, and confirming that the new atlas is accurate to 276 approximately the diameter of a single neuron. The improvement was greatest deeper in the brain (Fig. 2c 277 ; linear regression, N=24, p=0.003) with the largest improvement for the caudal hypothalamus in line 278 y341, where increased alignment precision was associated with noticeably reduced distortion between the 279 three brain scans (Fig. 2d).

281
Additionally, we inspected regions of ZBB1.2 where we had noticed poor registration precision or 282 pronounced cell distortion in the original ZBB. One such area was the dorsal thalamus, where cell 283 morphology was noticeably perturbed after elastic registration with CMTK, with cell somas stretching 284 across the midline (Fig. 2e). In ZBB1.2 cells retained a rounded morphology with distinct cell clusters on 285 the left and right sides of the brain (Fig. 2f). Similarly, distortions in cell shape that were apparent in the 286 caudal hypothalamus in ZBB, were absent in ZBB1.2 (Fig. 2g,h). In the caudolateral medulla, we 287 previously obtained poor registration, with expression extending to regions outside the neural tube ( Fig.   288 2i). In ZBB1.2, patterns had improved bilateral symmetry and were correctly confined to the neural tube 289 (Fig. 2j). Finally, we noticed that the posterior commissure was poorly aligned between larvae leading to 290 a defasciculated appearance in ZBB (Fig. 2k), whereas this tract had the expected tightly bundled 291 appearance in ZBB1.2 (Fig. 2l).Together, these observations confirm that ZBB1.2 is a more faithful 292 representation of the transgenic lines. Not only is cell morphology better preserved, but global registration 293 precision is improved compared to the original ZBB atlas.

295
Optimization of ANTs registration parameters for fixed tissue 296 297 The Z-Brain atlas was derived by registering brain scans to a single brain that was fixed, permeabilized 298 and immunostained for tERK expression. We therefore anticipated that tERK would be a useful channel 299 for bridging the two atlases, if we could first successfully register a tERK stained vglut2a:DsRed 300 expressing brain to ZBB1.2. Therefore, we fixed and stained a transgenic vglut2a:DsRed larva for tERK, 301 and registered the tERK pattern to ZBB1.2 using the vglut2a pattern. We used the resulting image as our 302 ZBB tERK reference brain (tERKZBB ; file terk-ref-02.nii.gz available from [33]).

304
In addition to the tERK reference brain, Z-Brain contains an average tERK representation from 197 tERK 305 stained larvae, which we thought might serve as a bridge between atlases. During studies on pERK-based 11 activity mapping, we had previously generated a dataset of 167 tERK stained brains and therefore used 307 these to create our own average tERK representation by registering them to tERKZBB. However, during 308 this process, we noticed a high degree of variability between tERK stained brains, most salient in poor 309 labeling of ventral brain structures and in deformation of the optic tectum neuropil.

310
Immunohistochemistry for tERK proved highly sensitive to staining parameters with the trypsin activity, 311 permeabilization duration, and antigen retrieval having the strongest effects. Variability in fixed tissue 312 was most apparent in the optic tectum, where high trypsin activity tended to disrupt morphology and 313 reduce the volume of the tectal neuropil (Fig. 3b,c). These local distortions were not resolved by 314 deformable image registration: alignment to tERKZBB with the same parameters optimized for live vglut2a 315 based registration failed to correct the reduced tectal neuropil volume (Fig. 3d,

319
We therefore varied the registration parameters that were optimal for live vglut2a registration, to find 320 settings that best rectified the variable tissue morphology following fixation and permeabilization 321 (process summarized in Fig. 3a). For optimization of fixed tissue registration, we used a set of 6 tERK 322 stained brains (including the Z-Brain tERK reference), iteratively varied parameters for registration to 323 tERKZBB and assessed registration fidelity. For measuring precision, we were not able to identify 324 unambiguous landmarks within the optic tectum, so we instead calculated the cross-correlation between 325 each of the aligned tERK stains and tERKZBB within small volumes, including parts of the tectum (Fig.   326 3f,g). To verify that the 'fixed brain' parameters that yielded the greatest cross correlation did in fact 327 improve registration within the tectum, we manually segmented the tectal neuropil in the same 6 brains, 328 applied the transformation matrix to each mask, and calculated the Jaccard index for overlap with the 329 segmented neuropil in tERKZBB. Parameters for fixed brain registration produced a significant increase in 330 overlap, compared to the live brain parameters (Fig. 3h,i) and visual inspection confirmed that the 331 morphology of the optic tectum neuropil after registration was greatly improved (Fig. 3j,k). We therefore 332 used ANTs with the fixed brain parameters (Table 1, fixed registration) to register our 167 tERK stained 333 brains to tERKZBB, and generated an average tERK representation comparable to the 197 tERK average in 334 Z-Brain (Fig. 3l,m).

336
Inter-atlas registration using multi-channel diffeomorphic transformation 337 338 Z-Brain and ZBB incorporated eight expression patterns that we judged sufficiently similar to act either 339 as templates for bridging the datasets and/or to provide metrics for assessing the precision of a bridging 12 registration (  [15,20]. Crossing these two lines allowed us to scan DsRed and EGFP in the same larva and 344 confirm that the patterns were largely congruous, potentially allowing us to use vglut2a expression to 345 bridge the two atlases. Likewise, the expression patterns of tERK, elavl3, isl2b, vmat2 in Z-Brain and 346 ZBB appeared sufficiently similar to provide templates for atlas co-registration. 347 348 Taking advantage of the ability of ANTs to use of multiple reference channels concurrently, we compared 349 the effect of combinatorial use of complementary reference channels for inter-atlas registration (process 350 summarized in Fig. 4a). We used seven expression patterns to evaluate registration precision: vglut2a, 351 isl2b, vmat2, tERK, isl1, gad1b and glyT2. For each pattern we identified a set of 4-10 point-based 352 landmarks that could be identified in corresponding ZBB and Z-Brain images and that were widely 353 distributed to represent diverse brain regions (total of 41 landmarks ; Additional File 5). We marked these 354 points in each set of images, registered Z-Brain images to ZBB1.2 images, measured the distance between 355 cognate landmarks and calculated the mean landmark distance for each of the seven expression patterns.

356
We used two summary measures of registration precision. The first metric (M1) was the mean of MLDs 357 for the three patterns that were not used to drive registration (isl1, gad1b and glyT2). Although these 358 channels measure precision independent of the patterns for atlas registration, they are relatively sparse 359 and do not assess precision across the whole brain. Thus, to provide a global measure of precision, we 360 also used a second metric (M2) that was the mean of all seven MLDs: those in M1 plus four of the patterns 361 used as references for registration -vglut2a, tERK, isl2b and vmat2.

363
Using CMTK, minimal M1 and M2 scores were obtained using the average vmat2 pattern as the reference 364 ( Fig. 4b; mean MLD for 41 landmarks 14.9 ± 1.3 μm). We therefore registered all images in Z-Brain to 365 ZBB using the vmat2 average in each dataset as the reference channel. We observed severe tissue 366 distortions in several brain regions, with noticeable flattening of the torus longitudinalis as well as gross 367 tissue distortions, particularly in ventral brain regions (Fig. 4c,d; ZBrain-CMTK). Next we used the 368 ANTs SyN algorithm to register the atlases. Ideally, patterns for registration should include information 369 throughout the brain. Because ANTs can use multiple concurrent reference channels to derive an optimal 370 transformation matrix, we speculated that the best possible transformation would be achieved by a 371 combination of channels with complementary information. We therefore produced an inter-atlas 372 transformation matrix for every combination of the elavl3, isl2b, vglut2aAV (vglut2a average brain), 373 vmat2, tERKZBB (tERK single brain) and tERKAV (tERK average brain) patterns as references. Because Z-13 Brain used fixed samples, we used the registration parameters optimized for the greater variability present 375 in fixed tissue. Multi-channel registration significantly reduced M1 and M2 values compared to any single 376 channel alone and to transformations obtained using CMTK. The registration obtained with vglut2a, 377 tERKZBB, vmat2 and isl2b gave the lowest global metric (M2) value and an M1 score within 10% of the 378 lowest scoring combination (Fig. 4b). With these parameters, the MLD was 9.1 ± 0.8 μm (N=41 379 landmarks) and the overt tissue distortions noted after elastic registration were far less salient (Fig. 4c,d; 380 ZBrain-SyN). We therefore applied the transformation matrix obtained with this set of channels to the 381 database of gene expression patterns in Z-Brain to align them to ZBB1.2, and used the inverse of the 382 transformation generated by SyN to register ZBB1.2 to the Z-Brain coordinate system. We imported all Z-

398
Although best practice is to align directly to either ZBB or Z-Brain, because many researchers will have 399 already registered data sets to either ZBB or Z-Brain, or for cases where it may not be possible to directly Z-Brain includes 294 masks that represent anatomically defined brain regions or discrete clusters of cells 406 present in transgenic lines. We selected 113 of these masks that delineate neuroanatomical regions and 407 transformed them into the ZBB1.2 coordinate system. We had previously defined a small number of our 14 own anatomical masks by thresholding clusters of neuronal cell bodies located in well-defined brain 409 regions. However the Z-Brain masks are more comprehensive, have smoother boundaries and include 410 both the cell bodies and neuropil for a given region ( Fig. 4i-l). We therefore imported the Z-Brain masks 411 into ZBB1.2, replacing most of our existing masks. We also modified the Brain Browser software to 412 automatically report the neuroanatomical identity of a selected pixel, or to display the boundaries of the Digitized data-derived brain atlases provide an opportunity to continuously integrate new information and 436 iteratively improve data accuracy within a common spatial framework. Thus, as methods evolve and 437 technology improves, new insights can be easily added to existing data to provide an increasingly rich 438 view of brain structure and function. Because the entire larval zebrafish brain can be rapidly imaged at Ideally different atlas projects might use the same reference brain, however in practice the choice of a 450 reference is often dictated by study-specific experimental requirements. For example, despite the 451 deformations introduced by fixation and permeabilization, a fixed brain is essential for activity mapping 452 using pERK immunohistochemistry. In contrast, we were able to take advantage of the optical 453 transparency of larvae to rapidly scan and register several hundred individuals representing more than 100 454 different transgenic lines. For our purposes, the TgBAC(slc17a6b:loxP-DsRed-loxP-GFP)nns14 line was 455 ideal, because through Cre injection, we generated a vglut2a:GFP line with an almost identical pattern, 456 allowing us to co-register lines with either GFP or RFP fluorescence. However, we have also used pan-457 neuronal Cerulean or mCardinal as a reference channel when green and red channels both contain useful 458 information on transgene expression. Our work now demonstrates that it is feasible to contribute to 459 community efforts at building an integrated map of brain structure, expression and activity, while 460 allowing reference image selection to be guided by technical considerations.

462
One caveat to this conclusion is that deformable image registration can easily introduce artifacts into cell 463 morphology if parameters are not carefully monitored and constrained. Indeed, a special challenge for 464 brain registration in zebrafish is preserving the local morphology of neuronal cell bodies and axons, while 465 permitting sufficient deformation to correct for biological differences and changes in brain structure 466 arising from tissue fixation and permeabilization. Thus, while B-spline registration with CMTK produced 467 acceptable inter-atlas alignment, it also introduced noticeable distortions into local brain structure that 468 affected neuronal cell morphology. Such artifacts were particularly severe in ventral brain regions such as 469 the caudal hypothalamus, and may therefore be due to differences in ventral signal intensity between the 470 datasets. In ZBB, in order to compensate for the increase in light diffraction with tissue depth, we 471 systematically increased laser intensity with confocal scan progression (z-compensation). As a result, the 472 Z-Brain and ZBB datasets are comparable in dorsal brain regions, but there is a noticeable discrepancy 473 ventrally which may account for the loss of registration fidelity. Alternatively, although z-compensation 474 partially corrects for reduced fluorescent intensity, there is a noticeable drop-off in image resolution in 475 ventral regions; the resulting loss of information may lead to lower quality registration. Registration 16 algorithms that allow parameters to vary by depth may ameliorate the effects of these physical imaging 477 constraints.

479
Nevertheless, the symmetrical diffeomorphic transformation in ANTs provides a solution to these 480 problems. For live tissue, we found parameters that allowed the ANTs SyN transform to achieve similar 481 or better registration precision than previously achieved using CMTK, while significantly reducing 482 distortions in tissue structure and neuronal cell morphology. In our hands, permeabilization of fixed tissue 483 tended to produce variable changes in neuropil structure which was most salient in the optic tectum. An obstacle to systematically calibrating registration parameters is finding a suitable metric to 507 quantitatively evaluate precision. This is a recognized problem, and it is not clear that a general solution 508 exists [34]. Here, we primarily assessed precision by measuring the distance between visually-located 509 landmarks in the reference brain, and registered images. However, this method has two drawbacks: (1) it 510 relies on the accuracy with which these landmarks are located, and (2) at least for our sample set, a 511 relatively limited set of landmarks could reliably be identified. We obtained similar results when we 512 assessed precision using cross-correlation within localized image neighborhoods that included high 513 contrast internal image boundaries (data not shown). In registering live vglut2a:DsRed image stacks, we 514 noted the trade-off between accurate global brain alignment and biologically plausible cell morphology.

515
Thus we also used a set of measures to assess changes in the morphology of manually segmented cells 516 (Hausdorff distance, elongation index and cell volume). Finally, we also inspected the output of every 517 transformation to subjectively judge registration quality.

104
Z-Brain and ZBB both illustrate the feasibility of performing whole-brain registration with precision 105 sufficient to ensure that the 'same' neurons from different fish are aligned to within a cell diameter (~10 8 106 μm). However, a challenge for brain registration in zebrafish is to minimize local distortions, so that 107 cellular morphology is preserved while still allowing sufficient deformation to overcome biological 108 variability between individual brains or malformations due to tissue processing.

110
Here we describe a method to co-register ZBB and Z-Brain, bridging the two existing 6 dpf larval 111 zebrafish brain atlases.

194
Mean Landmark Distance (MLD). To assess registration precision using MLDs, corresponding landmarks 195 were located and annotated on the reference brain, and on unregistered brains. In each case, landmarks 196 were chosen to be widely distributed within the brain, and readily recognized in corresponding brain 197 scans. In addition, to verify recognizability, the vglut2a landmarks in the reference brain were located by 198 3 blinded scorers ; mean distance from each of the 10 reference points ranged from 1.7 to 11.8 μm (mean, 199 4.5 ± 0.9 μm). Using ImageJ, we positioned a 3 micron cube centered on each landmark in a second 200 channel for each brain scan, then, after registering the brain scan using the first channel, applied the Hausdorff distance for each cell after registration compared to its original shape (see Methods).

266
Next we plotted the MLD against the Hausdorff distance and located points along the Pareto frontier (Fig.   267 1b) of these two measures. These points represent potentially optimal transformations, where registration 268 accuracy can only be improved by increasing distortion, or vice versa. To distinguish between these 269 points, we examined two additional measures of distortion: the change in cell volume (Fig. 1c) and 270 maximal elongation (Fig. 1d). Three transformations showed statistically significantly reduced distortion 271 compared to CMTK for both measures, and we selected the one (Fig. 1b, point d) with the greatest 10 precision for further testing. With this set of parameters (see Table 1

310
We next testedexamined whether these registration parameters also improved precision for the co-aligned  (Fig. 1hg). This was 320 substantially improved with ANTs, where there was much closer alignment of the two averages (Fig. 1ih)

352
To determine whether ZBB1.2 was a quantitative improvement over ZBB, we identified two 353 conspicuously labeled cells or landmarks in each of 12 transgenic lines from the atlas (Additional File 3).

354
We marked these positions in each of the three brain scans for each line, then, after registration, 355 calculated the distance between corresponding points in each pair of brains. The mean of these distances 356 measures how precisely landmarks are registered across the three brains. We performed this procedure 357 first for brains registered using CMTK, then for the same set of brains registered using ANTs, allowing us 358 to compare MLDs for the two methods ( Fig. 2a-b) approximately the diameter of a single neuron. The improvement was greatest deeper in the brain (Fig. 2c 362 ; linear regression, N=24, p=0.003) with the largest improvement for the caudal hypothalamus in line 363 y341, where increased alignment precision was associated with noticeably reduced distortion between the 364 three brain scans (Fig. 2d).

391
In addition to the tERK reference brain, Z-Brain contains an average tERK representation fromof 197 392 tERK stained larvae, which we thought might serve as a bridge between atlases. During studies on pERK-393 based activity mapping, we had previously generated a dataset of 167 tERK stained brains and sought to 394 usetherefore used these to create an our own average tERK representation by registering them to 395 tERKZBB. However, during this process, we noticed a high degree of variability between tERK stained 396 brains, most salient notably in either poor labeling of ventral brain structures and or in deformation of the 397 optic tectum neuropil. Immunohistochemistry for tERK proved highly sensitive to staining parameters 398 with the trypsin activity, permeabilization duration, and antigen retrieval having the strongest effects. This 399 vVariability in fixed tissue was most apparent in the optic tectum, where high trypsin activity tended to 400 disrupt morphology and reduce the volume of the tectal neuropil (Fig. 3a3b,bc). These local distortions 401 were not corrected resolved by deformable image registration: alignment to tERKZBB with the same 402 parameters optimized for live vglut2a based registration, failed to correct the reduced tectal neuropil 403 volume (Fig. 3c3d,d e ; asterisk) and often created an artifact where the neuropil zone failed to abut the 404 underlying cellular layer labeled by vglut2a expression (Fig. 3c3d,d e ; arrowheads). 405   406   1  2  3  4  5  6  7  8  9  10  11  12  13  14  15  16  17  18  19  20  21  22  23  24  25  26  27  28  29  30  31  32  33  34  35  36  37  38  39  40  41  42  43  44  45  46  47  48  49  50  51  52  53  54  55  56  57  58  59  60  61  62  63  64  65 14 We therefore varied the registration parameters that were optimal for live vglut2a registration, to find 407 settings that best rectified the variable tissue morphology following fixation and permeabilization 408 (process summarized in Fig. 3a).

409
For tERK optimization of fixed tissue registration optimization, we used a set of 6 tERK stained brains 410 (including the Z-Brain tERK reference). , We iteratively varied parameters for registration to tERKZBB 411 and calculated the mean cross-correlation between each of the aligned tERK stains and tERKZBB (e.g., 412 Fig. 3e,f). Again when visually inspected, we noted a trade-off between the quality of global alignment 413 and local distortion artifacts, with the parameters which yielded the greatest increase in MCC often 414 producing abnormally elongated cell profiles throughout the brain (Fig. 3g). However, visual inspection 415 confirmed that parameters which increased MCC for fixed tissue greatly improved the morphology of the 416 optic tectum neuropil (Fig. 3h,i). We therefore used ANTs with the fixed brain parameters (Table 1, fixed 417 registration) to register 167 tERK stained brains to tERKZBB, and generated an average tERK 418 representation comparable to the Z-Brain tERK average (Fig. 3j,k).iteratively varied parameters for 419 registration to tERKZBB and assessed registration fidelity. For measuring precision, we were not able to 420 identify unambiguous landmarks within the optic tectum, so we instead calculated the cross-correlation 421 between each of the aligned tERK stains and tERKZBB within small volumes, including parts of the tectum 422 ( Fig. 3f,g). To verify that the 'fixed brain' parameters that yielded the greatest cross correlation did in fact 423 improve registration within the tectum, we manually segmented the tectal neuropil in the same 6 brains, 424 applied the transformation matrix to each mask, and calculated the Jaccard index for overlap with the 425 segmented neuropil in tERKZBB. Parameters for fixed brain registration produced a significant increase in 426 overlap, compared to the live brain parameters (Fig. 3h,i) and visual inspection confirmed that the 427 morphology of the optic tectum neuropil after registration was greatly improved (Fig. 3j,k). We therefore 428 used ANTs with the fixed brain parameters (Table 1, fixed registration) to register our 167 tERK stained 429 brains to tERKZBB, and generated an average tERK representation comparable to the 197 tERK average in 430 Z-Brain (Fig. 3l,m).

445
We used seven expression patterns to evaluate registration precision using cross correlation: vglut2a, 446 isl2b, vmat2, elavl3, isl1, gad1b and glyT2. For each pattern we identified a set of 5-18 landmarks that 447 were widely distributed to represent diverse brain regions. For each landmark, we measured the cross-448 correlation between the corresponding volumes in ZBB and Z-Brain. We then calculated the mean of all 449 cross correlation (MCC) values for landmarks associated with a given expression pattern. We used two 450 measures of registration precision. The first metric (M1) was the mean of the MCCs for isl1, gad1b and 451 glyT2 expression patterns in ZBB and in Z-Brain after registration to ZBB. These three expression 452 patterns do not provide sufficient coverage across all brain regions to use for registration, but served as 453 independent channels to estimate registration precision. However, as these patterns are relatively sparse 454 they do not comprehensively assess precision across all brain regions. To provide a global measure of 455 precision, we therefore also used a second metric (M2) that was the mean of all seven MCCs: those in M1 456 plus four of the patterns used as references for registration -vglut2a, tERK, isl2b and vmat2. Although M2 457 uses expression patterns that together provide good coverage for the entire brain, we expected that the 458 four patterns that were also used to guide the deformable registration, would artificially inflate the MCC.

460
We first used CMTK to register Z-Brain to ZBB1.2. Maximal M1 and M2 scores were obtained using the 461 average vglut2a pattern as the reference (Fig. 4a). We therefore registered all images in Z-Brain to ZBB 462 using the vglut2a average in each dataset as the reference channel. We observed severe tissue distortions 463 in several brain regions, with noticeable flattening of the torus longitudinalis and gross tissue distortions, 464 particularly in ventral brain regions (Fig. 4b,c; ZBrain-CMTK).

466
Next, for comparison, we used the ANTs SyN algorithm to register the atlases. Ideally, patterns for 467 registration should include information throughout the brain. Because ANTs can use multiple concurrent 468 reference channels to derive an optimal transformation matrix, we speculated that the best possible 469 transformation would be achieved by a combination of channels with complementary information. We 470 therefore produced an inter-atlas transformation matrix using every combination of the elavl3, isl2b, 471 vglut2a, vmat2, tERKREF (tERK single brain) and tERKAV (tERK average brain) patterns as references. As 472 Z-Brain used fixed samples, we used the registration parameters previously optimized for the greater 473 variability present in fixed tissue. Multi-channel registration significantly improved M1 and M2 values 16 compared to any single channel alone and to transformations obtained using CMTK. The registration 475 obtained with vglut2a, tERKREF, vmat2 and isl2b gave the highest M2 value and an M1 score within 1% of 476 the highest scoring combination (Fig. 4a). Moreover, the overt tissue distortions noted after elastic 477 registration with CMTK were far less salient using these parameters (Fig. 4b,c ; ZBrain-SyN). This 478 conclusion was supported when we assessed registration precision by visually locating landmarks in the 479 vglut2a pattern after registration with CMTK, or multi-channel ANTs registration. After calculating the 480 distance from the same points in the vglut2aZBB pattern we found the multi-channel ANTs registered 481 points were on average 9.9 μm away from the reference points, compared to 17.9 μm for CMTK (Table   482 4). We therefore applied the transformation matrix obtained with this set of channels to the database of the tyrosine hydroxylase stain from Z-Brain in the pretectum (Fig. 4f), although again, the ZBB1.2 pattern 494 was slightly more medial than in Z-Brain. More caudally, the glyT2:GFP transgenic line labels 495 glycinergic neurons in longitudinal columns in the medulla oblongata [36]. These columns were closely 496 aligned after ZBB1.2 was registered to Z-Brain (Fig. 4g). Although best practice is to align directly to 497 either ZBB or Z-Brain, because many researchers will have already registered data sets to either ZBB or 498 Z-Brain, or for cases where it may not be possible to directly register a dataset, we have provided 499 transformation matrixes and detailed instructions to quickly re-align datasets to either of the coordinate 500 systems ([37] ; instructions are provided in Additional File 2).

501
Taking advantage of the ability of ANTs to use of multiple reference channels concurrently, we compared 502 the effect of combinatorial use of complementary reference channels for inter-atlas registration (process 503 summarized in Fig. 4a). We used seven expression patterns to evaluate registration precision: vglut2a, 504 isl2b, vmat2, tERK, isl1, gad1b and glyT2. For each pattern we identified a set of 4-10 point-based 505 landmarks that could be identified in corresponding ZBB and Z-Brain images and that were widely 506 distributed to represent diverse brain regions (total of 41 landmarks ; Additional File 5). We marked these 507 points in each set of images, registered Z-Brain images to ZBB1.2 images, measured the distance between 17 cognate landmarks and calculated the mean landmark distance for each of the seven expression patterns.

509
We used two summary measures of registration precision. The first metric (M1) was the mean of MLDs 510 for the three patterns that were not used to drive registration (isl1, gad1b and glyT2). Although these 511 channels measure precision independent of the patterns for atlas registration, they are relatively sparse 512 and do not assess precision across the whole brain. Thus, to provide a global measure of precision, we 513 also used a second metric (M2) that was the mean of all seven MLDs: those in M1 plus four of the patterns 514 used as references for registration -vglut2a, tERK, isl2b and vmat2. Z-Brain in the pretectum (Fig. 4g), although again, the ZBB1.2 pattern was slightly more medial than in Z-547 Brain. Caudally, the glyT2:GFP transgenic line labels glycinergic neurons in longitudinal columns in the 548 medulla oblongata [36]. These columns were closely aligned after ZBB1.2 was registered to Z-Brain (Fig.   549 4h).

551
Although best practice is to align directly to either ZBB or Z-Brain, because many researchers will have 552 already registered data sets to either ZBB or Z-Brain, or for cases where it may not be possible to directly representing anatomical regions to meshes and built a Web3D interface using X3D to inspect the spatial 579 relationship between different brain regions (Fig. 5a,b), available online [43]. Users can navigate within 580 the brain using any web browser, rotating and zooming into brain regions to better interrogate larval 581 neuroanatomy. Second, using the Unity platform we wrote a VR app to view the brain and 582 neuroanatomical regions. By running the app on a cell phone, and inserting it into an inexpensive Google 583 cardboard viewer, users can 'walk into' the brain, and see from the inside the inter-relationship between 584 neuroanatomical domains (Fig. 5c,d),  3  4  5  6  7  8  9  10  11  12  13  14  15  16  17  18  19  20  21  22  23  24  25  26  27  28  29  30  31  32  33  34  35  36  37  38  39  40  41  42  43  44  45  46  47  48  49  50  51  52  53  54  55  56  57  58  59  60  61  62  63  64  65 20 neuronal Cerulean or mCardinal as a reference channel when the green and red channels both contained 611 useful information on transgene expression. Our work now demonstrates that it is feasible to contribute to 612 community efforts at building an integrated map of brain structure, expression and activity, while 613 allowing reference image selection to be guided by technical considerations.

854
Values are distances in microns from the corresponding landmarks in the reference brain. Three experts 855 located, blind to the identity of the samples, located the landmarks in each registered image. The distance 856 shown is the mean of the three distances from the same landmarks in the reference brain. To assess 857 reproducibility of locating landmarks in the reference brain, the same three people also located the 858 landmarks in the reference brain (fourth column) demonstrating that these landmarks can be located by 859 experts to within 5 microns. 860   1  2  3  4  5  6  7  8  9  10  11  12  13  14  15  16  17  18  19  20  21  22  23  24  25  26  27  28  29  30  31  32  33  34  35  36  37  38  39  40  41  42  43  44  45  46  47  48  49  50  51  52  53  54  55  56  57  58  59  60  61  62  63  64  65  Table 32. Brain images in ZBB and Z-Brain that were used as templates for registration and/or for 862 measurement of registration precision.

Method
Step Table1 Click here to download Table Table 1 Table 2 Table2 Click here to download Table Table 2 -v02.pdf