Giter Club home page Giter Club logo

tensorflow_medical_images_segmentation's Introduction

Medical image segmentation in Tensorflow

Here I post a code for doing segmentation in medical images using tensorflow. First you would need to have the python packages h5py, SimpleITK and of course TensorFlow.

To use it, first I assume that you have niftii files (.nii.gz). Also, I assume that all the training images are in a folder that contains the training subjects as folders in it. Each training subject then will be a folder, and the name of this folder should be the name of the CT image. The groundtruth should be in the same folder and it should be called GT.nii.gz. It should be an image with values for each voxel rangon from 0 to num_classes-1.

Data
|
|--sub1/
    |--sub1.nii.gz
    |--GT.nii.gz
|--sub2/
    |--sub2.nii.gz
    |--GT.nii.gz
|
|...

The name can be different as long as the CT file and folder are the same.

The first thing that you'd want to do is to convert the CT and it's groundtruth data to h5 format. This is done by the generate_2d_h5.py script. To run it, you should type:

python generate_2d_h5.py --src /path/to/patients --dst /path/to/save/h5/files

Now this will generate a folder that includes several h5 files that contain the training data (input ct slices and it's corresponding labels).

After that you should be able to run:

python main.py --dir_patients /path/to/CT_data --path_patients_h5 /path/to/h5files

The code has everal options for training and testing that you'll see when you run python main.py

tensorflow_medical_images_segmentation's People

Contributors

rogertrullo avatar

Stargazers

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

Watchers

 avatar

tensorflow_medical_images_segmentation's Issues

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.