dykuang / medical-image-registration Goto Github PK
View Code? Open in Web Editor NEWa project for developing registration tools with convolutional neural networks
a project for developing registration tools with convolutional neural networks
Hello, may I ask whether the pixel value of some blocks of the image is 0 after the displacement occurs in the process of debugging the code?Thank you very much!
Hello,
i need to ask one question. can you please tell me which function you use for visualization of grid.
That you show in folding effect grid
https://github.com/dykuang/Medical-image-registration/blob/master/CheckJac_short.png
shown in this pic
Kind regards
Hafiz
I find that you calculate the dice based on the label list, and then average each part of a sub-region.Why not first fuse all labels into the five rois, and then calculate the dice?
It's like a math question,I thought a lot but can't find the answer.
def Get_Ja(displacement):
'''
Calculate the Jacobian value at each point of the displacement map having
size of b*h*w*d*3 and in the cubic volumn of [-1, 1]^3
'''
D_y = (displacement[:,1:,:-1,:-1,:] - displacement[:,:-1,:-1,:-1,:])
D_x = (displacement[:,:-1,1:,:-1,:] - displacement[:,:-1,:-1,:-1,:])
D_z = (displacement[:,:-1,:-1,1:,:] - displacement[:,:-1,:-1,:-1,:])
D1 = (D_x[...,0]+1)*( (D_y[...,1]+1)*(D_z[...,2]+1) - D_z[...,1]*D_y[...,2])
D2 = (D_x[...,1])*(D_y[...,0]*(D_z[...,2]+1) - D_y[...,2]*D_x[...,0])
D3 = (D_x[...,2])*(D_y[...,0]*D_z[...,1] - (D_y[...,1]+1)*D_z[...,0])
return D1-D2+D3
Thanks for the code.
I am trying to save the checkpoints after every epoch by the following.
from keras.callbacks import ModelCheckpoint
mc = ModelCheckpoint(outpath+'SDN3d_weights_TVS16_{epoch:02d}.ckpt', save_weights_only=True, verbose=1, period=1)
history = sdn.fit_generator(gen_train, steps_per_epoch=2, callbacks=[mc], epochs=2, verbose=1, validation_data=gen_test, validation_steps=len(f_img_v)/batch_size)
the above code generates the checkpoints file but when I try to load them in the eval.py by sdn.load_weights(r'path_to_file')
, there is error
"ValueError: You are trying to load a weight file containing 2 layers into a model with 18 layers."
Thanks in advance
Dear @dykuang,
first of all thanks a lot for sharing your code.
I read the two papers in arxiv and I am interested in the problem of the negative Jacobian in the deformation field. Looking at your code I did not really understand the way you calculate the Jacobian and the related function Get_Ja(). Can you please explain me how you
Calculate the Jacobian value at each point of the displacement map
Dear dykuang,
This repository helps me a lot, but there is something confused me a lot. The question is how to preprocess the data? Can you explain this to me?
Thanks
Is there any instruction for fusion the labels into the five ROIs?
Dear dykuang,
Your work has inspired me a lot, but there is some code I got confused.
1. In train.py
, val_files = ['{:03d}'.format(i) for i in range(0, 20)]
Which data subset is it(val_files) in mindboggle? I guess it should not be OASIS-TRT-20, because this subset is used to evaluate the network as test set.
2. In addition. In voxelmorph, when Unet is down-sampling, the image size will be reduced by a factor of 1/2. If the data set is cropped to 144x180x144, when reproducing voxelmorph, the value 180 will produce fractions during down-sampling,which is automatically rounded down by the computer. Then the size of the image after down sampling will not match the up-sampling, wouldn't it make it impossible to train?
Thanks
Hello, I am very lucky to see your research.If I only want to register a pair of 3D images, which script should I run?
Hello, dykuang:
I'm implementing your vis_grid function in visual.py, The registration field I used is (31,31,3),
and i use the command line vis_grid(flow[:, :, ::2], res=1, direct=2),after that, i got a likely wrong result. The result is:
444
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.