Skip to main content

Transforms to map between different Drosophila template brains

Project description

navis-flybrains

Transforms to map between different Drosophila template brains. Intended to be used with navis.

This library is analogous to Greg Jefferis' nat.templatebrains, nat.jrcbrains and nat.flybrains for R.

flybrains ships with meta data and surface meshes for 17 template brains. Transforms need to be downloaded separately (see below).

Installation

You can install flybrains from PyPI:

pip3 install flybrains

External dependencies

In order to use the Jefferis lab transforms, you will need to have CMTK installed.

Bridging transforms

It's highly recommended that after install, you download the optional bridging transforms to map between template brains.

:exclamation: If you already have downloaded these registrations via nat.jrcbrains and/or nat.flybrains you can skip this: flybrains should be able to find the registrations downloaded via R and register them for you (see also code at the bottom).

>>> import flybrains

# This downloads (or updates) various CMTK bridging and mirror transforms
# generated or collated by the Jefferis lab - see docstring for details
>>> flybrains.download_jefferislab_transforms()

# This downloads h5 bridging transforms generated by the Saalfeld lab (Janelia)
# - see docstring for details
>>> flybrains.download_saalfeldlab_transforms()

# Register the transforms - this is only necessary if you just downloaded them
>>> flybrains.register_transforms()

In the future, simply importing flybrains is sufficient to make the transforms available to navis:

>>> import navis
>>> import flybrains
>>> import numpy as np
>>> points = np.array([[0, 0, 0]])
>>> navis.xform_brain(points, source='FAFB', target='JRC2018F')

On import of flybrains, these data sources are injected into and can be readily used to e.g. transform 3d coordinates between brain spaces.

To check which transforms are available (either downloaded or via R) you can run this:

>>> # Generate a report - note the mix reg downloaded via Python and R
>>> flybrains.report()
Flybrains Status Report
=======================
Data Home: /Users/philipps/flybrain-data

Jefferis lab registrations: 41 of 41
Saalfeld lab registrations: 0 of 6

nat regdirs
-----------
/Users/philipps/Library/Application Support/rpkg-nat.templatebrains/regfolders: 41 CMTK | 0 H5 transforms
/Library/Frameworks/R.framework/Versions/3.6/Resources/library/nat.flybrains/extdata/bridgingregistrations: 5 CMTK | 0 H5 transforms
/Library/Frameworks/R.framework/Versions/3.6/Resources/library/nat.flybrains/extdata/mirroringregistrations: 5 CMTK | 0 H5 transforms
/Users/philipps/Library/Application Support/R/nat.jrcbrains: 0 CMTK | 5 H5 transforms

Documentation

Please see the transform tutorial for navis to learn how to use the data flybrains provides.

Changes

  • 0.1.1 (06/01/21): added um (for microns) suffix to JRCFIB2018F transforms; added affine JRCFIB2018Fraw -> JRCFIB2018F -> JRCFIB2018Fum transforms
  • 0.1.0 (03/01/21): first working version

Acknowledgements

Critically based on nat.flybrains and nat.jrcbrains by Greg Jefferis et al. for inspiration for the implementation and meta data on e.g. template brains.

As reference for the Jefferis lab registrations, please use:

The natverse, a versatile toolbox for combining and analysing neuroanatomical data.
A.S. Bates, J.D. Manton, S.R. Jagannathan, M. Costa, P. Schlegel, T. Rohlfing, G.S. Jefferis
eLife. 9 (2020) e53350. doi:10.7554/eLife.53350.

As (partial) reference for the Saalfeld lab registrations, please see:

An unbiased template of the Drosophila brain and ventral nerve cord.
John A Bogovic, Hideo Otsuna, Larissa Heinrich, Masayoshi Ito, Jennifer Jeter, Geoffrey Meissner, Aljoscha Nern, Jennifer Colonell, Oz Malkesman, Kei Ito, Stephan Saalfeld
bioRxiv 376384; doi: https://doi.org/10.1101/376384

For references of individual template brains, please see their docstrings:

>>> help(flybrains.IBN)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

flybrains-0.1.2.tar.gz (31.1 kB view details)

Uploaded Source

Built Distribution

flybrains-0.1.2-py3-none-any.whl (44.6 kB view details)

Uploaded Python 3

File details

Details for the file flybrains-0.1.2.tar.gz.

File metadata

  • Download URL: flybrains-0.1.2.tar.gz
  • Upload date:
  • Size: 31.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.6.1 requests/2.25.1 setuptools/51.1.0 requests-toolbelt/0.9.1 tqdm/4.55.2 CPython/3.8.7

File hashes

Hashes for flybrains-0.1.2.tar.gz
Algorithm Hash digest
SHA256 97bd3a438180e8a99c7900872fdf2d83bc7ecfbe753d0a6f58ab31531bbd6b4a
MD5 ba1a6af33203975467db70ea8505ae00
BLAKE2b-256 3c67ae0b6035fc3e22fce243e0b102eef993bf67e7cdf9edf90f8684fbc750b2

See more details on using hashes here.

File details

Details for the file flybrains-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: flybrains-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 44.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.6.1 requests/2.25.1 setuptools/51.1.0 requests-toolbelt/0.9.1 tqdm/4.55.2 CPython/3.8.7

File hashes

Hashes for flybrains-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 3415de54dc3d416828cfbadeac199748f29dc5d1ddb245cfc5f0cc3a53c20611
MD5 bd987c2016f46d98151e1eae6fd64d34
BLAKE2b-256 f93cd4b9af2574fb7b2fb1736fce71305ae513a6831d48f7d6125d31d84053a8

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page