-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Downloading registration data link is broken #1
Comments
Hi, I would like to understand how I could use my data set. I have thought it's possible to obtain a copy of your data set and I can see the CNN is working. I don't understand which directories and parameters I have to put in the yaml. Regards, Josemi |
Hello,
Unfortunately, we are not allowed to share the data because it is patient data and we don't have permission to share the data.
However, I can still try to explain how the data should be structured in order to use the code in described in the repository. The code assumes that you have 3D scans stored in the NRRD format. You should manually divide these scans into a training set and a test set. For example, if you have 10 scans in total, you may divide the scans into 8 training scans and 2 test scans. All of the training scans should be stored in the same folder: trn_CT_dir. The test scans should be stored in another folder: tst_image_dir.
The target images (also referred to as gold standard segmentations), need to be stored in two separate folder as well: trn_label_slice_dir and tst_label_dir. These two folder contain the target images corresponding to the scans in the training set and the test set respectively. These scans should also be stored in the NRRD format.
Then there are three other folders: trn_CT_slice_PNG_dir, trn_label_PNG_dir and tst_label_dir. These folders are used to store the 2D slices that can be extracted from the input scans and target scans of the training set, and the input scans of the test set, respectively. This means that the folders can just be empty, they are only used store results. Similarly, you need two folders trn_CT_slice_NPY_dir, trn_label_NPY_dir, which can also be empty, and are only used to store the 2D slices in numpy matrices.
You will need to create two folders to store the patches extracted from the input scans and target scans: trn_CT_patch_dir and trn_label_patch_dir. Again, these folder can just be empty.
Some directories are necessary in order to save the results from a simple thresholding method: thr_label_dir, thr_label_slice_PNG_dir and thr_label_slice_NPY_dir. thr_label_dir should contain the results from the thresholding method in NRRD format. This is something you need to do yourself, the code won't perform thresholding for you. In contrast, thr_label_slice_PNG_dir and thr_label_slice_NPY_dir, can just be empty folders again.
Finally, there are some directories save_dir, weights_save_dir, and architecture_save_dir. These directories are again only used to store results or intermediate weights. You can simply create empty folders for this.
I hope this explanation clarifies the folders a little bit. Please note that the code has been not fully optimized, and some things (especially regarding directories and data loading) might feel counter-intuitive. Unfortunately, we have not been able to maintain or optimize the code. So if you find any improvements or better implementations, feel free to send us a pull request.
Best,
Jordi
…________________________________
Van: Josemi13 <notifications@github.com>
Verzonden: maandag 18 januari 2021 20:47
Aan: NLeSC/yeap16-ai-3d-printing <yeap16-ai-3d-printing@noreply.github.com>
CC: Subscribed <subscribed@noreply.github.com>
Onderwerp: Re: [NLeSC/yeap16-ai-3d-printing] Downloading registration data link is broken (#1)
Hi,
I would like to understand how I could use my data set. I have thought it's possible to obtain a copy of your data set and I can see the CNN is working. I don't understand which directories and parameters I have to put in the yaml.
Regards,
Josemi
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub<https://emea01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FNLeSC%2Fyeap16-ai-3d-printing%2Fissues%2F1%23issuecomment-762441387&data=04%7C01%7C%7C4710af91389c4b96139808d8bbe9e566%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637465960529714884%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=xjzKF5%2BEpOyd%2BKQq81Akbxpt87neYfepCbg1mz6%2F3hg%3D&reserved=0>, or unsubscribe<https://emea01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAGIBUYXCL7MO6NLZNE62AXDS2SF5HANCNFSM4KRJOJBQ&data=04%7C01%7C%7C4710af91389c4b96139808d8bbe9e566%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637465960529724843%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=scxt6jOvNhmAoXwhXc1NvWSl2WOVnGTEYMMbcRVagfU%3D&reserved=0>.
|
Hi, First of all, thanks for your answer. I have 5 CT Scans of differents patients (2D slides of axial cut). I have segmented the CT Scans with 3DSlices software to separate bone and background (air or other structures) using thresholding method. For examples, I decide to use 3 Scans for training and 2 for test. Both slides (original and segmented) are in nrrd format. So, the input in the CNN will be (if I have understand it):
Is it correct? I don't understand the different between thr_label_dir and trn_label_slice_dir. The segmented slices with the thresholding method are the final result I want to obtain. Instead of using the 3dSlicer, I will use the CNN to segment other CT Scans. I look forward to hearing from you. Best, Josemi |
All 5 CT scans that you have should be stored as 3D volumes, not as separate 2D slices. So, a single .NRRD file is used for an entire 3D scan. You are right about settings the paths; those are correct. The difference between thr_label_dir and trn_label_slice_dir, is that thr_label_dir is the directory that holds the segmentation labels of the 3D CT scans segmented with thresholding. thr_label_slice_dir is in principle empty, and will be used by the code to generate the 2D slices from the thresholded 3D CT that were given in thr_label_dir. I hope this clarifies it. Jordi |
Hi, Thanks for the description. So I have to store 3D CT scans segmented (the target of the CNN) in trn_label_slice_dir and leave thr_label_dir empty, isn't I? Related of the CT Scan, I only have images of axial cut. Is possible to convert these images in 3D volumes? Or I need a full CT Scan (images of all cut). Is 3D volumes the labelmaps that are created in the 3DSlicer? I look forward to hearing from you. Best, Josemi |
Hi, Sorry for the delay. thr_label_dir should not be empty. It should contain a segmented 3D scan (in principle using thresholding). This is only used as a comparison to the CNN. trn_slice_slice_dir should indeed be empty. Concerning the error messages you get: can you check if slices have been stored in the trn_slice_label_dir and trn_slice_dir? The error seems to suggest that no slices are available to create the patches. |
Hi, The trn_slice_label_dir, trn_label_slice_PNG_dir, trn_label_slice_NPY_dir folders store images. The problem is the thr_label_slice_PNG_dir folder doesn't save the images. I am storing a labelmap with format .nrrd (it is result of applying thresholding over the CT_Scan in the 3D Slicer software) in thr_label_dir. I don't understand why I don`t obtain png images of the labelmap. I look forward to hearing from you. Best, Josemi |
Hmm I see. Are the thresholded slices not saved for a single patient, or for all of them? The code should be produces slices based on the thresholded CT scans. It sounds like a problem with the path names. Can you check that your path is correct, and that it also ends with a '/'. The code assumes that the path name ends with an '/' (e.g., If this wasn't the problem, you may need to check if the .nrrd files are correctly loaded (line 116 in PatientIO.py). The object |
Hi Josemi, sorry to hear about the problems you are experiencing. Unfortunately I don't have much time to keep this repo up-to-date, so I apologize for my late responses. I think there are two separate problems. One is the creation of the threshold PNG slices, which does not work. The second problem is that the patches cannot be generated, which is the error that you see in picture 6. Since the threshold slices are not used to create patches, I don't expect that these problems are related. About the creation of the threshold slices, I found a mistake in the configReader file. I just fixed the mistake and pushed the new code. If you pull this new code, it should create the threshold PNG files. Please let me know if this solves the issue. Regarding error about the patch generation, can you check a few things for me?
All the best, |
Hi, It seems like the thresholded slices are of a different data type than your gold standard label (not your fault, just someting 3DSlicer apparently does. To avoid the problem, I made a small adjustment to the code, which should convert your thresholded labelmaps into the correct data type. I hope this works. Best, |
Hi, Thanks, I can convert the thresholded labelmaps. Regarding about error the patch generation, how could I check the exact voxel values of the gold standard labels? I don't know what to do to fix the error. Thanks for your colaboration and your time. Best, Josemi |
Hi, Thank you for checking the values of the labels. Did you check all values of the thesholded slices? In the screenshot you showed only the upper left corner of the image, which is empty (there are no bony structures there). In any case, I don't think that the errors are caused by the thresholded slices. The error you mentioned is generated when creating labels from the training scans. This has probably to do with the values of the labels of the training data. To test which values are used in the training labels, you can do the following: In a new python console:
Please let me know what the output of this is. |
Hi, This maybe has to do with the fact that the overwrite function is turned off. This means that a numpy file won't be overwritten with a new one. You can turn the overwrite function on by adding the following statement when calling the function patient.read_save_labels in line 57 in deepy.py:
|
Hi, Sorry for insisting but I need to segment the images of the patients in few weeks. I have tried to many options but the error doesn't disapper. Best, Josemi |
Hi Josemi, sorry for not responding earlier. I have been very busy with a new job, finishing my PhD, and some other stuff, so I haven't been able to maintain this repo properly. Anyway, seeing your code, it seems that segm only contains "2s". However, the code for the patch generation looks for values of "1" to determine a region of interest. Therefore, I would expect that Upper/Lower/Left/Right Edge cannot be found, which gives an error when trying to generate patches. Do you have an idea of why Are you allowed to share your data? If so, maybe you can share it so I can try to reproduce the problem myself. If not, maybe we could set up a virtual meeting? I find it very difficult now to guess what the exact problem is. |
I mean the value 2. It seems that the segm array only consists of values equal to 2. |
Hi,
The link for your registration data seems to be down. If it's possible, could I get access to this data set so I can run your network and get a better idea of how the data should be laid out?
The broken link below:
https://www.slicer.org/w/images/e/eb/RegistrationData.zip
I understand that the data might not be allowed for open use so if it isn't please let me know who I should talk to about getting a copy of it.
Regards,
Tom
The text was updated successfully, but these errors were encountered: