GithubHelp home page GithubHelp logo

raidionics / aeropath Goto Github PK

View Code? Open in Web Editor NEW
23.0 2.0 5.0 321 KB

🫁 AeroPath: An airway segmentation benchmark dataset with challenging pathology

Home Page: https://huggingface.co/spaces/andreped/AeroPath

License: MIT License

Dockerfile 0.63% Shell 0.17% Jupyter Notebook 99.20%
ai airway ct deep-learning image-processing medical-imaging segmentation volumetric-data voxel bronchi

aeropath's Introduction

title colorFrom colorTo sdk app_port emoji pinned license app_file
AeroPath: automatic airway segmentation using deep learning
indigo
indigo
docker
7860
🫁
false
mit
demo/app.py

🫁 AeroPath πŸ€—

An airway segmentation benchmark dataset with challenging pathology

license CI/CD Open In Colab DOI paper

AeroPath was developed by SINTEF Medical Image Analysis to accelerate medical AI research.

This repository contains the AeroPath dataset described in "AeroPath: An airway segmentation benchmark dataset with challenging pathology". A web application was also developed in the study, to enable users to easily test our deep learning model on their own data. The application was developed using Gradio for the frontend and the segmentation is performed using the Raidionics backend.

The dataset is made openly available at Zenodo and the Hugging Face Hub. Click any of the two hyperlinks to access the dataset.

The dataset contains 27 CTs with corresponding airways and lung annotations. The folder structure is described below.

The easiest way to access the data is in Python with Hugging Face's datasets package:

from datasets import load_dataset

# downloads data from Zenodo through the Hugging Face hub
# - might take several minutes (~5 minutes in CoLab)
dataset = load_dataset("andreped/AeroPath")
print(dataset)

# list paths of all available patients and corresponding features (ct/airways/lungs)
for d in dataset["test"]:
  print(d)

A detailed interactive demo on how to load and work with the data can be seen on CoLab. Click the CoLab badge Open In Colab to see the notebook or alternatively click here to see it on GitHub.

└── AeroPath.zip
    β”œβ”€β”€ README.md
    └──  AeroPath/
        β”œβ”€β”€ 1/
        β”‚   β”œβ”€β”€ 1_CT_HR.nii.gz
        β”‚   β”œβ”€β”€ 1_CT_HR_label_airways.nii.gz
        β”‚   └── 1_CT_HR_label_lungs.nii.gz
        β”œβ”€β”€ [...]
        └── 27/
            β”œβ”€β”€ 27_CT_HR.nii.gz
            β”œβ”€β”€ 27_CT_HR_label_airways.nii.gz
            └── 27_CT_HR_label_lungs.nii.gz

To access the live demo, click on the Hugging Face badge above. Below is a snapshot of the current state of the demo app.

Screenshot 2023-10-31 at 01 34 47
Build Type Status
HF Deploy Deploy
File size check Filesize
Formatting check Filesize

Alternatively, you can deploy the software locally. Note that this is only relevant for development purposes. Simply dockerize the app and run it:

docker build -t AeroPath .
docker run -it -p 7860:7860 AeroPath

Then open http://127.0.0.1:7860 in your favourite internet browser to view the demo.

It is also possible to run the app locally without Docker. Just setup a virtual environment and run the app. Note that the current working directory would need to be adjusted based on where AeroPath is located on disk.

git clone https://github.com/raidionics/AeroPath.git
cd AeroPath/

virtualenv -python3 venv --clear
source venv/bin/activate
pip install -r ./demo/requirements.txt

python demo/app.py --cwd ./

If you found the dataset and/or web application relevant in your research, please cite the following reference:

@misc{stΓΈverud2023aeropath,
  title={{AeroPath: An airway segmentation benchmark dataset with challenging pathology}}, 
  author={Karen-Helene StΓΈverud and David Bouget and Andre Pedersen and HΓ₯kon Olav Leira and Thomas LangΓΈ and Erlend Fagertun Hofstad},
  year={2023},
  eprint={2311.01138},
  archivePrefix={arXiv},
  primaryClass={cs.CV}
}

The dataset is hosted at Zenodo, so you should also cite the following:

@dataset{hofstad2023aeropathzenodo,
  title        = {{AeroPath: An airway segmentation benchmark dataset with challenging pathology}},
  author       = {Hofstad, Erlend and Bouget, David and Pedersen, AndrΓ©},
  month        = nov,
  year         = 2023,
  publisher    = {Zenodo},
  doi          = {10.5281/zenodo.10069289},
  url          = {https://doi.org/10.5281/zenodo.10069289}
}

The web application is using the Raidionics backend, thus, also consider citing:

@article{bouget2023raidionics,
    title = {Raidionics: an open software for pre-and postoperative central nervous system tumor segmentation and standardized reporting},
    author = {Bouget, David and Alsinan, Demah and Gaitan, Valeria and Holden Helland, Ragnhild and Pedersen, AndrΓ© and Solheim, Ole and Reinertsen, Ingerid},
    year = {2023},
    month = {09},
    pages = {},
    volume = {13},
    journal = {Scientific Reports},
    doi = {10.1038/s41598-023-42048-7},
}

The code in this repository is released under MIT license.

aeropath's People

Contributors

andreped avatar dbouget avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

aeropath's Issues

Change color of Model3D widget to match 2D viewer

Is your feature request related to a problem? Please describe.
Currently, the rendered object in 3D is a plane gray color.

Describe the solution you'd like
It would be better if the color matched the 2D viewer.

Additional context

Screenshot 2023-10-31 at 15 17 22

ImportError in AeroPath HF Space deployment

Describe the bug
I observed the same bug on neukit and I was surprised that I did not see the same. So I tried doing a factory reset on the HF space and it became clear that something has broken.

Error logs
The error message prompted can be observed when the app is launched:

ImportError: cannot import name 'Doc' from 'typing_extensions'

Desktop (please complete the following information):

  • OS: [e.g. Windows] Docker
  • Python: [e.g. 3.8.10] 3.8

Additional context
This might be a Dockerfile issue, but I am not sure.

Bug: Seems like the Python API for reading data from Hugging Face data hub is not working after the update

Describe the bug
Data reading through Python API fails. This worked fine before the last PR. Seems like the decoding of the files after download is wrong, or not converted to the correct filenames.

I made a separate Discussion about it on the HF datasets page:
https://huggingface.co/datasets/andreped/AeroPath/discussions/6

To Reproduce
I made a gist that reproduces the issue at:
https://colab.research.google.com/gist/andreped/aee5f6ff14db83b23969a04e38ffac84/aeropath-load-dataset-example.ipynb

Desktop (please complete the following information):

  • OS: [e.g. Windows] Ubuntu (on Google CoLaboratory)
  • Version: [e.g. 10] 22.04
  • Python: [e.g. 3.8.10] Python 3.10

Logs are shared among users over different runs

Describe the bug
When launching the app, a log file is created which is used to update the logging widget, giving the user valuable feedback on processing progress. However, it has been observed that after accessing the app, the log from previous runs (or other runs) can be seen. This is not ideal.

Expected behavior
The log widget should be clear when first accessing the deployed app. It should be clear for every single user and each time the user accesses the app (also for website resets).

We might need a mechanism to catch a new run or website refresh and force the log file to be reset.

Screenshots

The old log can be seen when first accessing the website:

Screenshot 2023-10-31 at 15 54 16

Random RuntimeError in Space

Describe the bug
After a while, it seems like the app runs into a RuntimeError. This seems quite random. This can also be resolved easily by just restarting the space, but this should not be necessary!

Space can be accessed here:
https://huggingface.co/spaces/andreped/AeroPath

Expected behavior
The space should never run into any RuntimeErrors or errors in general of the sort.

Rendering is extremely slow

Is your feature request related to a problem? Please describe.
The current solution for 2D and 3D rendering, and how the rendering widgets overall are setup was made to be compatible with an older version of gradio in mind. The old version has severe limitations, which can be observed when changing the 2D slider, which takes several seconds to update, as the 3D renderer needs to be updated every single time. This should not be necessary.

The 2D and 3D renderers should ideally be kept as separate processes, handled in separate threads, if possible. There is also no need to update the 3D renderer if the 2D renderer is updated. In the old gradio version this was not possible to change, but maybe it is now.

Describe the solution you'd like
Changing 2D images should not affect the 3D renderer, and should be close to seemless.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.