Giter VIP home page Giter VIP logo

kits19-challege's Introduction

KiTS19——2019 Kidney Tumor Segmentation Challenge

This is an example of the CT images Kidney Tumor Segmentation

Prerequisities

The following dependencies are needed:

  • python == 3.5.5
  • numpy >= 1.11.1
  • SimpleITK >= 1.0.1
  • opencv-python >= 3.3.0
  • tensorflow-gpu == 1.8.0
  • pandas >=0.20.1
  • scikit-learn >= 0.17.1
  • json >=2.0.9

How to Use

1、Preprocess

  • analyze the ct image,and get the slice thickness and window width and position:run the dataAnaly.py

1.1 Preprocess Kidney

  • keep kidney region into fixed size(512,512,64) for Corse Kidney Segmentation:run the corsedata2dprepare.py
  • generate patch(128,128,64) kidney image and mask for Corse Kidney Segmentation:run the corsedata3dprepare.py
  • keep Kidney region range image for fine Kidney Segmentation:run the finedata2dprepare.py
  • generate patch(128,128,64) kidney image and mask for fine Kidney Segmentation:run the finedata3dprepare.py
  • save patch image and mask into csv file: run the utils.py,like file trainSegmentation.csv
  • split trainSegmentation.csv into training set and test set:run subset.py

1.2 Preprocess Kidney Tumor

  • generate tumor image and mask for 2d Kidney Tumor Segmentation:run the tumordata2dprepare.py
  • generate tumor image and mask for 3d Kidney Tumor Segmentation:run the finedata3dprepare.py
  • save tumor image and mask path into csv file: run the utils.py,like file traintumorSegmentation.csv
  • split traintumorSegmentation.csv into training set and test set

2、Kidney Segmentation

  • the VNet model

2.1 Corse Kidney Segmentation

  • Corse Kidney Segmentation training:run the train_vnet3d_kidney_corse.py
  • Corse Kidney Segmentation inference:run the inference_vnet3d_kidney_corse.py
  • this step get Corse Kidney range,can find the start and end pos in the kidneyrang.txt

2.2 Fine Kidney Segmentation

  • Fine Kidney Segmentation training:run the train_vnet3d_kidney_fine.py
  • Fine Kidney Segmentation inference:run the inference_vnet3d_kidney_fine.py
  • this step following the 2.1 result,get fine Kidney result

2.3 Fine Kidney Segmentation

  • remove Kidney Segmentation small object:run the segresultprocess.py removekidneysmallobj function

3、Kidney Tumor Segmentation

  • the VNet2d model

3.1 2d Kidney Tumor Segmentation

  • 2d Kidney Tumor Segmentation training:run the train_vnet2d_tumor.py

  • 2d Kidney Tumor Segmentation inference:run the inference_vnet2d_tumor.py

  • this step get 2d slice tumor result

  • the VNet3d model

3.2 3d Kidney Tumor Segmentation

  • 3d Kidney Tumor Segmentation training:run the train_vnet3d_tumor.py
  • 3d Kidney Tumor Segmentation inference:run the inference_vnet3d_tumor.py
  • this step get 3d tumor result

3.3 Kidney Tumor Result Process

  • remove Kidney Tumor Segmentation small object:run the segresultprocess.py remove2d3dtumorsmallobj function
  • calculate overlap between 2d tumor and 3d tumor reslut.
  • save the region of 2d tumor and 3d tumor reslut that connect overlap region.
  • save the region of 2d tumor and 3d tumor within Kidney result.
  • merge the above two result and get final tumor result
  • all above step can find in the segresultprocess.py

Result

1、Kidney Segmentation

  • the train loss

  • 200-209case dice value and result

2、Kidney Tumor Segmentation

  • the 2dtrain loss

  • the 3dtrain loss

3、Lead Board

Contact

kits19-challege's People

Contributors

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

kits19-challege's Issues

Model file

Hi

Thanks a lot for sharing your work!

will you be making the model public, i am facing some issues running the code without the model.
Line 244 in model_vnet3d.py /log/segmeation/model/Vnet3d.pd-100000

Thanks in advance.

corsedata3dprepare.py generate patches

I think whenever the stridez >= 1 or stridewidth >= 1 or strideheight >= 1,wo should generate more than one patch. In line 25, I think it should be
if stridez >= 1 or stridewidth >= 1 or strideheight >= 1:

corsedata3dprepare.py make pathes

In this file "corsedata3dprepare.py"
line 21-23
stridewidth = (width - block_width) // numberxy
strideheight = (height - block_height) // numberxy
stridez = (imagez - blockz) // numberz

I think it should be
stridewidth = (width - block_width) // numberxy + 1
strideheight = (height - block_height) // numberxy + 1
stridez = (imagez - blockz) // numberz + 1

Folder Directory

I set up my directory to mimic your folder tree for downloading the images. However, the images are not downloading into the folders. Instead they are being saves outside of the designated folder. For example, if the folder is not in the directory, it creates a folder and doesn't save the images in the sub-folder.

    proImage = "D:\Data\KiTS\kits19process\Image\\"
    proMask = "D:\Data\KiTS\kits19process\Mask\\"
    protumorImage = "D:\Data\KiTS\kits19tumorprocess\Image\\"
    protumorMask = "D:\Data\KiTS\kits19tumorprocess\Mask\\"

not able to reproduce results

Hi

I have followed your steps but i am not able to reproduce the results.at epoch 20 i get the accuracy of 44 but then drops to 13 in the next epoch and then picks up to 34.

Do you have any suggestion?

also wanted to confirm the time it take for you to train to 10 epochs, for me it takes less than a minute with a gpu, is it the same for you? i am running train_vnet3d.py

Thanks

different

hello,
Is there a difference between Kidney Segmentation and Kidney Tumor Segmentation?
Why does Kidney Tumor Segmentation have no results?

tumordata2dprepare.py中路径设置

我想请问1.2 Preprocess Kidney Tumor中第一步 tumordata2dprepare.py文件里的这个路径(35-38行)是如何设置的?我在开源的文件和数据集中没有找到Image和Mask文件夹(小白一枚,请见谅)
[图片]

Where is subset.py?

Thanks for your contribution.
I noticed that the fifth point in ‘Preprocess’ is split trainSegmentation.csv into training set and test set, but I can't find subset.py in your code.
What should I do, or can you update 'How to Use'?

Subset

Nice coding! Is there a way to set a numerical value for subset?

json error

help me
data2prepare.py code executes json error ?

missing subset.py

I cannot find subset.py in the whole project but there's a step to use subset.py for splitting into train and test set

orijinal image

How can I tell which original image is the result of pressing the results during training?

License

Hi, I'd like to use you your project as a baseline for experiments in my master thesis. Would that be possible, and if yes could you add a license? Maybe a citation template too :)

intensity-values truncation?

Hi junqiangchen,

Thanks for this repo. Could you please tell why did you truncate the image intensities in
'load_itkfilewithtrucation' function in corsedata2dprepare.py file? After truncating, the intensity values are rescaled to 0 and 255, so what was the reason for truncating before with 300 and -200?

visualize predictions

Hi

Is there a way to predict on a complete nii.gz case and produce a complete nii.gz file as a segmentation output ?

how would i go about doing this?

Thanks

Training stats

Hi

Could you please tell me for how many epochs you trained your model ? and what's the training accuracy you were able to achieve? I have trained it for 100 epochs but there is lot of fluctuation in the accuracy and it is not exceeding 50% is that like normal?

also i am running train vnet3d_train.py

error while running data3dprepare.py

Hi,

while i run your codes, data3dprepare.py, it reminds me that there are no such directory or file named /kits19segementation/200_12.bmp

while in your code, you write
trainImage = "E:\junqiangchen\data\kits19\kits19segmentation\Image"

I would appreciate it if you could please tell me how to generate this file.

I run the project on Linux.

关于corsedata3dprepare.py

hr_samples[0, 0:blockz, 0:block_width, 0:block_height] = image[0:rangz, 0:rangwidth, 0:rangheight]
hr_mask_samples[0, 0:blockz, 0:block_width, 0:block_height] = mask[0:rangz, 0:rangwidth, 0:rangheight]
您好,请问这里是将原图像的左上角128*128的地方返回吗,这样的话我得到的mask全部为0?

subset

Can you show an example on how you run the subset.py? I'm unsuccessful after several attempts.

RuntimeError: Exception thrown in SimpleITK ReadImage:

I'm so close to getting your code to data2dprocess.py to work. However, I keep running to the runtimeerror at the end of download.

RuntimeErrorTraceback (most recent call last)
<ipython-input-10-c6b6b1f0d94c> in <module>()
    193 
    194 
--> 195 proKitsdata()

<ipython-input-10-c6b6b1f0d94c> in proKitsdata()
    146         file_image = kits_subset_path + image_name
    147         # 1 load itk image and truncate value with upper and lower
--> 148         src = load_itkfilewithtrucation(file_image, 300, -200)
    149         mask_path = kits_subset_path + mask_name
    150         seg = sitk.ReadImage(mask_path, sitk.sitkUInt8)

<ipython-input-10-c6b6b1f0d94c> in load_itkfilewithtrucation(filename, upper, lower)
     77     """
     78     # 1,tructed outside of liver value
---> 79     srcitkimage = sitk.Cast(sitk.ReadImage(filename), sitk.sitkFloat32)
     80     srcitkimagearray = sitk.GetArrayFromImage(srcitkimage)
     81     srcitkimagearray[srcitkimagearray > upper] = upper

/usr/local/lib/python2.7/dist-packages/SimpleITK/SimpleITK.pyc in ReadImage(*args)
   8874 
   8875     """
-> 8876     return _SimpleITK.ReadImage(*args)
   8877 class ImageViewer(_object):
   8878     """

RuntimeError: Exception thrown in SimpleITK ReadImage: /tmp/SimpleITK/Code/IO/src/sitkImageReaderBase.cxx:99:
sitk::ERROR: The file "data/kits19/imaging.nii.gz" does not exist.

Any idea on how to solve.

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.