Skip to content

Commit ec1ff3e

Browse files
Merge branch 'main' into 68-create-a-widget-for-vesicle-pool-assignments
2 parents 90aa283 + afeb8e7 commit ec1ff3e

File tree

78 files changed

+4071
-427
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

78 files changed

+4071
-427
lines changed

.github/workflows/run_tests.yaml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: test
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
tags:
8+
- "v*" # Push events to matching v*, i.e. v1.0, v20.15.10
9+
pull_request: # run CI on commits to any open PR
10+
workflow_dispatch: # can manually trigger CI from GitHub actions tab
11+
12+
13+
jobs:
14+
test:
15+
name: ${{ matrix.os }} ${{ matrix.python-version }}
16+
runs-on: ${{ matrix.os }}
17+
timeout-minutes: 60
18+
strategy:
19+
fail-fast: false
20+
matrix:
21+
os: [ubuntu-latest]
22+
python-version: ["3.11"]
23+
steps:
24+
- name: Checkout
25+
uses: actions/checkout@v4
26+
27+
- name: Setup micromamba
28+
uses: mamba-org/setup-micromamba@v1
29+
with:
30+
environment-file: environment_cpu.yaml
31+
create-args: >-
32+
python=${{ matrix.python-version }}
33+
34+
- name: Install SynapseNet
35+
shell: bash -l {0}
36+
run: pip install --no-deps -e .
37+
38+
- name: Run tests
39+
shell: bash -l {0}
40+
run: python -m unittest discover -s test -v

README.md

Lines changed: 7 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,10 @@
1-
# Synaptic Reconstruction
1+
# SynapseNet: Deep Learning for Automatic Synapse Reconstruction
22

3-
Reconstruction of synaptic structures in electron microscopy.
3+
SynapseNet is a tool for segmentation and analysis of synapses in electron microscopy.
44

5-
THIS IS WORK IN PROGRESS!
5+
To learn how to use SynapseNet, check out [the documentation](https://computational-cell-analytics.github.io/synapse-net/).
6+
To learn more about how it works, check out [our preprint](TODO).
67

7-
## Installation
8-
9-
- Make sure conda or mamba is installed.
10-
- If you don't have a conda installation yet we recommend [micromamba](https://mamba.readthedocs.io/en/latest/installation/micromamba-installation.html)
11-
- Create the environment with all required dependencies: `mamba env create -f environment.yaml`
12-
- Activate the environment: `mamba activate synaptic-reconstruction`
13-
- Install the package: `pip install -e .`
14-
15-
## Tools
16-
17-
### Segmentation Correction
18-
19-
https://napari.org/stable/howtos/layers/labels.html
20-
21-
### Distance Measurements
8+
See an example reconstruction of a mossy fibre synapse with SynapseNet.
9+
Automatic segmentation of synaptic vesicles are rendered in orange, active zones in blue and two mitochondria in red and cyan.
10+
![Reconstruction of a mossy fiber synapse](doc/images/synapse-reconstruction.png)

doc/images/synapse-reconstruction.png

902 KB
Loading

doc/start_page.md

Lines changed: 87 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,87 @@
1-
# Synaptic Reconstruction
2-
lorem ipsum...
1+
# SynapseNet: Deep Learning for Automatic Synapse Reconstruction
2+
3+
SynapseNet is a tool for automatic segmentation and analysis of synapses in electron micrographs.
4+
It provides deep neural networks for:
5+
- Synaptic vesicle segmentation in ssTEM (2d data) and (cryo-)electron tomography (3d data)
6+
- Active zone membrane segmentation in electron tomography
7+
- Mitochondrion segmentation in electron tomography
8+
- Synaptic compartment segmentation in electron tomography
9+
- Synaptic ribbon and pre-synaptic density segmentation for ribbon synapses in electron tomography
10+
It also offers functionality for quantifying synaptic ultrastructure based on segmentation results, for example by measuring vesicle or structure morphology, measuring distances between vesicles and structures, or assigning vesicles into different pools.
11+
SynapseNet mainly targets electron tomography, but can also be appled to other types of electron microscopy,
12+
especially throught the [domain adaptation](domain-adaptation) functionality.
13+
14+
SynapseNet offers a [napari plugin](napari-plugin), [command line interface](command-line-interface), and [python library](python-library).
15+
Please cite our [bioRxiv preprint](TODO) if you use it in your research.
16+
17+
18+
## Requirements & Installation
19+
20+
SynapseNet was developed and tested on Linux. It should be possible to install and use it on Mac or Windows, but we have not tested this.
21+
Furthermore, SynapseNet requires a GPU for segmentation of 3D volumes.
22+
23+
You need a [conda](https://docs.conda.io/projects/conda/en/latest/user-guide/install/index.html) or [mamba](https://mamba.readthedocs.io/en/latest/installation/mamba-installation.html) installation. Follow the instruction at the respective links if you have installed neither. We assume you have `conda` for the rest of the instructions. After installing it, you can use the `conda` command.
24+
25+
To install it you should follow these steps:
26+
- First, download the SynapseNet repository via
27+
```bash
28+
git clone https://github.com/computational-cell-analytics/synapse-net
29+
```
30+
- Then, enter the `synapse-net` folder:
31+
```bash
32+
cd synapse-net
33+
```
34+
- Now you can install the environment for SynapseNet with `conda` from the environment file we proved:
35+
```bash
36+
conda env create -f environment.yaml
37+
```
38+
- You will need to confirm this step. It will take a while. Afterwards you can activate the environment:
39+
```bash
40+
conda activate synapse-net
41+
```
42+
- Finally, install SynapseNet itself into the environment:
43+
```bash
44+
pip install -e .
45+
```
46+
47+
Now you can use all SynapseNet features. From now on, just activate the environment via
48+
```
49+
conda activate synapse-net
50+
```
51+
to use them.
52+
53+
> Note: If you use `mamba` instead of conda just replace `conda` in the commands above with `mamba`.
54+
55+
> Note: We also provide an environment for a CPU version of SynapseNet. You can install it by replacing `environment.yaml` with `environment_cpu.yaml` in the respective command above. This version can be used for 2D vesicle segmentation, but it does not work for 3D segmentation.
56+
57+
> Note: If you have issues with the CUDA version then install a PyTorch that matches your nvidia drivers. See [pytorch.org](https://pytorch.org/) for details.
58+
59+
60+
## Napari Plugin
61+
62+
**The rest of the documentation will be updated in the next days!**
63+
64+
65+
## Command Line Functionality
66+
67+
- segmentation cli
68+
- export to imod
69+
- vesicles / spheres
70+
- objects
71+
72+
73+
## Python Library
74+
75+
- segmentation functions
76+
- distance and morphology measurements
77+
- imod
78+
79+
### Domain Adaptation
80+
81+
- explain domain adaptation
82+
- link to the example script
83+
84+
### Network Training
85+
86+
- explain / diff to domain adaptation
87+
- link to the example script

environment.yaml

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,22 @@
11
channels:
2+
- pytorch
3+
- nvidia
24
- conda-forge
35
name:
4-
synaptic-reconstruction
6+
synapse-net
57
dependencies:
6-
- python-elf
8+
- bioimageio.core
9+
- kornia
10+
- magicgui
711
- napari
812
- pip
913
- pyqt
10-
- magicgui
14+
- python-elf
1115
- pytorch
12-
- bioimageio.core
13-
- kornia
16+
- pytorch-cuda=12.4
1417
- tensorboard
18+
- torch_em
19+
- torchvision
1520
- trimesh
1621
- pip:
1722
- napari-skimage-regionprops

environment_cpu.yaml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
channels:
2+
- conda-forge
3+
name:
4+
synapse-net
5+
dependencies:
6+
- bioimageio.core
7+
- kornia
8+
- magicgui
9+
- napari
10+
- pip
11+
- pyqt
12+
- python-elf
13+
- pytorch
14+
- tensorboard
15+
- torch_em
16+
- trimesh
17+
- pip:
18+
- napari-skimage-regionprops

plot_distances.sh

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)