Comments (22)
@build2create sorry, I hadn't tested that code out yet. With the latest commit that I just committed, you should be able to run the code as you have it in your comment.
from 3dunetcnn.
Alright!
from 3dunetcnn.
With the pre-trained model given here I generated training_ids.pkl
andtesting_ids.pkl.
Bascially just to get testing ids required to test the model. I defined main class as :
if __name__ == '__main__':
run_test_case(1,"./data_test")
The problem is it is not producing any data_dir
.Neither it is appending to it if I create one. And this:
if __name__ == '__main__':
model = load_model(config["model_file"])
predict_from_data_file_and_write_image(model,config["hdf5_file"],0,result.nii.gz)
And this
if __name__ == '__main__':
model = load_model(config["model_file"])
predict_from_data_file_and_write_image(model,config["hdf5_file"],0,data_dir)#data_dir is directory
All of them fail to produce any segmented output. Plus where is get_prediction_labels
getting called?
@ellisdg any idea on this one? Apologies for the constant trouble.
from 3dunetcnn.
Maybe try giving a full path name instead of "./data_test"? Does that work?
from 3dunetcnn.
It worked but gave error
ValueError: "concat" mode can only merge layers with matching output shapes except for the concat axis. Layer shapes: [(None, 1024, 18, 18, 9), (None, 256, 18, 18, 18)]
then I updated the configuration in keras.json file as
{
"image_dim_ordering": "th",
"epsilon": 1e-07,
"floatx": "float32",
"backend": "tensorflow"
}
Note: earlier "backend": "theano"
this was the in the keras.json file so it was giving error.(refer this)
it ran finally but gave error:
ValueError: Invalid objective: dice_coef_loss
then I added these:
from model import dice_coef_loss
from model import dice_coef
and
model = load_model(config["model_file"],custom_objects={'dice_coef_loss': dice_coef_loss,'dice_coef':dice_coef})
Now I get this error:
ValueError: Error when checking : expected input_1 to have 5 dimensions, but got array with shape (3, 144, 144, 144)
To which I added 'T2' to config["training_modalities"]
Now to the call in main:
run_test_case(1,'/home/adminsters/Desktop/3DUnetCNN-master/data_dir');
it gives index error:
File "testing.py", line 67, in <module>
run_test_case(1,'/home/adminsters/Desktop/3DUnetCNN-master/data_dir');
File "testing.py", line 53, in run_test_case
image = nib.Nifti1Image(test_data[i], affine)
IndexError: index 3 is out of bounds for axis 0 with size 3
My testing_ids.pkl is:
[141, 20, 15, 57, 186, 167, 60, 80, 23, 54, 143, 158, 132, 83, 61, 81, 168, 85, 157, 90, 147, 86, 127, 199, 74, 136, 24, 182, 146, 152, 170, 44, 30, 156, 172, 154, 1, 25, 59, 45]
I guess it is because I changed the config["training_modalities"]
@ellisdg how to fix this Index error?
from 3dunetcnn.
from 3dunetcnn.
I am getting index error. Please see updated comment
from 3dunetcnn.
In case you are not able to see I am reposting it here:
Initially I was getting this:
ValueError: "concat" mode can only merge layers with matching output shapes except for the concat axis. Layer shapes: [(None, 1024, 18, 18, 9), (None, 256, 18, 18, 18)]
then I updated the configuration in keras.json file as
{
"image_dim_ordering": "th",
"epsilon": 1e-07,
"floatx": "float32",
"backend": "tensorflow"
}
Note: earlier"backend": "theano" this was the in the keras.json file so it was giving error.(refer this)
it ran finally but gave error:
ValueError: Invalid objective: dice_coef_loss
then I added these:
from model import dice_coef_loss
from model import dice_coef
and
model = load_model(config["model_file"],custom_objects={'dice_coef_loss': dice_coef_loss,'dice_coef':dice_coef})
Now I get this error:
ValueError: Error when checking : expected input_1 to have 5 dimensions, but got array with shape (3, 144, 144, 144)
So in config.py I added 'T2' to config["training_modalities"]
Now to the call in main:
run_test_case(1,'/home/adminsters/Desktop/3DUnetCNN-master/data_dir');
it gives index error:
File "testing.py", line 67, in <module>
run_test_case(1,'/home/adminsters/Desktop/3DUnetCNN-master/data_dir');
File "testing.py", line 53, in run_test_case
image = nib.Nifti1Image(test_data[i], affine)
IndexError: index 3 is out of bounds for axis 0 with size 3
My testing_ids.pkl is:
[141, 20, 15, 57, 186, 167, 60, 80, 23, 54, 143, 158, 132, 83, 61, 81, 168, 85, 157, 90, 147, 86, 127, 199, 74, 136, 24, 182, 146, 152, 170, 44, 30, 156, 172, 154, 1, 25, 59, 45]
I guess it is because I changed the config["training_modalities"]
@ellisdg how to fix this Index error?
from 3dunetcnn.
It looks like you may have modified line 53, or you may not have the latest version of the file.
from 3dunetcnn.
Ok my bad, ran the updated code this time.
I got his output :
for a test image id 20. How should I infer segmentation labels from this, which one is necrotic,edemic and so on? Like the one in this
When I choose to open segmented image I get this:
Which patch is tumorous how should I interpret?
from 3dunetcnn.
from 3dunetcnn.
Can you elaborate? The first screenshot shows grayscale image. Is that correct?How do I read the first image?Is it like darker parts tumorous? Can you cite/give an example?
from 3dunetcnn.
If I have understood it right this is not for tumor detection but just for volumetric segmentation right?
from 3dunetcnn.
For FLAIR modality I am sort of getting evidently slightly more greyish patch, Is that the tumor?
from 3dunetcnn.
T1:
T1c:
FLAIR:
Tumor prediction. Ranges from 0 to 1:
Manual segmentation. The separate tumor regions are not used by the classifier:
from 3dunetcnn.
Thanks. By the way which tool are you using for viewing? Is it ITK sanp?
from 3dunetcnn.
3D Slicer. I know a lot of people use ITK Snap, but I've never taken the time to learn how to use it. 3D Slicer has a lot of features, so there might be a little bit of a learning curve. They also have plenty of helpful tutorials too.
from 3dunetcnn.
Thanks a lot!
from 3dunetcnn.
By volumetric segmentation we are detecting the presence or absence of the tumor but not the different segments within the tumor, like necrotic, core or enhancing. Doing this would be a multi-class classification problem right?
from 3dunetcnn.
Also why are we not able to segment the tumor into sub-parts.Is it because of data set?I viewed ground truth of BRATS dataset in mha format. They do provide all the segmentation labels.
from 3dunetcnn.
You should be able to train a classifier to segment different tumor regions with Keras. However, I currently have no need for multi-class labels, so I have not implemented it yet. I will probably add this eventually, but that could be months from now.
from 3dunetcnn.
for anyone coming from the future, testing.py was renamed to predict.py:
b4012bb#diff-22508acf6c6356eb94fbcda75eaf09f2
from 3dunetcnn.
Related Issues (20)
- Valued Error on BraTS20 Training HOT 6
- scripts problems HOT 9
- problems in cross validation training HOT 8
- About Evaluation metrics for BraTS example HOT 3
- KeyError: 'config' during evaluation on brats example HOT 4
- I didn't make any changes. I couldn't find the file when I ran the sample file. HOT 2
- An error occurred during the evaluation HOT 2
- Issue with predict.py and resampling scans back into the original space. HOT 2
- The train.py seems no args of "model_filename" and "training_log_filename" HOT 2
- 請問已經訓練出模型出來,該如何去測試模型分割是否理想? HOT 7
- How to use it to train in my own dataset HOT 2
- I'm really sorry for bothering you. HOT 3
- I'm really sorry for bothering you HOT 2
- Unable to clone HOT 2
- Runtime errror HOT 5
- Runtime error
- ImportError: attempted relative import with no known parent package HOT 2
- Loss value is abnormal HOT 2
- predict.py issue HOT 1
- new issue 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 3dunetcnn.