A tool for segmenting dendrites and dendritic spines.
Project description
DeepD3
We provide DeepD3, a framework for the detection of dendritic spines and dendrites.
With DeepD3, you are able to
- train a deep neural network for dendritic spine and dendrite segmentation
- use pre-trained DeepD3 networks for inference
- build 2D and 3D ROIs
- export results to your favourite biomedical image analysis platform
- use command-line or graphical user interfaces
How to install and run DeepD3
DeepD3 is written in Python. First, please download and install any Python-containing distribution, such as Anaconda. We recommend Python 3.7 and more recent version.
Then, installing DeepD3 is as easy as follows:
pip install deepd3
Now, you have access to almost all the DeepD3 functionalities.
If you want to use the DeepD3 Neural Network inference mode, please install Tensorflow using either of the following commands:
# With CPU support only
conda install tensorflow
# With additional GPU support
conda install tensorflow-gpu
If you would like to access DeepD3-GUIs, use the following two shortcuts in your favourite shell:
# Opening the segmentation and ROI building GUI
deepd3-inference
# Opening the training utilities
deepd3-training
Model zoo
We provide a comprehensive training dataset on zenodo and the DeepD3 Website:
- DeepD3_8F.h5 - 8 base filters, original resolution
- DeepD3_16F.h5 - 16 base filters, original resolution
- DeepD3_32F.h5 - 32 base filters, original resolution
- DeepD3_8F_94nm.h5 - 8 base filters, resized to 94 nm xy resolution
- DeepD3_16F_94nm.h5 - 16 base filters, resized to 94 nm xy resolution
- DeepD3_32F_94nm.h5 - 32 base filters, resized to 94 nm xy resolution
Brief description:
- Full (32F) DeepD3 model trained on 94 nm (fixed) or a blend of resolutions (free)
- Medium (16F) DeepD3 model trained on 94 nm (fixed) or a blend of resolutions (free)
- Tiny (8F) DeepD3 mode trained on 94 nm (fixed) or a blend of resolutions (free)
Workflow
Train DeepD3 on your own dataset
Use deepd3-training
to start the GUI for generating training sets.
For each of your training set, please provide
- The original stack as e.g. TIF files
- The spine annotations (binary labels) as TIF or MASK files (the latter from pipra)
- The dendrite annotations as SWC file (only tested for SWC-files generated by NeuTube)
Create training data
Click on the button "Create training data". For each of your stacks, import the stack, the spine annotation and the dendrite annotation file. If you dendrite annotation is a SWC file, it will create a 3D reconstruction of the SWC file, which will be stored for later use. If you reload the SWC, it will ask you if you want to keep the 3D reconstruction.
After importing all files, enter the metadata (resolution in x, y and z) and determine the region of interest using the bounding box and the sliders.
Shortcuts are B
for current plane is z begin and E
for z end. You may enable or disable the cropping to the bounding box. If you are happy, save this region as d3data
-file.
View training data
Click on the button "View training data" to re-visit any d3data
files. You also are able to see and potentially manipulate the metadata associated the d3data
file.
Arrange training data
For training, you need to create a d3set
. This is an assembly of d3data
files. Click on the button "Arrange training data". Then, simply load all relevant data using the "Add data to set" button and select appropriate d3data
files. Clicking on "Create dataset" allows you to save your assembly as d3set
file.
Actual training
We have prepared a Jupyter notebook in the folder examples
. Follow the instructions to train your own deep neural network for DeepD3 use.
For professionals, you also may utilize directly the files in model
and training
to allow highly individualized training.
You only should ensure that your model allows arbitrary input and outputs two separate channels (dendrites and spines).
Inference
Open the inference mode using deepd3-inference
. Load your stack of choice (we currently support TIF stacks) and specify the XY and Z dimensions. Next, you can segment dendrites and dendritic spines using a DeepD3 model from the model zoo by clicking on Analyze -> Segment dendrite and spines
. Afterwards, you may clean the predictions by clicking on Analyze -> Cleaning
. Finally, you may build 2D or 3D ROIs using the respective functions in Analyze
. To test the 3D ROI building, double click in the stack to a region of interest. A window opens that allows you to play with the hyperparameters and segments 3D ROIs in real-time.
All results can be exported to various file formats. For convenience, DeepD3 saves related data in its "proprietary" hdf5 file (that you can open using any hdf5 viewer/program/library). In particular, you may export the predictions as TIF files, the ROIs to ImageJ file format or a folder, the ROI map to a TIF file, or the ROI centroids to a file.
Most functions can be assessed using a batch command script located in deepd3/inference/batch.py
.
How to cite
DeepD3 is available as preprint soon.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
File details
Details for the file deepd3-0.1-py3-none-any.whl
.
File metadata
- Download URL: deepd3-0.1-py3-none-any.whl
- Upload date:
- Size: 47.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.16
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e16d5c514c68f59512cdaa7e6257eab05186d58a989074f525c504b14a25b0b7 |
|
MD5 | 1351de4add247e84b1d9122172421bb4 |
|
BLAKE2b-256 | a8edfd2e4f872f6ae16d510256ddd72cab8ef35544e824c50a6e837eef65c855 |