GithubHelp home page GithubHelp logo

tgd15 / region-specific-u-nets-rectal-cancer Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 104.64 MB

U-Nets to annotate post-chemoradiotherapy (CRT) imaging

License: BSD 3-Clause "New" or "Revised" License

Python 41.64% MATLAB 58.36%

region-specific-u-nets-rectal-cancer's Introduction

U-Nets for Post-Treatment Rectal Cancer Imaging

Overview

2 deep learning U-Nets were developed to segment the outer rectal wall and the lumen on post-treatment rectal cancer MRI. Segmentations can then be viewed in 3D Slicer. You can clone this repository and run these U-Nets in less than 5 minutes.

Table of Contents

Dependencies and Installation

Dependencies

The following dependencies are required to run the U-Nets:

- Python 3.7.7
- Tensorflow 1.15.0 or higher
- Keras 2.2.4 or higher
- SimpleITK 1.2.4 or higher
- opencv 3.4.2
- Pillow 7.1.2 or higher
- h5py 2.8.0 or higher
- matplotlib 3.2.2 or higher
- numpy 1.18.1 or higher

Note running the U-Nets on higher versions of each package has not been tested. If you are running higher versions of the packages listed above, please submit a pull request to indicate whether the code runs or breaks for each dependency.

Installation

To clone and run this application, you'll need Git installed on your computer. From your command line:

# Clone this repository (assuming you are using the HTML protocol)
git clone https://github.com/tgd15/Post-Treatment_Unet.git

# Go into the repository
cd Post-Treatment_Unet

If you have Conda installed, create a Conda environment from the environment.yml file in the repository root and activate it.

  • On Windows:
conda env create --file environment.yml
conda activate postcrt
  • On MacOS/Linux:
conda env create --file environment.yml
source activate postcrt

If you don't use Conda, ensure your environment has the required dependencies noted in the dependencies.

Running the Code

Once you have everything installed, run the code in the postcrt conda environment by executing run_Unet.py from your command line. run_Unet.py requires two arguments:

  1. --m, specify the U-Net you want to run as a string. Allowed choices are Outer_Rectal_Wall or Lumen.
  2. --i, specify the filepath to .mha file you want to annotate as a string.

Here are examples demostrating how to run the U-Nets:

Running Outer Rectal Wall U-Net:

python run_Unet.py --m "Outer_Rectal_Wall" --i "/GoogleDrive/Shared drives/INVent_Data/Rectal/newdata/UH/RectalCA145-2/RectalCA145-2_Post_Ax.mha"

Running Lumen U-Net:

python run_Unet.py --m "Lumen" --i "/GoogleDrive/Shared drives/INVent_Data/Rectal/newdata/UH/RectalCA145-2/RectalCA145-2_Post_Ax.mha"

Once the code finishes running, a .mha file with prediction_label appended to the end of the filename will be saved in the current directory. This .mha file contains the segmentations generated by the U-Net.

Visualizing the Results

The .mha file ending in prediction_label is designed to be view in 3D slicer. Simply drag the file from your file explorer/finder into 3D slicer and overlay it on the MRI.

In 3D slicer, segmentations generated by outer rectal wall U-Net will be label 8. Segmentations generated by lumen U-net will be label 2.

Troubleshooting

If you have questions, open an issue on the repository.

If you find a bug, please fix it and submit a pull request.


INVent Lab Logo

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.