Giter Club home page Giter Club logo

Comments (18)

mohamed-ezz avatar mohamed-ezz commented on June 18, 2024

from cascaded-fcn.

cjayanth95 avatar cjayanth95 commented on June 18, 2024

15970587_1181547601966293_1822897106_n

This is the image I get after HU windowing, histogram equalisation, resizing and padding.
here is the matlab code I used:

img= dicomread('image'); %pixel values range from -1024 to 1023
img(img>=400 | img<=-100) = -1024; %HU windowing(rescale slope = 1, rescale intercept = 0)
img = histeq(img);%histogram equalisation
colorimage= ind2rgb(img, gray(2048));
J = imresize(colorimage, [388 388]); % resize
paddedimage = padarray(J,[92 92],'symmetric');%symmetric padding
paddedimage = uint16(paddedimage);

Am I missing something?

from cascaded-fcn.

mohamed-ezz avatar mohamed-ezz commented on June 18, 2024

Please check the code in the notebook in : https://github.com/IBBM/Cascaded-FCN/blob/master/notebooks/cascaded_unet_inference.ipynb

you can find the preprocessing function named "step1_preprocess_img_slice".
We perform clipping not windowing, and no histogram equalization.

from cascaded-fcn.

cjayanth95 avatar cjayanth95 commented on June 18, 2024

Please look at the prediction at the end. We are getting a blank image.

https://github.com/cjayanth95/liverseg/blob/master/custom_outs.ipynb

from cascaded-fcn.

mohamed-ezz avatar mohamed-ezz commented on June 18, 2024

Did you successfully run our notebook with outputs that make sense ?
I would do this first to make sure the setup is correct.

from cascaded-fcn.

cjayanth95 avatar cjayanth95 commented on June 18, 2024

Actually this is the output we got when we used the data from http://www.ircad.fr/softwares/3Dircadb/3Dircadb1/ . We tried different patients data but our predictions were way off from Ground truth. We are getting blobs in place of the liver. These blobs change when we adjust the prediction probability, but we are unable to predict the whole liver correctly. Would you be able to tell where we can possibly go wrong?

from cascaded-fcn.

cjayanth95 avatar cjayanth95 commented on June 18, 2024

We used BVLC Caffe but not the caffe that you mentioned( https://github.com/mohamed-ezz/caffe/tree/jonlong ). Will that make any difference?

from cascaded-fcn.

mohamed-ezz avatar mohamed-ezz commented on June 18, 2024

I'd recommend you just run the notebook "as is" and install the mentioned dependencies exactly. Otherwise many things can be wrong and it's difficult to help you.

There's a reason of course to use the mentioned branch ( https://github.com/mohamed-ezz/caffe/tree/jonlong ). The latest caffe version has a different crop layer that does not do center crops by default, so if you want to use it you have to specify an offset for each crop layer so that the operation is a center crop.

from cascaded-fcn.

cjayanth95 avatar cjayanth95 commented on June 18, 2024

Thanks for the prompt replies. We were able to reproduce the results after specifying the offset for each crop layer.
Here is the notebook for the same.
https://github.com/cjayanth95/liverseg/blob/master/custom_outs_updated.ipynb

from cascaded-fcn.

cjayanth95 avatar cjayanth95 commented on June 18, 2024

Hi,
Are step1 and step2 supposed to have the same prototxt files?
Also is pred2, the prediction for liver lesions? If so, can you take a look at pred2 in our output at the end of step2? Is the output right?
https://github.com/cjayanth95/liverseg/blob/master/for_me_legion.ipynb

Thanks.

from cascaded-fcn.

mohamed-ezz avatar mohamed-ezz commented on June 18, 2024

from cascaded-fcn.

keesh0 avatar keesh0 commented on June 18, 2024

Could you please provide an example of the following fix--

We were able to reproduce the results after specifying the offset for each crop layer.

from cascaded-fcn.

keesh0 avatar keesh0 commented on June 18, 2024

Could you please provide an example of the following fix--

We were able to reproduce the results after specifying the offset for each crop layer.

Here is my updated crop layers (step 1 model) which appeared to work under Cafe 1.0.0 (AWS Python 3 configured)

layer {
name: "crop_d3c-d3cc"
type: "Crop"
bottom: "d3c" *current blob size (1, 512, 64, 64)
bottom: "u3a" *desired blob size (1, 512, 56, 56)
top: "d3cc"
crop_param {
axis: 2
offset: 4
offset: 4
}
}
layer {

type: "Crop"
bottom: "d2c" (1, 256, 136, 136)
bottom: "u2a" *desired blob size (1, 256, 104, 104)
top: "d2cc"
crop_param {
axis: 2
offset: 16
offset: 16
}
}
layer {
name: "crop_d1c-d1cc"
type: "Crop"
bottom: "d1c" (1, 128, 280, 280)
bottom: "u1a" *desired blob size (1, 128, 200, 200)
top: "d1cc"
crop_param {
axis: 2
offset: 40
offset: 40
}
}
layer {
name: "crop_d0c-d0cc"
type: "Crop"
bottom: "d0c" (1, 64, 568, 568)
bottom: "u0a" *desired blob size (1, 64, 392, 392)
top: "d0cc"
crop_param {
axis: 2
offset: 88
offset: 88
}
}

offset = (current blob size - desired blob size) / 2

I am down to just the following warning which I hope are related to training and not inference:
I0610 23:47:14.142359 4565 net.cpp:744] Ignoring source layer bn_d0b (batch normalization?)
I0610 23:47:14.169219 4565 net.cpp:744] Ignoring source layer loss (loss for training?))

from cascaded-fcn.

manjunathrv1985 avatar manjunathrv1985 commented on June 18, 2024

Hi,
I am having trouble understanding pre-processing step. I have dicom images of liver of size 512x512. How do I proceed further?Do I have to resize it to 388x388 and add symmetrical padding of size 92?

Any help would be appreciated.

Thanks.

15970587_1181547601966293_1822897106_n

This is the image I get after HU windowing, histogram equalisation, resizing and padding.
here is the matlab code I used:

img= dicomread('image'); %pixel values range from -1024 to 1023
img(img>=400 | img<=-100) = -1024; %HU windowing(rescale slope = 1, rescale intercept = 0)
img = histeq(img);%histogram equalisation
colorimage= ind2rgb(img, gray(2048));
J = imresize(colorimage, [388 388]); % resize
paddedimage = padarray(J,[92 92],'symmetric');%symmetric padding
paddedimage = uint16(paddedimage);

Am I missing something?

hello boss can I get a matlabcode for applying a hu windowing and histogram equalisation on a CT image
am working on liver segemntation and disease identification in a CT image using matlab am finding very much difficult in getting code or lead in this if u have any information related to this please share to [email protected]

from cascaded-fcn.

keesh0 avatar keesh0 commented on June 18, 2024

You must following the preprocessing exactly as the model was trained.
Got very good results, even for different CT "phase" images.
See https://github.com/keesh0/cfcn_test_inference/blob/master/python/test_cascaded_unet_inference.py.
Feel free to adapt to your own data.
e.-

from cascaded-fcn.

manjunathrv1985 avatar manjunathrv1985 commented on June 18, 2024

from cascaded-fcn.

keesh0 avatar keesh0 commented on June 18, 2024

Sorry, you would need to translate from Python to Matlab line by line.

from cascaded-fcn.

manjunathrv1985 avatar manjunathrv1985 commented on June 18, 2024

from cascaded-fcn.

Related Issues (20)

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.