standalone ICON and GradICON losses for registration network training#80
standalone ICON and GradICON losses for registration network training#80BailiangJ wants to merge 1 commit intouncbiag:masterfrom
Conversation
|
Since the flow field in the official code is normalized to [-1,1] while the implementation here is the displacement in the original resolution, |
|
This is good code, but I don't think it's a good fit for the icon_registration codebase. There is a distinction between a framework and a library, and the code in this pull request would be a great implementation of the GradICON loss in a library. However, icon_registration really is an opinionated framework that wants to do the whole registration training and deployment process in it's idiosyncratic way, more than a library that plugs into a larger codebase. This was a hard choice to make! In general, a library is a better choice than a framework because of the additional flexibility and reduced time to learn it. However, in our lab we've found that there's real synergy between the GradICON loss, the specific implementation of multi-step registration via composed TwoStep operators, the decision to represent transforms as python functions instead of raw displacement fields, and the final wrapper that allows ITK code to interface with registration in a way that respects spatial metadata. This has motivated the decision to stay as a tightly integrated framework. If you end up hosting this version of the GradICON loss in a different repository with tests and documentation, I'd be happy to link to it in the readme |
|
Hi @HastingsGreer , Thank you for the reply. I fully understand your choice of design for the gradICON framework. Before I host this version of GradICON loss in another repo, how about we leave the PR open so people can check it directly in this repo? Btw, could you do me a favor to code review my implementation? I have already checked multiple times by comparing it to your codebase. Just want to make sure I didn't make a mistake :). I have used it for training, and it looks stable, and the output flow fields are smooth. Cheers, |
@HastingsGreer : Here is a version of the code that uses all the ICON wrappers but the only difference is you can now pass phi_AB and phi_BA to calculate the loss functions. I have included citation for GradICON paper in MORPH-LER repo ReadMe.md. Please let me know if other related papers also have to be cited by people using these functions. |
Hi @HastingsGreer ,
Thanks a lot for sharing the code.
I have created the standalone ICON and GradICON losses with Pytorch, which can be directly used in general registration network training. Modification would be much simpler to plug in and play with them.
Relevant to issue #79
Double check is needed to see if there is any error in the implementation. :)
Cheers,
Bailiang