Skip to content

Commit bd9902d

Browse files
committed
Merge branch 'master' of github.com:jvwilliams23/airway-UNetCNN
2 parents e20e600 + a7996b7 commit bd9902d

File tree

1 file changed

+27
-4
lines changed

1 file changed

+27
-4
lines changed

README.md

Lines changed: 27 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Airway and lung segmentations using convolutional neural networks
1+
# Convolutional neural network toolkit for segmenting airways and lungs
22

33
## Overview
44
This project aimed to train a machine learning algorithm capable of producing airway and lung segmentations from chest CT scans.
@@ -14,7 +14,7 @@ First, install the required dependencies (best practice is to use a virtual envi
1414
```bash
1515
conda create --name pycnn python=3.10
1616
conda activate pycnn
17-
pip install hjson numpy pandas torch torchio SimpleITK sklearn vedo
17+
pip install hjson numpy pandas torch torchio SimpleITK sklearn vedo lungmask
1818
```
1919

2020
### Retraining
@@ -25,10 +25,19 @@ To retrain a CNN on some data you have available, add the paths to the images an
2525
```
2626
These will then be split into train and validation sets (which are saved as `train_cases.txt` and `val_cases.txt`). Also you can edit any hyperparameters defined in `trainconfig.json` and run
2727
```bash
28-
python3 train.py
28+
python train.py
2929
```
3030

31-
### Segmenting
31+
### Using a CNN to segment an image
32+
To lower the memory consumption and inference time for segmenting the airways, we can first segment the lobes and use this as a bounding box for cropping the image
33+
```bash
34+
python segment_lunglobes.py -i /path/to/ct/scan.mhd -id example
35+
```
36+
The airways can then be segmented by
37+
```bash
38+
python segment.py -i /path/to/ct/scan.mhd -o example.stl
39+
```
40+
which will create three files in the current directory (`example.mhd`, `example.zraw` and `example.stl`).
3241

3342
## Get Help
3443
Please submit an issue to the issues panel on this repository.
@@ -39,5 +48,19 @@ If you use the code or models in this repository, please cite our paper
3948
@article{TODO}
4049
```
4150

51+
Also, if you use the `segment_lunglobes.py` script, make sure to read and cite the following great paper:
52+
```
53+
@article{hofmanninger2020automatic,
54+
title={Automatic lung segmentation in routine imaging is primarily a data diversity problem, not a methodology problem},
55+
author={Hofmanninger, Johannes and Prayer, Forian and Pan, Jeanny and R{\"o}hrich, Sebastian and Prosch, Helmut and Langs, Georg},
56+
journal={European Radiology Experimental},
57+
volume={4},
58+
number={1},
59+
pages={1--13},
60+
year={2020},
61+
publisher={SpringerOpen}
62+
}
63+
```
64+
4265
## Acknowledgements
4366
The model architecture scripts [`unet.py`](https://github.com/Thvnvtos/Lung_Segmentation/blob/unet3d/model.py) and [`enet.py`](https://github.com/davidtvs/PyTorch-ENet/blob/master/models/enet.py) were taken from other repositories (see links).

0 commit comments

Comments
 (0)