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

Move code that converts ddf tensor to itk VectorImage into library? #4117

Closed
wyli opened this issue Apr 12, 2022 Discussed in #4104 · 0 comments · Fixed by #5897
Closed

Move code that converts ddf tensor to itk VectorImage into library? #4117

wyli opened this issue Apr 12, 2022 Discussed in #4104 · 0 comments · Fixed by #5897

Comments

@wyli
Copy link
Contributor

wyli commented Apr 12, 2022

Discussed in #4104

Originally posted by HastingsGreer April 11, 2022
There is a correct way to convert a ddf tensor accepted by Monai's warp block into an itk VectorImage accepted by itk's WarpImageFilter.

This conversion is defined and tested here:

import itk

I would like to use this conversion code, and I think it is generally useful since it correctly handles fiddly details like transposing the tensor and reversing the order of elements in each vector. Would a pull request moving it from the test code into the MONAI library be welcome?

--
see also https://github.com/Project-MONAI/tutorials/blob/master/modules/resample_benchmark.ipynb

wyli pushed a commit that referenced this issue Feb 20, 2023
Fixes #5708
Fixes #4117

### Description

This is a migration of the PR (by @ntatsisk https://github.com/ntatsisk)
InsightSoftwareConsortium/itk-torch-transform-bridge#6
into MONAI.

### Types of changes
<!--- Put an `x` in all the boxes that apply, and remove the not
applicable items -->
- [x] Non-breaking change (fix or new feature that would not break
existing functionality).
- [ ] Breaking change (fix or new feature that would cause existing
functionality to change).
- [x] New tests added to cover the changes.
- [ ] Integration tests passed locally by running `./runtests.sh -f -u
--net --coverage`.
- [x] Quick tests passed locally by running `./runtests.sh --quick
--unittests --disttests`.
- [ ] In-line docstrings updated.
- [ ] Documentation updated, tested `make html` command in the `docs/`
folder.

---------

Signed-off-by: Felix Schnabel <f.schnabel@tum.de>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant