clbarnes / syn_area_label

Python package for extracting bigCAT data from CATMAID for synaptic cleft measurements
MIT License
0 stars 0 forks source link

syn_area_label

For the latest version, see here: https://github.com/clbarnes/syn_area_label

Preparing data for labelling synaptic areas using CATMAID annotations

Originally created using cookiecutter and clbarnes/python-template-sci.

Usage

First, ensure you're working in a virtual environment:

# create a virtual environment if you don't have one
python -m venv --prompt syn_area_label venv

# activate it
source venv/bin/activate

Then install this package:

pip install git+https://github.com/clbarnes/syn_area_label.git

If this is a dependency in another project, choose the revision (tag, commit, or branch) and use the line syn_area_label @ git+https://github.com/clbarnes/syn_area_label.git@REVISION_GOES_HERE in your requirements file or project metadata.

The workflow is this:

  1. Identify the synaptic edges (presynapse -> connector -> postsynapse) you are interested in
  2. Build an syn_area_label.EdgeTables object from them, querying CATMAID
  3. Open your image volume as an xarray.DataArray (pymaid has a utility for opening certain CATMAID stacks this way)
  4. Pass these to syn_area_label.cache_rois

This will generate one CREMI-format HDF5 file per connector (which may contain several edges), and some extra tables. This should be annotated according to painting_instructions.md.

Then,

  1. Use syn_area_label.AreaInfo.from_cremi to load the CREMI file, then the resulting object's calculate method to return a table of areas.

See the example scripts in ./scripts for creating CREMI files populated with raw data from CATMAID, and extracting synaptic areas from annotations in those files.