Giter Site home page Giter Site logo

lung-segmentation-3d's Introduction

Lung Segmentation (3D)

Repository features UNet inspired architecture used for segmenting lungs on chest 3D tomography images.

Demo

Run inference.py to see the application of the model on Demo files.

Implementation

Implemented in Keras(2.0.4) with TensorFlow(1.1.0) as backend.

To use this implementation one needs to load and preprocess data (see load_data.py), train new model if needed (train_model.py) and use the model for generating lung masks (inference.py).

trained_model.hdf5 and trained_model_wc.hdf5 contain models trained on private data set without and with coordinates channels.

Segmentation

lung-segmentation-3d's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

lung-segmentation-3d's Issues

load model problem when run inference.py

Hello,
I also cannot run inference.py directly without changing a thing.
And then I trained a new model , but it also cannot load successfully.
loadproblem
I run this on keras 2.0.8, tensorflow 1.0.0.
Can you help me with this problem? Thanks a lot.

do you have some suggestions in this situation of difference size data?

hello. eclique. thank you for your sharing of the codes. I have a question. If the size of my input data is not your data size of 12812864, I have to crop or reshape my data into this size for training. But I feel this method might miss some important detailed information. So, do you have some suggestions in this situation of difference size data?

append coordinates?

hi. eclique. i do not understand your code about appending coordinates (i cut the code from this Repository). because i think xx and yy should exchange their coordinates. could you please tell me why do you do that? why not xx[i, :, :, 0] = i and yy[:, i, :, 0] = i ?
if append_coord:
n = X.shape[0]
inpShape = X.shape[1:]
xx = np.empty(inpShape)
for i in xrange(inpShape[1]):
xx[:, i, :, 0] = i
yy = np.empty(inpShape)
for i in xrange(inpShape[0]):
yy[i, :, :, 0] = i
zz = np.empty(inpShape)
for i in xrange(inpShape[2]):
zz[:, :, i, 0] = i
X = np.concatenate([X, np.array([xx] * n), np.array([yy] * n), np.array([zz] * n)], -1)

data acquisition question

Hi,

I checked your 3D lung segmentation repository and it is really amazing. We are now doing research on organ segmentation and believe your repository is a very good reference.

I see you mentioned in ReadMe that you are using private dataset and I guess we may not able to obtain the same dataset as you used? But also I find that there are some requirement on data format and ground truth file format, that I would like to ask whether you know any public dataset might have similar format as the one you used for this repository?

Thanks,
Jin

slice indices must be integers or None or have an __index__ method

Hi
trying to reproduce the result.
As "from scipy.misc import imresize" can't be used any more .... I am trying to using
from skimage.transform import resize.

changes

lungs[:img_size, :img_size] = imresize(saggital(t_img), [img_size, img_size]) * 1. / 256

mask[:img_size, :img_size][imresize(saggital(pred[i]), [img_size, img_size]) > 128] = 1

gt_mask[:img_size, :img_size][imresize(saggital(y[i][..., 1]), [img_size, img_size]) > 128] = 1

lungs[:img_size, :img_size] = resize(saggital(t_img), [img_size, img_size]) * 1. / 256
mask[:img_size, :img_size][resize(saggital(pred[i]), [img_size, img_size]) > 128] = 1
gt_mask[:img_size, :img_size][resize(saggital(y[i][..., 1]), [img_size, img_size]) > 128] = 1

got below error:
t_img = exposure.rescale_intensity(nib.load(path + df.ix[i]['path']).get_data(), out_range=(0, 1))
Traceback (most recent call last):
File "/user/iibi/skuanar/Downloads/lung-segmentation-3d/lung-segmentation-3d-master/inference.py", line 101, in
lungs[yy * img_size: (yy + 1) * img_size, xx * img_size: (xx + 1) * img_size] = t_img[:, :, -zz]
TypeError: slice indices must be integers or None or have an index method

np.concatenate((1 - y, y), -1)?

hi. eclique. After reading your code, I don't understand much about it. I hope to get your advice. I don't quite understand 'np.concatenate (1-y, y),-1)',What does this code mean?and Why do you want to do the reverse operation?I implore your answer.
y = np.expand_dims(y, -1)
y = np.array(y)
y = np.concatenate((1 - y, y), -1)
y = np.array(y)

Questions about loading model

Hello,

I cannot run inference.py directly without changing a thing. I run in python3, and I do not know if it is the version that matters? It seems that there exists problem in loading the model, I guess.
image
Can you help me with my problem? I am a machine learning beginner and it may be a stupid problem and I will be glad to get your feedback!!

incomplete segmentation

Hi,
Have you seen any hole within the segmentation due to nodules or artifact? If yes, how do you get the perfect filled-out mask?

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.