PHILOW is an interactive deep learning-based platform for 3D datasets
Project description
napari-PHILOW
PHILOW
Python-based platform for human-in-the-loop (HITL) workflow (PHILOW)
PHILOW is an interactive deep learning-based platform for 3D datasets implemented on top of napari
This napari plugin was generated with Cookiecutter using @napari's cookiecutter-napari-plugin template.
Installation
Install napari and Pytorch first.
See napari and Pytorch for more information.
You can install napari-PHILOW
via pip:
pip install napari-PHILOW
or clone this repository
then
cd PHILOW
pip install -e .
Usage
Launch napari
napari
load dataset
-
Plugins > napari-PHILOW > Annotation Mode
-
Select original dir : all slices must be in separate 8bit PNG and must be sequentially numbered (e.g. 000.png, 001.png ...)
-
Select mask dir : To resume from the middle of the annotation, specify here the name of the directory containing the mask image. The directory must contain the same number of files with the same name as the original image.
If you are starting a completely new annotation, you do not need to specify a directory. The directory for mask is automatically created and blank images are generated and stored. -
Enter a name for the label or model you want to create (e.g. mito, cristae, ...)
This name will be used as the directory name of the newly created mask dir if no mask dir is specified, and as the name of the csv file for training dataset management. -
Check if you want to create new dataset (new model) When checked, if there is already a csv file for training dataset management, a new csv file with one sequential number will be generated.
-
Start tracing
create labels
Create a label with the brush function. more information → https://napari.org/tutorials/fundamentals/labels.html
Orthogonal view
If you want to see orthogonal view, click on the location you want to see while holding down the Shift button.
The image from xy, yz, and zx will be displayed on the right side of the screen.
Low confident layer
If you are in the second iteration and you are loading the prediction results, you will see a low confidence layer.
This shows the area where the confidence of the prediction result is low.
Use this as a reference for correction.
Small object layer
We provide a small object layer to find small painted areas.
This is a layer for displaying small objects.
The slider widget on the left allows you to change the maximum object size to be displayed.
save labels
If you want to save your label, click the "save" button on the bottom right.
select training dataset
We are providing a way to manage the dataset for use in training.
If you want to use the currently displayed slice as your training data, click the 'Not Checked' button near the center left to display 'Checked'.
Train and pred with your gpu machine
Train
To train on your GPU machine (or with CPU),
-
Plugins > napari-PHILOW > Trainer
-
Select original dir : all slices must be in separate 8bit PNG and must be sequentially numbered (e.g. 000.png, 001.png ...)
-
Select labels dir : all label images should be named same as original images and contains data management csv file
-
Select dir for save trained model
-
Click on the "start training" button
-
Dice score and dice loss are displayed. For more detail, check the command line for the progress of training. If you want to stop in the middle, click stop button.
IF YOU WANT TO SEGMENT CRISTAE AREA IN THE EM DATASET
-
Plugins > napari-PHILOW > Trainer
-
Click on the "Cristae segmentation mode" button
-
Select original dir : all slices must be in separate PNG and must be sequentially numbered (e.g. 000.png, 001.png ...)
-
Select mito mask dir : all label images should be named same as original images
-
Select dir for save trained model
-
Select cristae labels dir : all label images should be named same as original images and contains data management csv file
-
Click on the "start training" button
-
Dice score and dice loss are displayed. For more detail, check the command line for the progress of training. If you want to stop in the middle, click stop button.
Predict
To predict labels on your machine,
-
Plugins > napari-PHILOW > Predicter
-
Select original dir : all slices must be in separate 8bit PNG and must be sequentially numbered (e.g. 000.png, 001.png ...)
-
(Optional) Select labels dir if you want to keep labels witch were used on training, and data management csv file
-
Select model dir contains hdf5 file
-
Select output dir for predicted labels
-
Uncheck the box if you DO NOT want to use TAP (Three-Axis-Prediction)
-
Click on the "predict" button
-
Check the command line for the progress of prediction. If you want to stop in the middle, use ctrl+C.
-
You can start the next round of annotation by selecting the merged_prediction directory as the mask dir in Annotation mode.
IF YOU WANT TO SEGMENT CRISTAE AREA IN THE EM DATASET
-
Plugins > napari-PHILOW > Predicter
-
Select original dir : all slices must be in separate PNG and must be sequentially numbered (e.g. 000.png, 001.png ...)
-
(Optional) Select cristae labels dir if you want to keep labels witch were used on training, and data management csv file
-
Select model dir contains hdf5 file
-
Select output dir for predicted labels
-
Uncheck the box if you DO NOT want to use TAP (Three-Axis-Prediction)
-
Click on the "Use cristae inference mode" button
-
Select mitochondria mask dir : all label images should be named same as original images
-
Click on the "predict" button
-
Check the command line for the progress of prediction. If you want to stop in the middle, use ctrl+C.
-
You can start the next round of annotation by selecting the merged_prediction directory as the mask dir in Annotation mode.
Train and predict with Google Colab
If you don't have a GPU machine, you can use Google Colab to perform GPU-based training and prediction for free.
-
Open train and predict notebook and click "Open in Colab" button
-
You can upload your own dataset to train and predict, or try it on demo data
Contributing
Contributions are very welcome. Tests can be run with tox, please ensure the coverage at least stays the same before you submit a pull request.
License
Distributed under the terms of the GNU GPL v3.0 license, "napari-PHILOW" is free and open source software
Issues
If you encounter any problems, please [file an issue] along with a detailed description.
Authors
Shogo Suga
Hiroki Kawai
Yusuke Hirabayashi
How to Cite
Shogo Suga, Koki Nakamura, Yu Nakanishi, Bruno M Humbel, Hiroki Kawai, Yusuke Hirabayashi, An interactive deep learning-based approach reveals mitochondrial cristae topologies. PLoS Biol 21(8): e3002246. https://doi.org/10.1371/journal.pbio.3002246
@article {Suga_Nakamura_Nakanishi_Humbel_Kawai_Hirabayashi_2023,
title={An interactive deep learning-based approach reveals mitochondrial cristae topologies},
volume={21},
ISSN={1545-7885},
DOI={10.1371/journal.pbio.3002246},
number={8},
journal={PLOS Biology},
publisher={Public Library of Science},
author={Suga, Shogo and Nakamura, Koki and Nakanishi, Yu and Humbel, Bruno M. and Kawai, Hiroki and Hirabayashi, Yusuke},
year={2023},
month={Aug},
pages={e3002246},
language={en}
}
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
Built Distribution
File details
Details for the file napari_philow-0.2.0.tar.gz
.
File metadata
- Download URL: napari_philow-0.2.0.tar.gz
- Upload date:
- Size: 40.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.0 CPython/3.10.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 73c9870e2fa7cb85ad3d2c8f658033ec57f149a4057e8fa67764d1bebac9b74c |
|
MD5 | 16c658b02e033f49d93353f162cf48cc |
|
BLAKE2b-256 | b4c8cd66ca7c5d428225324dd01fa2656e254542bf2f6e950d9aa4f62470ce17 |
File details
Details for the file napari_PHILOW-0.2.0-py3-none-any.whl
.
File metadata
- Download URL: napari_PHILOW-0.2.0-py3-none-any.whl
- Upload date:
- Size: 46.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.0 CPython/3.10.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e0387ad9863907ab34e37179f84fa28d42514708abe6278b9a992c89a66cb5ca |
|
MD5 | 7cc4d255224a9a37662266f53bd24b45 |
|
BLAKE2b-256 | a861adf0533071223f04c8aea0d97db611d92935203d34e7a5c0e01dc56a7cde |