Comments (12)
Hi,sorry for my late reply. I am currently on holidays in the countryside with very limited internet access. It seems to me that this error (from (19,19,19) to (19,19) shape broadcast problem comes from some conversion from 3D to 2D either in the data or in the filters you defined. As you mentioned, FCN can get images of arbitrary size. Actually images in the paper using this network have different sizes, so this is not an issue. For the generation of patches, the network takes care of that, so you only have to give the images and specify the patch sizes. What should be of same size is input image and ground truth. I will be back in around 10 days. If you do not solve the problem by that time I can have a look to your configuration.
Best
from livianet.
Thanks so much for the reply! That's fine I just want to post my question first so you may reply whenever you can:)
Yeah I think so too. But I didn't modify the settings for filters at all: kernelshapes = [[3, 3, 3], [3, 3, 3], [3, 3, 3], [1]]. It is 3D so should not cause this issue?
I can't think of where the 3D->2D conversion takes place as I only modified the # of classes, pre-trained weights(yours) and input dataset(of course).
Thanks again!
from livianet.
Hi @YilinLiu97 Jus back from holidays. Could you send me just one sample with its corresponding ground truth (and ROI in case you use it) to try to reproduce the error? Thanks.
from livianet.
Hi @josedolz, thanks for contacting me:) I have solved the problem. It is simply because the data files do not match with their ground truths. However, I do have some new questions:
- How am I supposed to segment 25 classes, when the ground true contains around 140 classes? Are ROIs used for that reason?
- If the ground true contains no label for the background, do I still need to include it when I specify the # of classes for segmentation in the config file? (i.e. numOfClasses - 25 or 26 in my case?)
Thank you!
from livianet.
Nice to hear that you solved that problem. It was strange because I have tried several times several configurations that might crash the algorithm and it always worked. Anyway, good news..:)
For your questions:
1- The number of classes should be the same both in training and testing. When you define the number of classes for the network, that is the output (one probability map per class) that you will get at the output of the network. Therefore it must be the same. ROIs are used first, to prone the search area, so that you only get patches inside the ROI, and for the sampling strategy, being sure that you get patches containing labels of interest (inside ROI) and also background (outside ROI). In segmentation it is only used to constrain the search region.
2- In all datasets I have been working with, background labels are present. When you have a new target image you usually have no clue where to look for, so the image usually contains classes of interest and background. So you need to include also that in training. That is why I recommend to include numClasses + 1.
If you are not satisfied with these answers, please feel free to add more details so that I can give you a more appropriate answer.
Best,
Jose
from livianet.
Thanks so much for the detailed explanation!! Sorry for my late reply.
Great! that's what I thought about the use of ROIs too. I have run the generateROIs.py and it works wonderfully! So, I need to modify this script a bit to constrain my search region only to where those 25 structures are? In that way I can segment only the 25 structures, right?
from livianet.
Because currently a issue is that if I specify the # of classes (in config) as 26, I will get the index error, but if I change it to 140, the problem will be solved (but I only want those 25 structures).
Your paper said that the IBSR contains expert-labelled segmentations of 45 brain structures, but only a subset of 8 important subcortical structures are considered. So in fact, I'm trying to do something similar except that I only want to segment 25 structures when the ground truth contains 140 structures. Thanks!
from livianet.
Ok, I think I got your point.
You mean that from a dataset with X classes you are interested only in Y classes (being Y < X), right?
In that case you should modify a bit the processLabels.py file, so that you select the labels you are interested in and you include them in your new ground truth, that will contain only the classes of interest. For example, let's say that in the IBSR dataset you want to get only the classes corresponding to the main subcortical structures (labels: 10,11,12,13,49,50,51,52 ) . Then, you can do something like:
labelsToSelect = [10,11,12,13,49,50,51,52]
labelCorrectedImage = np.zeros(imageData.shape, dtype=np.int8)
for i_l in xrange(0, len(labelsToSelect)):
idx = np.where(imageData == labelsToSelect[i_l])
labelCorrectedImage[idx] = i_l + 1
where imageData is the image containing all the labels.
from livianet.
Exactly! That code solved my problem! Thank you so much! :)
from livianet.
Sorry, one more question!
Is it possible to send me the Abide dataset with labels processed by freesurfer? (Or just the labels will be fine). Thank you in advance!! [email protected]
from livianet.
I'll ask the responsible of those labels, since you know that sharing medical images is not straightforward.
Jose
from livianet.
I see. That's fine! Thanks so much for the help :)
from livianet.
Related Issues (20)
- About the perfermance of results and sampling HOT 10
- type error when training HOT 2
- Deploy the model without ground truth HOT 8
- Code for visualization of the feature map activation HOT 4
- How to concatenate x1 and x2 in HyperDenseNet HOT 2
- Questions about HyperDenseNet configuration HOT 2
- TypeError with theano HOT 3
- About the MHD HOT 4
- About the number of samples at each subEpoch HOT 10
- Pre-processing MRI images HOT 5
- A problem about NAN HOT 2
- Directory structure for multiple modalities. HOT 4
- Visualization HOT 1
- Probabilities contain NaN while using my nifti input HOT 4
- Error occured while training HOT 13
- ZeroDivisionError: integer division or modulo by zero
- how did you got the GT? HOT 4
- version of LIvianet trained for cerebellar lobules parcellsation
- EDGE DETECTION
- Dropout value fix to 0.0 and 0.5 in fully connected and softmax layers HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from livianet.