# How to switch between the 3 coordinate systems of Mouse Connectivity?

**URL:** <https://community.brain-map.org/t/how-to-switch-between-the-3-coordinate-systems-of-mouse-connectivity/952>\
**Category:** Technical\
**Tags:** reference-coordinates, brain-explorer, atlas-mouse-brain-connectivity, connectivity, allensdk\
**Created:** [February 22, 2021, 5:48am UTC](https://community.brain-map.org/t/how-to-switch-between-the-3-coordinate-systems-of-mouse-connectivity/952 "2021-02-22T05:48:17Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![orio](https://avatars.discourse-cdn.com/v4/letter/o/e99b99/32.png) [@orio](https://community.brain-map.org/u/orio)\
**Post date:** [February 22, 2021, 5:48am UTC](https://community.brain-map.org/t/how-to-switch-between-the-3-coordinate-systems-of-mouse-connectivity/952/1 "2021-02-22T05:48:17Z")

</div>

There are 3 coordinate systems for mouse connectivity.

1. The output of get\_projection\_density() of [allensdk.core.mouse\_connectivity\_cache](https://allensdk.readthedocs.io/en/latest/connectivity.html). It is (AP, DV, ML) and have the size of 528x320x456 (Unit: voxel). Bregma is roughly at (200, 0, 228) I guess.
2. The “Location” of the Brain Explorer 2. It is also (AP, DV, ML) (Unit: ??). Bregma is roughly at (6, 0, 4) I guess.
3. The Bregma(AP, ML, DV, 0) at the website is the [Stereotaxic Coordinates System](http://help.brain-map.org/download/attachments/2818171/InjectionSites_and_StereotaxicCoordinates.pdf) (Unit: mm). Bregma is at (0, 0, 0) I guess.

How can I convert the coordinates among these 3 systems? I especially want to convert between system 1 and system 3. Thanks!

---

<div class="post-metadata">

**Author:** ![lydian](https://yyz1.discourse-cdn.com/flex027/user_avatar/community.brain-map.org/lydian/32/174_2.png) [@lydian](https://community.brain-map.org/u/lydian)\
**Post date:** [February 24, 2021, 10:56pm UTC](https://community.brain-map.org/t/how-to-switch-between-the-3-coordinate-systems-of-mouse-connectivity/952/2 "2021-02-24T22:56:14Z")

</div>

Hi @orio,

The first two coordinate systems (1),(2) you listed are in CCF coordinates where zero is at the corner of the bounding volume as shown in this image:

 ![CCFCoordindateSystem](https://canada1.discourse-cdn.com/flex027/uploads/brainobservatory/original/1X/44f3499fd49d9396d9d12597725afd41693582f5.png)  
Note that we don’t have a bregma location in CCF as described in this [post](https://community.brain-map.org/t/why-doesnt-the-3d-mouse-brain-atlas-have-bregma-coordinates/158).

In (1), the SDK tutorial guides you to download gridded projection density data. It defaults to downloading data at 25 micron resolution. Hence each voxel of the [528, 320, 456] grid is 25 micron isotropic.

In (2), the “Location” in Brain Explorer 2 display CCF coordinates in millimeters (mm)

System (3) are the coordinates used in each case for stereotaxic injection. Below is a snippet from the [whitepaper](http://help.brain-map.org/download/attachments/2818171/Connectivity_Overview.pdf?version=2&modificationDate=1489022310670&api=v2) describing these coordinates:

> **Selection of Stereotaxic Coordinates**
> 
> Atlas-derived stereotaxic coordinates were chosen for each target area based on _The Mouse Brain in Stereotaxic Coordinates_ (Paxinos and Franklin, 2001). For the majority of target sites, the anterior/posterior (AP) coordinates were referenced from Bregma, the medial/lateral (ML) coordinates were distance from midline at Bregma, and dorsal/ventral (DV) coordinates were measured from the pial surface of the brain. For several of the most caudal medullary nuclei ( _e.g._ , gracile nucleus and spinal nucleus of the trigeminal, caudal part), the calamus (at the floor of the 4th ventricle) was used as a registration point instead of Bregma. For many cortical areas, injections were made at two depths to label neurons throughout all six cortical layers and/or at an angle to infect neurons along the same cortical column. For laterally located cortical areas ( _e.g._ orbital area, medial part; prelimbic area; agranular insular area), the injection was made at two adjacent ML coordinates as the pipette angle required for injection along the cortical column was nearly 90° and technically infeasible.

We cannot convert between (1) and (3) because (3) is respect to a skull base landmark and that information is lost when the brain is dissected and processed.

However, for each case, the injection location has been annotated on the images. Because it is on the image we can transform that into CCF space. Most of the analysis you see on the website is with respect to this annotated injection location. Take a look at this SDK [document](https://allensdk.readthedocs.io/en/latest/_static/examples/nb/mouse_connectivity.html#Manipulating-Grid-Data) to see how to access the injection site location.

---

<div class="post-metadata">

**Author:** ![orio](https://avatars.discourse-cdn.com/v4/letter/o/e99b99/32.png) [@orio](https://community.brain-map.org/u/orio)\
**Post date:** [February 25, 2021, 12:14am UTC](https://community.brain-map.org/t/how-to-switch-between-the-3-coordinate-systems-of-mouse-connectivity/952/3 "2021-02-25T00:14:59Z")

</div>

> [@lydian](#):
>
> Take a look at this SDK [document](https://allensdk.readthedocs.io/en/latest/_static/examples/nb/mouse_connectivity.html#Manipulating-Grid-Data) to see how to access the injection site location.

@lydian Thanks for your reply! To find (or at least to approximate) the injection site location in [528, 320, 456] is mainly what I want to do. In the example inside the SDK document, we obtained the value of (`injection_x`, `injection_y`, `injection_z`), i.e. (4300, 2690, 7050), from the Python code. Do they refer to (43mm, 26.9mm, 70.5mm) in System (2)? If no, which system does these values refer to?

Besides, regarding your reply “In (2), the ‘Location’ in Brain Explorer 2 display CCF coordinates in millimeters (mm)”, from your words I understand that 3.2 in Brain Explorer 2 refer to 32mm, which please let me know if I am wrong.

---

<div class="post-metadata">

**Author:** ![lydian](https://yyz1.discourse-cdn.com/flex027/user_avatar/community.brain-map.org/lydian/32/174_2.png) [@lydian](https://community.brain-map.org/u/lydian)\
**Post date:** [February 25, 2021, 10:37pm UTC](https://community.brain-map.org/t/how-to-switch-between-the-3-coordinate-systems-of-mouse-connectivity/952/4 "2021-02-25T22:37:08Z")

</div>

> [@orio](#):
>
> i.e. (4300, 2690, 7050), from the Python code. Do they refer to (43mm, 26.9mm, 70.5mm) in System (2)? If no, which system does these values refer to?

(4200,2690,7050) are in microns

> [@orio](#):
>
> from your words I understand that 3.2 in Brain Explorer 2 refer to 32mm

3.2 in Brain Explorer = 3.2mm

---

<div class="post-metadata">

**Author:** ![weiyouzi321](https://yyz1.discourse-cdn.com/flex027/user_avatar/community.brain-map.org/weiyouzi321/32/684_2.png) [@weiyouzi321](https://community.brain-map.org/u/weiyouzi321)\
**Post date:** [September 14, 2022, 7:41am UTC](https://community.brain-map.org/t/how-to-switch-between-the-3-coordinate-systems-of-mouse-connectivity/952/5 "2022-09-14T07:41:35Z")

</div>

Hi@lydian, I also come to some problems of coordinate systems when using CCFv3.  
When using WholeBrain to register my own data,I will get the stereotaxic coordinate (AP,ML,DV) of the neuron on the Mouse Brain Atlas;But I find it difficult to position this neuron on the 3D average template since its coordinate is based on voxel.  
I wonder if there was an approach to switch the stereotaxic coordinate to the voxel coordinate  
many thanks in advance and look forward to your advise

WholeBrain result:

 ![wholebrain](https://canada1.discourse-cdn.com/flex027/uploads/brainobservatory/original/1X/27add95c4b926c082cde0c3f3c803a1c0cf01222.png)

average template  
 ![template](https://canada1.discourse-cdn.com/flex027/uploads/brainobservatory/original/1X/4691a138b4aa6a1f6ddc4175d656d97aa5347a41.png)

---

<div class="post-metadata">

**Author:** ![lydian](https://yyz1.discourse-cdn.com/flex027/user_avatar/community.brain-map.org/lydian/32/174_2.png) [@lydian](https://community.brain-map.org/u/lydian)\
**Post date:** [September 22, 2022, 8:16pm UTC](https://community.brain-map.org/t/how-to-switch-between-the-3-coordinate-systems-of-mouse-connectivity/952/6 "2022-09-22T20:16:13Z")

</div>

We currently do not have mapping between CCFv3 voxel coordinates and stereotaxic coordinates

---

<div class="post-metadata">

**Author:** ![lydian](https://yyz1.discourse-cdn.com/flex027/user_avatar/community.brain-map.org/lydian/32/174_2.png) [@lydian](https://community.brain-map.org/u/lydian)\
**Post date:** [September 26, 2022, 10:12pm UTC](https://community.brain-map.org/t/how-to-switch-between-the-3-coordinate-systems-of-mouse-connectivity/952/7 "2022-09-26T22:12:39Z")

</div>

This post may be relevant to what you are looking for:

> [@How to transform CCF (x, y, z) coordinates into stereotactic coordinates](https://community.brain-map.org/t/how-to-transform-ccf-x-y-z-coordinates-into-stereotactic-coordinates/1858):
>
> The Common Coordinate Framework (CCF) is defined in a basic image coordinate system, using the top-left-rear pixel as its origin, and incrementing in the X, Y and Z axes up to the number of pixels in each dimension (ML, DV, AP respectively). It was not designed as a targeting coordinate system. Using some transformations the CCF can be roughly aligned to the stereotactic atlas, however, since it was not it’s intended purpose one should take caution when using the CCF for targeting, even after ap…
