{"id":50850438,"url":"https://github.com/bluebrain/ccfv3a-extended-atlas","last_synced_at":"2026-06-14T13:32:50.820Z","repository":{"id":267606385,"uuid":"901353484","full_name":"BlueBrain/ccfv3a-extended-atlas","owner":"BlueBrain","description":null,"archived":false,"fork":false,"pushed_at":"2024-12-13T14:06:36.000Z","size":80,"stargazers_count":8,"open_issues_count":1,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-09-09T17:31:23.931Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/BlueBrain.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-12-10T13:59:45.000Z","updated_at":"2025-08-15T21:31:28.000Z","dependencies_parsed_at":"2025-06-13T07:04:21.929Z","dependency_job_id":"f19f0605-f410-4cf4-a7c7-a257803ec879","html_url":"https://github.com/BlueBrain/ccfv3a-extended-atlas","commit_stats":null,"previous_names":["bluebrain/ccfv3a-extended-atlas"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/BlueBrain/ccfv3a-extended-atlas","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BlueBrain%2Fccfv3a-extended-atlas","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BlueBrain%2Fccfv3a-extended-atlas/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BlueBrain%2Fccfv3a-extended-atlas/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BlueBrain%2Fccfv3a-extended-atlas/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/BlueBrain","download_url":"https://codeload.github.com/BlueBrain/ccfv3a-extended-atlas/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BlueBrain%2Fccfv3a-extended-atlas/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34323994,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-14T02:00:07.365Z","response_time":62,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-06-14T13:32:49.686Z","updated_at":"2026-06-14T13:32:50.809Z","avatar_url":"https://github.com/BlueBrain.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ccfv3a-extended-atlas\n\n# Overview\nThis repository contains the code developed for producing the CCFv3aBBP Nissl-based atlas, an extension of the Allen Institute's Common Coordinate Framework version 3 (CCFv3).\nThe project focuses on enhancing the anatomical correspondance between the Allen Reference Atlas (ARA) Nissl stained volume and the CCFv3 annotations and integrate the necessary data (anatomy and annotation) to provide a comprehensive atlas of the entire mouse brain.\nThis new atlas version extends the main olfactory bulb, cerebellum, and medulla regions. Some additional layers are also incorporated within the resulting CCFv3cBBP version, such as the barrel columns and the spinal cord.\nThis project also made it possible to produce an average Nissl template based on 734 mouse brains.\nThe pipeline and the tools provided in that repository gathers several alignment-based methods for performing a region-based registration mainly, divided into 3 Automated Registration Methods (ARM):\n- ARM A: Alignment of the ARA Nissl volume in the CCFv3,\n- ARM B: Extension of the main olfactory bulb,\n- ARM C: Extension of the cerebellum/medulla.\n\n![Capture d’écran du 2024-12-10 15-29-53](https://github.com/user-attachments/assets/15d9a75e-ccf6-43d6-9da8-c69b0e10bd43)\n\n# Data\nAll the input data can be either directly collected from the Allen Institute platform: https://download.alleninstitute.org/informatics-archive/current-release/mouse_ccf/ or downloaded from that Zenodo repository: https://zenodo.org/records/13640418. This repository also includes the output data produced by the methods.\n\n### CCFv2\n- ARA Nissl (anatomical reference) called `ara_nisslCOR.nrrd`: https://download.alleninstitute.org/informatics-archive/current-release/mouse_ccf/ara_nissl/\n- CCFv2 annotation (labels) called `ccfv2_annot.nrrd`: https://download.alleninstitute.org/informatics-archive/current-release/mouse_ccf/annotation/mouse_2011/\n\n### CCFv3\n- average template (anatomical reference) called `average_template.nrrd`: https://download.alleninstitute.org/informatics-archive/current-release/mouse_ccf/average_template/\n- CCFv3 annotation (labels) called `ccfv3_annot.nrrd`: https://download.alleninstitute.org/informatics-archive/current-release/mouse_ccf/annotation/ccf_2022/\n\n\n# Installation\n```\ngit clone https://github.com/BlueBrain/ccfv3a-extended-atlas.git\ncd CCFv3aBBP  \npip install -r requirements.txt \n```\n\n# Features for ARM A\nAll the following steps for aligning the ARA Nissl volume in the CCFv3 are part of the following pipeline. They are run on a single hemisphere (right) and the output volume is mirrorred according to the interhemispheric plane. The isotropic resolution is 25 micrometers.\n![Capture d’écran du 2024-12-10 16-59-38](https://github.com/user-attachments/assets/3468bebc-7db8-4694-908e-125864c0e530)\n\n### 1. Identify the common hierarchy\nThis steps allows you to identify the common identifiers in both annotation files (CCFv2 and CCFv3) according to their support (number of voxels) in both versions.\nThis is just a tool for letting you identify the regions of interest you will focus on, as well as the level of ontology you would choose for applying the pipeline.\nIn the following steps, we took the example of the regitration of the `main olfactory bulb` region, with acronym `MOB`.\n```\npython tools/common_hierarchy.py [...]/ccfv3_hierarchy.json [...]/ccfv2_hierarchy.json [...]/input_hier_id_file_list.json [...]/output_folder\n```\n\n### 2. Create the hierarchy file subdivision\nThis step allows you to focus on one single region with all its descendants.\nThe output file in the case of the `main olfactory bulb` example will be `MOB.npy`, corresponding to the acronym of the region, including all the identifiers of the main olfactory bulb region.\n```\nmkdir [...]/ids\npython tools/hierarchy_id.py [...]/id main_olfactory_bulb yes no yes no\n```\n\n### 3. Run the linear and nonlinear monomodal registration with the annotation files (A1)\nYou can either run this step yourself using the following command line or extract the result from the first step of the `deep-atlas-pipeline` at https://github.com/BlueBrain/Deep-Atlas.\nThis step will produce a registered annotation file called `ccfv2_annot_SyN.nrrd`, plus the attached transformation file. This output transformation file should be applied to the ARA Nissl volume as well, then called `ara_nisslCOR_SyN.nrrd`\n```\npython pipeline/registration_antspy.py [...]/ccfv3_annot.nrrd [...]/ccfv2_annot.nrrd [...]/output_folder yes nrrd SyN mattes nearest\n```\n\n### 4. Create the mask of all the selected regions in the CCFv2 (A2)\nOnce you know all the identifiers concerned by the selected region, you can create the corresponding mask of the region in the pre-aligned CCFv2.\nYou can apply this mask on the anatomical file using a simple volume multiplication to produce the file corresponding to the anatomy of this only region.\n```\nmkdir [...]/ccfv2_masks\nmkdir [...]/ccfv2_annat_masked\npython pipeline/mask_id_annot.py [...]/ccfv2_annot_SyN.nrrd [...]/id/MOB.npy [...]/ccfv2_masks/ccfv2_annot_SyN_MOB.nrrd\npython tools/math2 [...]/ara_nisslCOR_SyN.nrrd [...]/ccfv2_masks/ccfv2_annot_SyN_MOB.nrrd [...]/ccfv2_annat_masked/ara_nisslCOR_SyN_MOB.nrrd .x\n```\n\n### 5. Create the mask of all the selected regions in the CCFv3 (A2)\nOnce you know all the identifiers concerned by the region, you can create the corresponding mask of the region in the CCFv3.\nYou can apply this mask on the anatomical file using a simple volume multiplication to produce the file corresponding to the anatomy of this only region.\n```\nmkdir [...]/ccfv3_masks\nmkdir [...]/ccfv3_annat_masked\npython pipeline/mask_id_annot.py [...]/ccfv3_annot.nrrd [...]/id/MOB.npy [...]/ccfv3_masks/ccfv3_annot_MOB.nrrd\npython [...]/average_template.nrrd [...]/ccfv3_masks/ccfv3_annot_MOB.nrrd mkdir [...]/ccfv3_annat_masked/average_template_MOB.nrrd .x\n```\n\n### 6. Run the linear and nonlinear multimodal registration on the masked anatomical files (A3)\nThis step aims at aligning the selected anatomical masked file between the ARA Nissl volume and the average template (i.e. from the CCFv2 to the CCFv3). You need first to convert the NRRD file into the NIFTI format.\n```\nmkdir [...]/registered_annat\npython pipeline/registration_niftireg_regF3D.py [...]/ccfv3_annat_masked/average_template_MOB.nii.gz [...]/ccfv2_annat_masked/ara_nisslCOR_SyN_MOB.nii/gz [...]/registered_annat/ara_nisslCOR_SyN_MOB_res.nii.gz\n```\n\n### 7. Mask all the output files (A4)\nOnce you did this registration for all the regions of interest at the level of ontolgy you chose and stored in the `[...]/registered_annat` folder, you can mask all the resulting anatomical files.\n```\nmkdir [...]/registered_annat_masked\npython pipeline/mask_subregions_folder.py [...]/registered_annat [...]/ccfv3_masks [...]/registered_annat_masked\n```\n\n### 8. Combine all the masked output files (A4)\nThis step combines all files from a given folder in adding them and results into a single volume.\n```\npython tools/add_images_from_folder.py [...]/registered_annat_masked [...]/reconstructed_aligned_ara_nisslCOR_SyN.nrrd\n```\n\n### 9. Run the final nonlinear monomodal registration step (A5)\nThis step aims at aligning the raw ARA Nissl with the reconstructed aligned ARA Nissl in the CCFv3. You also need to convert all NRRD files into the NIFTI format.\n```\npython pipeline/registration_niftireg_regF3D.py [...]/reconstructed_aligned_ara_nisslCOR_SyN.nii.gz [...]/ara_nisslCOR_SyN.nii.gz [...]/ara_nisslCOR_SyN_res.nii.gz\n```\n### Note\nThis method does not work for the cerebellum, which requires specific processing (see ARM C). Step A5 should only be applied once the Nissl volume has been fully reconstructed in the CCFv3 with all the independant alignments, i.e., including the results from ARM C.\n\n\n# Features for ARM B\nAll the following steps for extended the ARA Nissl main olfactory bulb (rostral) in the CCFv3 are part of the following pipeline. They are run on a single hemisphere (right) and the output volume is mirrorred according to the interhemispheric plane. The isotropic resolution is 25 micrometers.\n![Capture d’écran du 2024-12-11 08-55-01](https://github.com/user-attachments/assets/4cf784e6-6fe7-424b-8d2e-ca48c14c5328)\n\n### 1. Run the rough linear monomodal registration (B1)\nThis first step aims at roughly aligning the Allen Institute for Brain Science (AIBS) Nissl data in the sagittal incidence `aibs_nisslSAG.nrrd` with the ARA Nissl `ara_nisslCOR_SyN_res.nrrd` ailgned in the CCFv3. A first step for adapting the field of view of both data is required.\n```\npython pipeline/registration_antspy.py [...]/ara_nisslCOR_SyN_res.nrrd [...]/aibs_nisslSAG.nrrd [...]/output_folder yes nrrd Affine mattes linear\n```\nThis step is producing the aligned `aibs_nisslSAG_Affine.nrrd` file, plus an attached transformation file.\n\n### 2. Create the bounding box (B2)\nOnce the two data are roughly aligned, you can identify the bounding box corresponding to the olfactory area region, with acronym OLF. This will produce a file with all the identifiers for the OLF region, called `OLF.npy`.\n```\npython tools/hierarchy_id.py [...]/id olfactory_areas yes no yes no\npython pipeline/mask_id_annot.py [...]/ccfv3_annot.nrrd [...]/OLF.npy [...]/ccfv3_annot_OLF.nrrd\npython tools/bounding_box.py [...]/ccfv3_annot_OLF.nrrd [...]/ccfv3_annot_OLF_bounding_box.nrrd\n```\n\n### 3. Mask the data using the bounding box (B3)\nOnce the bounding box is calculated, you can apply it to the two volumes.\n```\npython tools/math2.py [...]/ara_nisslCOR_SyN_res.nrrd [...]/ccfv3_annot_OLF_bounding_box.nrrd [...]/ara_nisslCOR_SyN_res_OLF.nrrd .x\npython tools/math2.py [...]/aibs_nisslSAG_Affine.nrrd [...]/ccfv3_annot_OLF_bounding_box.nrrd [...]/aibs_nisslSAG_Affine_OLF.nrrd .x\n```\n\n### 4. Run the nonlinear monomodal registration (B4)\nThis step aims at aligning more precisely the two masked data together. It will produce a deformation field file `aibs_nisslSAG_Affine_OLF_SyN_df.npy`.\n```\npython pipeline/registration_antspy.py [...]/ara_nisslCOR_SyN_res_OLF.nrrd [...]/aibs_nisslSAG_Affine_OLF.nrrd [...]/output_folder yes nrrd SyN mattes linear\n```\n\n### 5. Apply the deformation field to the non masked data (B5)\nOnce the deformation field is calculated, you can apply it to the non masked data.\n```\npython tools/apply_def_field.py [...]/ara_nisslCOR_SyN_res_OLF.nrrd [...]/aibs_nisslSAG_Affine.nrrd [...]/aibs_nisslSAG_Affine_OLF_SyN_df.npy [...]/aibs_nisslSAG_Affine_OLF_SyN_nonmasked.nrrd linear\n```\n\n### 6. Merge the output data (B6)\nThis steps aims at merging the extended and aligned olfactory bulb tissue from  `[...]/aibs_nisslSAG_Affine_SyN_nonmasked.nrrd` to `[...]/ara_nisslCOR_SyN_res.nrrd`. Several ways of performing this merging are possible. Here is one way of doing it.\n```\npython\nimport nrrd\nimport numpy as np\nnissl_sag, _ = nrrd.read([...]/aibs_nisslSAG_Affine_OLF_SyN_nonmasked.nrrd)\nnissl_cor, hd = nrrd.read([...]/ara_nisslCOR_SyN_res.nrrd)\nmask_OLF, _ = nrrd.read([...]/ccfv3_annot_OLF_bounding_box.nrrd)\nnissl_sag_mask = (nissl_sag*mask_OLF \u003e 0).astype(int)\nnissl_cor_mask = (nissl_cor*mask_OLF \u003e 0).astype(int)\nextension_mask = abs(nissl_sag_mask - nissl_cor_mask)\ncoord = np.where(extension_mask != 0)\nnissl_cor[coord] = nissl_sag[coord]\nnrrd.write([...]/ara_nisslCOR_SyN_res_extendedMOB.nrrd, nissl_cor, header = hd)\n```\n\n# Features for ARM C\nAll the following steps for extended the ARA Nissl cerebellum and medulla (caudal) in the CCFv3 are part of the following pipeline. They are run on a single hemisphere (right) and the output volume is mirrorred according to the interhemispheric plane. The isotropic resolution is 25 micrometers.\n![Capture d’écran du 2024-12-11 09-50-02](https://github.com/user-attachments/assets/129dee5f-db9d-43fa-abcc-038dfc014fb0)\n\n### 1. Run the strong monomodal nonlinear label alignment (C1)\nThe process will be presented for one single cerebellar lobule as an example: Flocculus with acronym FL. The following steps C1 and C2 are run independently on the sixteen cerebellar lobules with the following acronyms: Ansiform lobule Crus 1 (ANcr1), Ansiform lobule Crus 2 (ANcr2), Central lobule (II) (CENT2), Central lobule (III) (CENT3), Copula pyramidis (COPY), Culmen lobules (IV-V) (CUL4, 5), Declive (VI) (DEC), Flocculus (FL), Folium-tuber vermis (VII) (FOTU), Lingula (I) (LING), Nodulus (X) (NOD), Parafliocculus (PFL), Paramedian lobule (PRM), Pyramus (VIII) (PYR), Simple lobule (SIM), and Uvula (IX) (UVU).\n```\nmkdir [...]/lobule_ids\nmkdir [...]/lobule_masks_ccfv2\nmkdir [...]/lobule_masks_ccfv3\nmkdir [...]/lobule_masks_registered\npython tools/hierarchy_id.py [...]/lobule_ids Flocculus yes no yes no\npython pipeline/mask_id_annot.py [...]/ccfv2_annot_SyN.nrrd [...]/lobule_ids/FL.npy [...]/lobule_masks_ccfv2/ccfv2_annot_SyN_FL.nrrd\npython pipeline/mask_id_annot.py [...]/ccfv3_annot.nrrd [...]/FL.npy [...]/lobule_masks_ccfv3/ccfv3_annot_FL.nrrd\npython pipeline/registration_antspy.py [...]/lobule_masks_ccfv3/ccfv3_annot_FL.nrrd [...]/lobule_masks_ccfv2/ccfv2_annot_SyN_FL.nrrd [...]/lobule_masks_registered yes nrrd SyNAggro mattes demons\n```\n\n### 2. Apply the deformation field to the corresponding anatomical file (C2)\nOnce the deformation field is calculated, it can be applied to the corresponding annatomical file. Repeat this step for all the sixteen lobules.\n```\nmkdir [...]/anatomical_lobules\nmkdir [...]/anatomical_lobules_registered\npython tools/math2.py [...]/ara_nisslCOR_SyN.nrrd [...]/lobule_masks_ccfv2/ccfv2_annot_SyN_FL.nrrd [...]/anatomical_lobules/ara_nisslCOR_SyN_FL.nrrd .x\npython tools/apply_def_field.py [...]/lobule_masks_ccfv3/ccfv3_annot_FL.nrrd [...]/anatomical_lobules/ara_nisslCOR_SyN_FL.nrrd [...]/lobule_masks_registered/ccfv2_annot_SyN_FL_SyNAggro_df.npy [...]/anatomical_lobules_registered/ara_nisslCOR_SyN_FL_SyNAggro.nrrd\n```\n\n### 3. Reconstruct the annatomical cerebellum and incorporate it to the reconstruction from A4 (C3)\nThis step aims at masking and then merging all the aligned anatomical cerebellar lobules in one single volume. You can either reconstruct all the cerebellar layers in an independant file, for identifying their sublayers for instance, but you can also merge the result with all the other anatomical tissues in the CCFv3 from step A4, for then running the step A5 including all brain regions. \n```\nmkdir [...]/anatomical_lobules_registered_masked\npython pipeline/mask_subregions_folder.py [...]/anatomical_lobules_registered mkdir [...]/lobule_masks_ccfv3 [...]/anatomical_lobules_registered_masked\ncp [...]/reconstructed_aligned_ara_nisslCOR_SyN.nrrd [...]/anatomical_lobules_registered_masked # Run this (coming from step A4) only if you want to reconstruct the entire Nissl brain in the CCFv3 for then running step A5, otherwise ignore it\npython tools/add_images_from_folder.py [...]/anatomical_lobules_registered_masked [...]/reconstructed_aligned_ara_nisslCOR_SyN_CB.nrrd \n```\n\n### 4. Extend the cerebellum and medulla and merge the results (C4-C5)\nApply the same steps from ARM B but with a bounding box including the cerebellum and the medulla independently and using the Waxholm Nissl volume in the horizontal incidence `waxh_NisslHOR.nrrd`. A first step for adapting the field of view of both data is required. You can then identify the lobule sub-layers (granular and molecular), using an Otsu thresholding for instance, on the resulting `reconstructed_aligned_ara_nisslCOR_SyN_CB.nrrd` cerebellar lobule volume.\n\n### Note\nStep A5 should be applied only once the ARM C is performed for filling the cerebellar lobules in the final reconstructed volume with the proper aligned tissue.\n\n# Citation\nPiluso, S., Veraszto, C., Carey, H., Delattre, E., L’Yvonnet, T., Colnot, E., Romani, A., Bjaalie, J. G., Markram, H., \u0026 Keller, D. (2024). An extended and improved CCFv3 annotation and Nissl atlas of the entire mouse brain. bioRxiv, doi: 0.1101/2024.11.06.622212.\n\n# Funding \u0026 Acknowledgment\nThe development of this software was supported by funding to the Blue Brain Project, a research center of the École polytechnique fédérale de Lausanne (EPFL), from the Swiss government's ETH Board of the Swiss Federal Institutes of Technology.\nCopyright (c) 2024 Blue Brain Project/EPFL\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbluebrain%2Fccfv3a-extended-atlas","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbluebrain%2Fccfv3a-extended-atlas","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbluebrain%2Fccfv3a-extended-atlas/lists"}