Skip to content

Commit 52702e3

Browse files
committed
Formatting
1 parent a0aa287 commit 52702e3

File tree

2 files changed

+128
-97
lines changed

2 files changed

+128
-97
lines changed

ibllib/atlas/__init__.py

Lines changed: 53 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
For examples and tutorials on using the IBL atlas package, see
44
https://docs.internationalbrainlab.org/atlas_examples.html
55
6-
TODO Explain differences between this package and the Allen SDK.
7-
Much of this was adapted from the [cortexlab allenCCF repository](https://github.com/cortex-lab/allenCCF).
6+
.. TODO Explain differences between this package and the Allen SDK.
7+
Much of this was adapted from the `cortexlab allenCCF repository <https://github.com/cortex-lab/allenCCF>`_.
88
99
Terminology
1010
-----------
@@ -37,12 +37,12 @@
3737
There are two principal mouse brain atlases in this module:
3838
3939
1. The Allen Common Coordinate Framework (CCF) [1]_.
40-
2. The Mouse Brain in Stereotaxic Coordinates (MBSC) 4th Edition, by Paxinos G, and Franklin KBJ [2]_ and matched to
41-
to the Allen Common Coordiante Framework by Chon et al. [10]
40+
2. The Mouse Brain in Stereotaxic Coordinates (MBSC) 4th Edition, by Paxinos G, and Franklin KBJ [2]_, matched to
41+
to the Allen Common Coordiante Framework by Chon et al. [3]_.
4242
4343
The latter is referred to here as the 'Franklin-Paxinos atlas'. These atlases comprise a 3D array of voxels and their associated
4444
brain region identifiers (labels) at a given resolution. The Allen Atlas can be instantiated in 10um, 25um or 50um resolution.
45-
The Franklin-Paxinos atlas has a resolution of 10um in the ML and DV axis, and 100um in the AP axis. TODO Mention flat maps.
45+
The Franklin-Paxinos atlas has a resolution of 10um in the ML and DV axis, and 100um in the AP axis. **TODO Mention flat maps.**
4646
4747
4848
Scalings
@@ -51,14 +51,14 @@
5151
to account for distortion that occurs during the imaging and tissue fixation process:
5252
5353
1. The Needles atlas - 40 C57BL/6J (p84) mice underwnt MRI imaging post-mortem while the brain was still in the skull, followed by
54-
conventional Nissl histology [3]_. These mouse brain atlas images combined with segmentation (known as DSURQE) were manually
54+
conventional Nissl histology [4]_. These mouse brain atlas images combined with segmentation (known as DSURQE) were manually
5555
transformed onto the Allen CCF atlas to determine the scaling.
5656
2. The MRI Toronto - 12 p65 mice MRI images were taken *in vivo* then averaged and transformed on the Allen CCF atlas to determine
57-
the scaling [4]_.
57+
the scaling [5]_.
5858
5959
All scaling is currently linear. Scaling of this kind can be applied arbitrarily to better represent a specific mouse age and
60-
sex [4]_. NB: In addition to distortions, the Allen CFF atlas is pitched down by about 5 degrees relative to a flat skull (where
61-
bregma and lambda are at the same DV height) [5]_, however this is not currently accounted for.
60+
sex [5]_. NB: In addition to distortions, the Allen CFF atlas is pitched down by about 5 degrees relative to a flat skull (where
61+
bregma and lambda are at the same DV height) [6]_, however this is not currently accounted for.
6262
6363
6464
Mappings
@@ -69,7 +69,7 @@
6969
7070
1. Beryl - brain atlas annotations without layer sub-divisions or certain ganglial/nucleus sub-devisisions (e.g. the core/shell
7171
sub-division of the lateral geniculate nucleus). Fibre tracts, pia, etc. are also absent. The choice of which areas to combine
72-
was guided partially by the computed volume of each area. This mapping is used in the brainwide map and prior papers [6]_ [7]_
72+
was guided partially by the computed volume of each area. This mapping is used in the brainwide map and prior papers [7]_, [8]_
7373
.
7474
2. Cosmos - coarse brain atlas annotations, dividing the atlas into 10 broad areas: isocortex, olfactory areas, cortical subplate,
7575
cerebral nuclei, thalamus, hypothalamus, midbrain, hindbrain, cerebellum and hippocampal formation.
@@ -78,7 +78,7 @@
7878
7979
Non-Allen mappings:
8080
81-
3. Swanson - the brain atlas annotations from the Swansan rat brain flat map [8]_, mapped to the Allen atlas manually by Olivier
81+
3. Swanson - the brain atlas annotations from the Swansan rat brain flat map [9]_, mapped to the Allen atlas manually by Olivier
8282
Winter. See `Fixtures`_ for details.
8383
8484
Each mapping includes both a lateralized (suffix '-lr') and non-laterized version. The lateralized mappings assign a different ID
@@ -89,12 +89,13 @@
8989
9090
Notes
9191
-----
92-
The Allen atlas and the CCF annotations have different release dates and versions [8]_. The annotations used by IBL are the 2017
92+
The Allen atlas and the CCF annotations have different release dates and versions [10]_. The annotations used by IBL are the 2017
9393
version.
9494
9595
The IBL uses the following conventions:
9696
97-
- All atlas images have dimensions (AP, ML, DV). With C-ordering this makes coronal slicing most efficient.
97+
- All atlas images have dimensions (AP, ML, DV). With C-ordering this makes coronal slicing most efficient. The origin is the top
98+
left corner of the image.
9899
- Coordinates are provided in the order (ML AP DV) and are in meters relative to bregma.
99100
- Left hemisphere ML coordinates are -ve; right, +ve.
100101
- AP coordinates anterior to bregma are +ve; posterior, -ve.
@@ -104,29 +105,6 @@
104105
- All left hemisphere regions have negative region IDs in all lateralized mappings.
105106
106107
107-
References
108-
----------
109-
.. [1] © 2015 Allen Institute for Brain Science. Allen Mouse Brain Atlas (2015) with region annotations (2017).
110-
Available from: http://download.alleninstitute.org/informatics-archive/current-release/mouse_ccf/annotation/
111-
.. [2] Paxinos G, and Franklin KBJ (2012) The Mouse Brain in Stereotaxic Coordinates, 4th edition (Elsevier Academic Press)
112-
.. [3] Dorr AE, Lerch JP, Spring S, Kabani N, Henkelman RM (2008). High resolution three-dimensional brain atlas using an average
113-
magnetic resonance image of 40 adult C57Bl/6J mice. Neuroimage 42(1):60-9. [doi 10.1016/j.neuroimage.2008.03.037]
114-
.. [4] Qiu, LR, Fernandes, DJ, Szulc-Lerch, KU et al. (2018) Mouse MRI shows brain areas relatively larger
115-
in males emerge before those larger in females. Nat Commun 9, 2615. [doi 10.1038/s41467-018-04921-2]
116-
.. [5] International Brain Laboratory et al. (2022) Reproducibility of in-vivo electrophysiological measurements in mice.
117-
bioRxiv. [doi 10.1101/2022.05.09.491042]
118-
.. [6] International Brain Laboratory et al. (2023) A Brain-Wide Map of Neural Activity during Complex Behaviour.
119-
bioRxiv. [doi 10.1101/2023.07.04.547681]
120-
.. [7] Findling C et al. (2023) Brain-wide representations of prior information in mouse decision-making.
121-
bioRxiv. [doi 10.1101/2023.07.04.547684]
122-
.. [8] Swanson LW (2018) Brain maps 4.0—Structure of the rat brain: An open access atlas with global nervous system nomenclature
123-
ontology and flatmaps. J Comp Neurol. [doi 10.1002/cne.24381]
124-
.. [9] Allen Mouse Common Coordinate Framework Technical White Paper (October 2017 v3)
125-
http://help.brain-map.org/download/attachments/8323525/Mouse_Common_Coordinate_Framework.pdf
126-
.. [10] Chon et al (2019) Enhanced and unified anatomical labeling for a common mouse brain atlas
127-
[doi 10.1038/s41467-019-13057-w]
128-
129-
130108
Examples
131109
--------
132110
Below are some breif API examples. For in depth tutorials on using the IBL atlas package, see
@@ -145,10 +123,11 @@
145123
Fixtures
146124
--------
147125
148-
* TODO List the data files in this package, their purpose, data types, shape, etc.
149-
* TODO List the remote files used by this package, e.g. annotations files, swansonpaths.json, etc.
126+
.. TODO List the data files in this package, their purpose, data types, shape, etc.
127+
.. TODO List the remote files used by this package, e.g. annotations files, swansonpaths.json, etc.
150128
151-
### Local files
129+
Local files
130+
^^^^^^^^^^^
152131
153132
* **allen_structure_tree.csv** - TODO Document. Where does this come from? Is it modified from either structure_tree_safe.csv or
154133
structure_tree_safe_2017.csv?
@@ -162,33 +141,58 @@
162141
The rows contain the correspondence of each mapping to the int64 index of the lateralized Allen structure tree. The table is
163142
generated by ibllib.atlas.regions.BrainRegions._compute_mappings.
164143
165-
### Remote files
144+
Remote files
145+
^^^^^^^^^^^^
166146
167147
* **annotation_<res_um>.nrrd** - A 3D volume containing indicies of the regions in the associated
168148
structure tree. `res_um` indicates the isometric spacing in microns. These uint16 indicies are
169149
known as the region 'index' in the structure tree, i.e. the position of the region in the
170150
flattened tree.
171151
* **average_template_<res_um>.nrrd** - TODO Document
172152
* **annotation_<res_um>_lut_<LUT_VERSION>.npz** - TODO Document
173-
* FranklinPaxinons/annotation_<res_um>.npz - A 3D volume containing indices of the regions associated with
174-
the Franklin Paxinos structure tree. The volume was created from the images provided in Supplemtary Data 4 of
175-
reference [10] and stitched together as a single volume using SimpleITK.
176-
* FranklinPaxinons/average_template_<res_um>.npz - A 3D volume containing the Allen dwi image slices corresponding to
177-
the slices in the annotation volume. The volume was created from the images provided in Supplemtary Data 5 of
178-
reference [10] and stitched together as a single volume using SimpleITK.
153+
* **FranklinPaxinons/annotation_<res_um>.npz** - A 3D volume containing indices of the regions associated with the Franklin-
154+
Paxinos structure tree.
155+
* **FranklinPaxinons/average_template_<res_um>.npz** - A 3D volume containing the Allen dwi image slices corresponding to
156+
the slices in the annotation volume [*] .
179157
* **swansonpaths.json** - The paths of a vectorized Swanson flatmap image [*]. The vectorized version was generated
180158
from the Swanson bitmap image using the matlab contour function to find the paths for each region. The paths for each
181-
region were then simplified using the Ramer Douglas Peucker algorithm https://rdp.readthedocs.io/en/latest/
159+
region were then simplified using the `Ramer Douglas Peucker algorithm <https://rdp.readthedocs.io/en/latest/>`_
182160
* **swanson2allen.npz** - TODO Document who made this, its contents, purpose and data type
183161
* **<flatmap_name>_<res_um>.nrrd** - TODO Document who made this, its contents, purpose and data type
184162
* **gene-expression.pqt** - TODO Document who made this, its contents, purpose and data type
185163
* **gene-expression.bin** - TODO Document who made this, its contents, purpose and data type.
186164
165+
.. [*] The annotation and average template volumes were created from the images provided in Supplemtary Data 4 of Chon et al. [3]_
166+
and stitched together as a single volume using SimpleITK.
187167
.. [*] output of aggType 2 in https://github.com/cortex-lab/allenCCF/blob/master/Browsing%20Functions/aggregateAcr.m
188168
.. [*] output of aggType 1 in https://github.com/cortex-lab/allenCCF/blob/master/Browsing%20Functions/aggregateAcr.m
189169
.. [*] the paths were generated from a bitmap of the
190-
[BM3 rat flatmap 3.0 foldout poster](https://larrywswanson.com/wp-content/uploads/2015/03/BM3-flatmap-foldout.pdf) in
191-
[Swanson LW (2004) Brain Maps, 3rd ed.](https://larrywswanson.com/?page_id=164) TODO where is code for this?
170+
`BM3 rat flatmap 3.0 foldout poster <https://larrywswanson.com/wp-content/uploads/2015/03/BM3-flatmap-foldout.pdf>`_
171+
in `Swanson LW (2004) Brain Maps, 3rd ed. <https://larrywswanson.com/?page_id=164>`_ TODO where is code for this?
172+
173+
174+
References
175+
----------
176+
.. [1] © 2015 Allen Institute for Brain Science. Allen Mouse Brain Atlas (2015) with region annotations (2017).
177+
Available from: http://download.alleninstitute.org/informatics-archive/current-release/mouse_ccf/annotation/
178+
.. [2] Paxinos G, and Franklin KBJ (2012) The Mouse Brain in Stereotaxic Coordinates, 4th edition (Elsevier Academic Press)
179+
.. [3] Chon U et al (2019) Enhanced and unified anatomical labeling for a common mouse brain atlas
180+
[doi 10.1038/s41467-019-13057-w]
181+
.. [4] Dorr AE, Lerch JP, Spring S, Kabani N, Henkelman RM (2008). High resolution three-dimensional brain atlas using an average
182+
magnetic resonance image of 40 adult C57Bl/6J mice. Neuroimage 42(1):60-9. [doi 10.1016/j.neuroimage.2008.03.037]
183+
.. [5] Qiu, LR, Fernandes, DJ, Szulc-Lerch, KU et al. (2018) Mouse MRI shows brain areas relatively larger
184+
in males emerge before those larger in females. Nat Commun 9, 2615. [doi 10.1038/s41467-018-04921-2]
185+
.. [6] International Brain Laboratory et al. (2022) Reproducibility of in-vivo electrophysiological measurements in mice.
186+
bioRxiv. [doi 10.1101/2022.05.09.491042]
187+
.. [7] International Brain Laboratory et al. (2023) A Brain-Wide Map of Neural Activity during Complex Behaviour.
188+
bioRxiv. [doi 10.1101/2023.07.04.547681]
189+
.. [8] Findling C et al. (2023) Brain-wide representations of prior information in mouse decision-making.
190+
bioRxiv. [doi 10.1101/2023.07.04.547684]
191+
.. [9] Swanson LW (2018) Brain maps 4.0—Structure of the rat brain: An open access atlas with global nervous system nomenclature
192+
ontology and flatmaps. J Comp Neurol. [doi 10.1002/cne.24381]
193+
.. [10] Allen Mouse Common Coordinate Framework Technical White Paper (October 2017 v3)
194+
http://help.brain-map.org/download/attachments/8323525/Mouse_Common_Coordinate_Framework.pdf
195+
192196
"""
193197
from .atlas import * # noqa
194198
from .regions import regions_from_allen_csv

0 commit comments

Comments
 (0)