Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add bending energy and diffusion regularizer demo #1587

Closed
kvttt opened this issue Dec 5, 2023 · 2 comments · Fixed by #1589
Closed

Add bending energy and diffusion regularizer demo #1587

kvttt opened this issue Dec 5, 2023 · 2 comments · Fixed by #1589

Comments

@kvttt
Copy link
Contributor

kvttt commented Dec 5, 2023

Is your feature request related to a problem? Please describe.

          Would be great to add the demo to the tutorial repo and mention it in the docstring.

Originally posted by @KumoLiu in Project-MONAI/MONAI#7272 (comment)

Describe the solution you'd like
Add the demo, similar to the one here.

Describe alternatives you've considered
/

Additional context

  • I'm not sure if @ebrahimebrahim would mind me doing both bending energy and diffusion in the same notebook, or we could work on demos for the two losses separately. I wouldn't mind doing both but let me know what your preference is! :)
  • In addition to the existing stuff in my personal demo, I think it would also be helpful to include explanations of some of the examples used for unit testing.
  • After this, need to update the docstring in MONAI core for both losses.
  • Looking even further, maybe the 3d unpaired registration tutorial would also need to be updated to reflect this change.
@ebrahimebrahim
Copy link
Contributor

I agree that covering bending energy and diffusion in the same notebook makes sense.

I think that the scale invariance and scaling law stuff in the personal demo that you and I put together should not go into the tutorials repo. Or at least it should be simplified before going in, since it was originally designed to verify that an algorithm was behaving correctly and not really designed to be tutorial material. Someone interested in a tutorial on bending/diffusion loss functions would just want to see an example DDF and see the loss functions applied. Then we can be like "here's what normalize=True does" and show the effect.

Thanks for posting this task and for any work that you end up doing on it :D

@kvttt
Copy link
Contributor Author

kvttt commented Dec 5, 2023

I agree that covering bending energy and diffusion in the same notebook makes sense.

I think that the scale invariance and scaling law stuff in the personal demo that you and I put together should not go into the tutorials repo. Or at least it should be simplified before going in, since it was originally designed to verify that an algorithm was behaving correctly and not really designed to be tutorial material. Someone interested in a tutorial on bending/diffusion loss functions would just want to see an example DDF and see the loss functions applied. Then we can be like "here's what normalize=True does" and show the effect.

Thanks for posting this task and for any work that you end up doing on it :D

Thank you! And I agree that scaling laws should not go into the tutorial repo. With that being said, I think what are necessary to include in this tutorial would be

  • Formula for bending energy and diffusion,
  • Demonstration that bending energy is not scale invariant (a visual example just like the one you provided in your notebook would suffice), diffusion is not scale invariant in some cases (maybe display examples of these cases), and
  • How both losses are made invariant by specifying normalize=True.

And the emphasis should be on how to use these two losses instead of on the more technical aspects.

I will go ahead and put together a draft :)

This was referenced Dec 9, 2023
KumoLiu pushed a commit that referenced this issue Dec 27, 2023
Fixes #1587.

### Description
As mentioned in #1587, the notebook should contain
- [x] Formula for bending energy and diffusion,
- [x] Demonstration that bending energy is not scale invariant while
diffusion is not scale invariant in some cases (maybe display examples
of these cases), and
- [x] How both losses are made invariant by specifying `normalize=True`.

### Checks
<!--- Put an `x` in all the boxes that apply, and remove the not
applicable items -->
- [x] Avoid including large-size files in the PR.
- [x] Clean up long text outputs from code cells in the notebook.
- [x] For security purposes, please check the contents and remove any
sensitive info such as user names and private key.
- [ ] Ensure (1) hyperlinks and markdown anchors are working (2) use
relative paths for tutorial repo files (3) put figure and graphs in the
`./figure` folder
- [x] Notebook runs automatically `./runner.sh -t <path to .ipynb file>`

---------

Signed-off-by: kaibo <ktang@unc.edu>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Ebrahim Ebrahim <ebrahim.ebrahim@kitware.com>
boneseva pushed a commit to boneseva/MONAI-tutorials that referenced this issue Apr 21, 2024
Fixes Project-MONAI#1587.

### Description
As mentioned in Project-MONAI#1587, the notebook should contain
- [x] Formula for bending energy and diffusion,
- [x] Demonstration that bending energy is not scale invariant while
diffusion is not scale invariant in some cases (maybe display examples
of these cases), and
- [x] How both losses are made invariant by specifying `normalize=True`.

### Checks
<!--- Put an `x` in all the boxes that apply, and remove the not
applicable items -->
- [x] Avoid including large-size files in the PR.
- [x] Clean up long text outputs from code cells in the notebook.
- [x] For security purposes, please check the contents and remove any
sensitive info such as user names and private key.
- [ ] Ensure (1) hyperlinks and markdown anchors are working (2) use
relative paths for tutorial repo files (3) put figure and graphs in the
`./figure` folder
- [x] Notebook runs automatically `./runner.sh -t <path to .ipynb file>`

---------

Signed-off-by: kaibo <ktang@unc.edu>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Ebrahim Ebrahim <ebrahim.ebrahim@kitware.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants