neheller / kits19 Goto Github PK
View Code? Open in Web Editor NEWThe official repository of the 2019 Kidney and Kidney Tumor Segmentation Challenge
License: Other
The official repository of the 2019 Kidney and Kidney Tumor Segmentation Challenge
License: Other
Hi, @neheller ,
Thanks for organizing this great challenge, from which I have learned a lot.
I wonder to know when we could have access to the attributes information mentioned in the preprint, such as birth year, nephrectomy year, gender and so on.
Best,
Jet
This is referencing an issue first raised on Discourse here. case_00002
and case_00003
were mentioned in particular but the report is that there may be others.
I see the rules say I need to submit files in .nii format.
I used .tif (converted .nii to .tif) to run 2D U-net to generate prediction scores. Is it possible to submit .tif based test predictions inasted of .nii?
how to download data ? ı can't git lfs data
when I was running "python -m starter_code.get_imaging" to get the data
it lead to an ERROR
"PermissionError: [WinError 32] 另一个程序正在使用此文件,进程无法访问。: 'D:\kits19-master\starter_code\temp.tmp' -> 'data\case_00000\imaging.nii.gz'"
but I have run nothing but this
can I have another way to get these data?such as github?
Somehow I downloaded all 300 files in one folder. How can I separate the train set from the test set? Also, any light on how the top teams generated the validation set (was it random split, 70:30 split?) would be greatly helpful? thanks
Dear organizers,
Thanks for organizing the excellent challenge.
I want to rotate the image to the standard view and write the code, but it does not help.
Would it be possible for you to give me some instructions?
Following is my code.
import numpy as np
import nibabel as nb
import os
filepath = r'H:\Data\kits19\data'
savepath = r'H:\Data\kits19\preData'
if os.path.exists(savepath) is False: os.mkdir(savepath)
STD_AXCODES = ('S', 'A', 'R')
def do_reorientation(data_array, init_axcodes, final_axcodes):
"""
Performs the reorientation (changing order of axes).
:param data_array: Array to reorient
:param init_axcodes: Initial orientation
:param final_axcodes: Target orientation
:return data_reoriented: New data array in its reoriented form
"""
ornt_init = nb.orientations.axcodes2ornt(init_axcodes)
ornt_fin = nb.orientations.axcodes2ornt(final_axcodes)
if np.array_equal(ornt_init, ornt_fin):
return data_array
if np.any(np.isnan(ornt_init)) or np.any(np.isnan(ornt_fin)):
raise ValueError
try:
ornt_transf = nb.orientations.ornt_transform(ornt_init, ornt_fin)
data_reoriented = nb.orientations.apply_orientation(data_array, ornt_transf)
except (ValueError, IndexError):
raise ValueError
return data_reoriented
filenames = os.listdir(filepath)
i = 0
for name in filenames[0:1]:
img_nii = nb.load(os.path.join(filepath, name+'\\imaging.nii.gz'))
img_data = img_nii.get_data()
label_data = nb.load(os.path.join(filepath, name+'\\segmentation.nii.gz')).get_data()
# reorientation to standard view
_axcodes = tuple(nb.aff2axcodes(img_nii.affine)) # affine is a 4*4 matrix
img_data = do_reorientation(img_data, _axcodes, STD_AXCODES)
label_data = do_reorientation(label_data, _axcodes, STD_AXCODES)
img_save_name = 'kidneyvol-' + str(i) + '.nii.gz'
label_save_name = 'kidneymask-'+ str(i) + '.nii.gz'
# new_affine = np.zeros_like(img_nii.affine)
# new_affine[0][0] = img_nii.affine[2][2]
# new_affine[2][2] = img_nii.affine[0][0]
# save results
save_img_nii = nb.Nifti1Image(img_data, img_nii.affine, img_nii.header)
nb.save(save_img_nii, os.path.join(savepath, img_save_name))
save_label_nii = nb.Nifti1Image(label_data, img_nii.affine, img_nii.header)
nb.save(save_label_nii, os.path.join(savepath, label_save_name))
Looking forward to your reply!
Best regards,
Edward
usage: ipykernel_launcher.py [-h] -c CASE_ID -d DESTINATION
[-u UPPER_HU_BOUND] [-l LOWER_HU_BOUND]
ipykernel_launcher.py: error: the following arguments are required: -c/--case_id, -d/--destination
Dear organizers,
Thanks for organizing the excellent challenge.
I found that some renal tumors and renal cysts seem very similar. I wonder if the tumor segmentation will be confused if the cyst is labeled as normal kidney?
Starter code works fine and some minor details were cleared by looking at nibabel docs, but now I have a numpy array of float64 with values in +/- thousands without a clear understanding of what to do next: do I cast it to uint8, do I normalize it to [0;1] or maybe it's int16 image. Could you please clarify?
Thanks for sharing the large-scale dataset.
I open these nii.gz files via ITK-SNAP, and found the following cases having common error: case_00015, case_00025, case_00061 and case_00117, repeating some slices containing kidney and tumor, but without corresponding mask 'kidney' and mask 'tumor'.
I recommend you remove these slices in the above three cases.
Within 24 hours of submitting, you will receive an email prompting whether or not you would like to hear your score. Scores for each team will provided only twice, but you may keep submitting after receiving two scores. The most recent submission prior to the deadline will be the one used for the competition.
Erm... Now that is something I don't like to see. Can you please at least add Gaussian Noise (or any other type of noise that prevents us from knowing the exact Dice scores) to the reported values? Anything that obfuscates +- 1 dice point would be greatly appreciated.
I apologize if I appear a little rude, but optimizations on the test set really should be avoided. Someone could create more than one team and get plenty of feedback.
Best,
Fabian
when use the comand git clone https://github.com/neheller/kits19 Cloning into 'kits19'... remote: Enumerating objects: 3876, done. remote: Counting objects: 100% (3876/3876), done. remote: Compressing objects: 100% (3843/3843), done. remote: Total 3876 (delta 41), reused 3855 (delta 28), pack-reused 0 Receiving objects: 100% (3876/3876), 468.09 KiB | 70.00 KiB/s, done. Resolving deltas: 100% (41/41), done. Checking connectivity... done.
the imaging.nii.gz size only 1kb
ImageFileError: Cannot work out file type of "C:\Users\tensor19\Desktop\kits19\data\case_00009\imaging.nii.gz"
I've installed git lfs successfully and it seems that I could also clone the git repo successfully.
While the size of each .nii file I download is only "134 bytes".
Could anyone help me.
Thanks!
Here's the output:
~/Desktop/Research/Github/kits19$ git clone https://github.com/neheller/kits19
Cloning into 'kits19'...
remote: Enumerating objects: 676, done.
remote: Counting objects: 100% (676/676), done.
remote: Compressing objects: 100% (671/671), done.
remote: Total 676 (delta 17), reused 638 (delta 0), pack-reused 0
Receiving objects: 100% (676/676), 92.89 KiB | 0 bytes/s, done.
Resolving deltas: 100% (17/17), done.
Checking connectivity... done.
Checking out files: 100% (429/429), done.
This occasionally occurs for me. As mentioned here, credential caching is the recommended way of working around this.
git config --global credential.helper cache
Discussion moved here from this Discourse comment.
I have cloned without git lfs install and this comes:
$ git clone https://github.com/neheller/kits19.git
Cloning into 'kits19'...
remote: Enumerating objects: 679, done.
remote: Counting objects: 100% (679/679), done.
remote: Compressing objects: 100% (655/655), done.
Receiving objects: 74%remote: Total 679 (delta 19), reused 679 (delta 19), pack-reused 0
Receiving objects: 88% (598/679), 60.00 KiB | 57.00 KiB/s
Receiving objects: 100% (679/679), 93.87 KiB | 65.00 KiB/s, done.
Resolving deltas: 100% (19/19), done.
After this , there is no respond and any Filtering content process.
when i cloned with git lfs install, i find that each nii file is only 1kb,
Have you solved this problem? Can anyone share this dataset on google drive or baidu drive?
3ks alot!
Cloning into 'kits19'...
remote: Enumerating objects: 3890, done.
remote: Counting objects: 100% (3890/3890), done.
remote: Compressing objects: 100% (3853/3853), done.
remote: Total 3890 (delta 48), reused 3867 (delta 32), pack-reused 0
Receiving objects: 100% (3890/3890), 470.30 KiB | 866.00 KiB/s, done.
Resolving deltas: 100% (48/48), done.
Downloading data/case_00000/imaging.nii.gz (226 MB)
Error downloading object: data/case_00000/imaging.nii.gz (cdae5f3): Smudge error: Error downloading data/case_00000/imaging.nii.gz (cdae5f3e0fbc7c98ab0430b3de42677abda2c1cf93ae0f86bd29fb8606688cb7): batch response: This repository is over its data quota. Purchase more data packs to restore access
Errors logged to /content/workspace/kits19/.git/lfs/objects/logs/20190606T062731.240685733.log
Use `git lfs logs last` to view the log.
error: external filter 'git-lfs filter-process' failed
fatal: data/case_00000/imaging.nii.gz: smudge filter lfs failed
warning: Clone succeeded, but checkout failed.
You can inspect what was checked out with 'git status'
and retry the checkout with 'git checkout -f HEAD'
It shows the repository data quota was run out...
Hi @neheller ,
How do you interpolate the image and corresponding label in this branch?
Would it be possible for you to share the code that you used?
Best regards,
Jun
Hi @neheller ,
Thanks for organizing the great challenge.
Just now, I find the per case scores of the test set are publicly available.
https://kits19.grand-challenge.org/evaluation/results/
To avoid per-case finetune during post-kits, how about closing them?
Best,
Jun
import os
import requests
from tqdm import tqdm
dataDir = r"" # The target dir you want to store the downloaded files
caseNamePattern = "case_%05d"
dataUrl = "https://media.githubusercontent.com/media/neheller/kits19/master/data/"
imageUrlPattern = dataUrl + caseNamePattern + "/imaging.nii.gz"
#segmentationUrlPattern = dataUrl + caseNamePattern + "/segmentation.nii.gz"
for case in tqdm(range(210, 300)): # Use tqdm_notebook in jupyter notebook to show the download progress
caseDir = os.path.join(dataDir, caseNamePattern%case)
print(caseDir)
os.mkdir(caseDir)
imageUrl = imageUrlPattern%case
imageR = requests.get(imageUrl)
with open(os.path.join(caseDir, "imaging.nii.gz"), 'wb') as f:
f.write(imageR.content)
from starter_code.utils import load_case
volume, segmentation = load_case("case_00125")
throws the error : ImageFileError: Cannot work out file type of "/Users/divyanshuaggarwal/Desktop/kits19-master/data/case_00123/imaging.nii.gz"
Hi @neheller
When downloading the new data by
git clone -b interpolated --single-branch https://github.com/neheller/kits19
the network often breaks off, could you tell me how to resume the downloading from breakpoints?
Best,
Jun
$ gunzip imaging.nii.gz
gzip: imaging.nii.gz: not in gzip format
Can't access the data. Can you provide the password?
Thanks in advance.
Error downloading object: data/case_00008/imaging.nii.gz (ce45627): Smudge error: Error downloading data/case_00008/imaging.nii.gz (ce45627ceffdcd225655132ae50d9d1e7661d1c41f171e3419bb9ebd286e14d8): cannot write data to tempfile "/data/kits19/.git/lfs/incomplete/ce45627ceffdcd225655132ae50d9d1e7661d1c41f171e3419bb9ebd286e14d8.tmp": LFS: unexpected EOF
Errors logged to /data/kits19/.git/lfs/logs/20190704T230255.737132676.log
Use git lfs logs last
to view the log.
error: external filter git-lfs smudge -- %f failed 2
error: external filter git-lfs smudge -- %f failed
fatal: data/case_00008/imaging.nii.gz: smudge filter lfs failed
Dear organizers,
thank you for replying to issue #10 !
I found another suspicious ground truth CID=166, in which a water-value blob in the right kidney is labeled 0. When tracking the blob downwards, it looks like a part of the ureter, and thus it might be appropriate to exclude it from the "strict kidney" labeling. The cyst-like appearance might be a result of hydronephrosis instead of a parapelvic cyst.
Thank you in advance.
ImageFileError: Cannot work out file type of "/content/kits19/data/case_00000/imaging.nii.gz"
Hi there,
I took this from Rules -> Submission format on the KiTS Homepage. Not sure if a github issue is the correct place of asking this, so please feel free to redirect me.
Predictions should be submitted as a zip (your-teamname.zip) archive of .nii.gz files named prediction_00210.nii.gz, ..., prediction_000299.npy corresponding to the ordered list of 90 test cases. That is, you should generate each of these prediction files in a particular directory, and then from that directory, run the following command:
zip your-teamname.zip case_*.nii.gz
The name of the predicted segmentations is all over the place. First it's prediction_XXXXX.nii.gz
, then the next one is prediction_XXXXXX.npy
and finally in the last line it is case_??.nii.gz
. Would be great if you could update this description.
Thank you so much for organizing this challenge and putting all the effort into this! It's a really nice dataset and also quite nicely annotated, despite the occasional hiccup people seem to have noticed regarding some of the cases!
Best,
Fabian
Dear @neheller,
For the ranking scheme,
Teams will be ranked by their average score per case, with the highest being the winner.
Would it be possible to add pairwise statistical comparisons between top solutions as BraTS, Decathlon and iSeg did?
This may help to identify the real best solution because a small performance improvement can't indicate particular dominance of a method over the others.
Thanks for organizing the great challenge, and I really enjoy it.
Looking forward to your reply!
Best,
Jun
I ran:
!sudo apt-get install git-lfs
!git lfs install
!git lfs clone https://github.com/neheller/kits19.git
in Colaboratory. It worked during the challenge, but now it doesn't? Similar issue: #23
Can you please add images as well.
I think it's worth mentioning that when cloning the repository directory with git clone https://github.com/neheller/kits19
, the segmentations are not always cloned.
I ended having to run
git lfs install --skip-smudge --skip-repo <- also added this
git clone https://github.com/neheller/kits19
cd kits19
git lfs pull <- added this
to get the segmentations to install fully.
Just thought it's something worth noting on the README. Wonder if this was true for other people as well?
The width of case_00160 is not same as others i.e. (*, 512, 796), thus it may return error while input in Neural network.
The dimension of all the other cases is (*, 512, 512)
React with a 👍 if you would find useful a separate branch(es) with the data and labels transformed to fixed pixel_width
and slice_thickness
.
3D Slicer shows wrong Image Spacing and Three Plane as following (Please watch inside the borders).
I fixed Image Spacing and Direction by SimpleITK.
import SimpleITK as sitk
image = sitk.ReadImage('./data/case_00000/imaging.nii.gz')
image.SetDirection((0,0,1,0,1,0,-1,0,0))
image.SetSpacing((0.5, 0.919921875, 0.919921875)) # this values from data/kits.json
sitk.WriteImage(image, './data/case_00000/imaging_fix.nii.gz')
3D Slicer shows correct Image Spacing and Three Plane as following.
I checked only Case 00000 and 00001, but other cases should be wrong too.
Thank you.
In the 'The Cancer Imaging Archive (TCIA): Maintaining and Operating a Public Information Repository' paper N. Heller et al. said that there is information about a lot of things but we have the only pixel width and slice thickness. We don't have 'pathology t stage' – 'pathology n stage' and 'pathology m stage' etc. Can you please share others too?
Thanks
The get_data() method in visualize.py fails with this Trace:
Traceback (most recent call last):
File "/home/jp/kits19/starter_code/visualize.py", line 188, in
plane=args.plane
File "/home/jp/kits19/starter_code/visualize.py", line 82, in visualize
vol = vol.get_data()
File "/usr/local/lib/python3.6/dist-packages/nibabel/deprecator.py", line 162, in deprecated_func
return func(*args, **kwargs)
File "/usr/local/lib/python3.6/dist-packages/nibabel/dataobj_images.py", line 208, in get_data
data = np.asanyarray(self._dataobj)
File "/home/bubu/.local/lib/python3.6/site-packages/numpy/core/_asarray.py", line 138, in asanyarray
return array(a, dtype, copy=False, order=order, subok=True)
File "/usr/local/lib/python3.6/dist-packages/nibabel/arrayproxy.py", line 393, in array
arr = self._get_scaled(dtype=dtype, slicer=())
File "/usr/local/lib/python3.6/dist-packages/nibabel/arrayproxy.py", line 360, in _get_scaled
scaled = apply_read_scaling(self._get_unscaled(slicer=slicer), scl_slope, scl_inter)
File "/usr/local/lib/python3.6/dist-packages/nibabel/arrayproxy.py", line 339, in _get_unscaled
mmap=self._mmap)
File "/usr/local/lib/python3.6/dist-packages/nibabel/volumeutils.py", line 523, in array_from_file
n_read = infile.readinto(data_bytes)
File "/usr/lib/python3.6/gzip.py", line 276, in read
return self._buffer.read(size)
File "/usr/lib/python3.6/_compression.py", line 68, in readinto
data = self.read(len(byte_view))
File "/usr/lib/python3.6/gzip.py", line 471, in read
uncompress = self._decompressor.decompress(buf, size)
zlib.error: Error -3 while decompressing data: invalid code lengths set
What should I provide to use KiTS19?
Only 3 fields are present in KiTS.json. But in the research paper more than 50 attributes are described.
for each case the json file has only:
{
"case_id": "case_00209",
"captured_pixel_width": 0.78125,
"captured_slice_thickness": 5
}
Dear @neheller ,
Thanks for releasing the test data. It seems they are merged with training data.
How can we download the interpolated test data solely?
Best,
Jun
sayantan@kali:~/kits19$ python3 starter_code/visualize.py -c case 123 -d /home/sayantan/Desktop/
Traceback (most recent call last):
File "starter_code/visualize.py", line 7, in
from starter_code.utils import load_case
ModuleNotFoundError: No module named 'starter_code'
Skipping object checkout, Git LFS is not installed.0 MB/s
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.