Atlas creation
This python code contains utility methods related to:
atlas stuff
This program will create an atlas from the original anatomist’s annotations and create a new Atlas named AtlasV8. The tasks are run in sequence. Data is saved to disk on birdstore, so you only need to rerun the tasks if you change the data.
python src/atlas/scripts/create_atlas.py –task json –debug false
python src/atlas/scripts/create_atlas.py –task create –debug false
python src/atlas/scripts/create_atlas.py –task merge –debug false
python src/atlas/scripts/create_atlas.py –task neuroglancer –debug false –affine true
Explanation for the tasks:
json - This parses the original anatomist’s annotations and creates JSON data. This makes it easier for the later steps.
create - This take the JSON data and creates the origins and volumes of each of the 3 foundation brains. The origin is the upper left corner of the volume box. Origins at 0,0,0 start on the very first section in the upper left corner.
merge - This takes each of the 3 foundation brains ands merges them into one volume. It initially uses elastix to align the volumes with a affine transformation. The mean of these aligned images is then used to create the volume. The volume will contain only zeros or the Allen color. This process will also take any polygons stored in the database, e.g., the TG_L and TG_R, and merge them into a volume.
neuroglancer - This takes the merged volume and moves the origins into Allen space. A neuroglancer view is then created from all these merged volumes.
- class atlas.scripts.create_atlas.AtlasManager(animal, task, um=10, affine=False, debug=False)
Bases:
object
- create_brain_json()
# 1st step, this parses the original CSV files and creates the JSON files All data is downsampled by 1/32=SCALING_FACTOR. This is also the same size as the downsampled images.
- create_brain_volumes_and_origins()
# 2nd step, this takes the JSON files and creates the brain volumes and origins
- merge_all()
# 3rd step, this merges the volumes and origins from the foundation brains into the new atlas # The fixed brain is, well, fixed. # All foundation polygon brain data is under: Edward ID=1 # All foundation COM brain data is under: Beth ID=2”
- test_brain_volumes_and_origins()
# optional step, this draws the brains from the cleaned images so you can check the placement of the volumes # The output is in /net/birdstore/Active_Atlas_Data/data_root/pipeline_data/MDXXX/preps/C1/drawn