Skip to content

Commit

Permalink
Fix tests/test_warp.py (Project-MONAI#7794)
Browse files Browse the repository at this point in the history
Fixes Project-MONAI#7793

### Description

The Update() method in ITK is used to trigger the execution of the
pipeline. Add it to checks if the output data is up-to-date. If it is
not (for example, if the input data or parameters have changed), it will
recompute the output.

### 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).
- [ ] 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: YunLiu <[email protected]>
  • Loading branch information
KumoLiu authored May 23, 2024
1 parent 373c003 commit e5afa43
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions tests/test_warp.py
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,7 @@ def itk_warp(img, ddf):
# warp
warp_filter.SetDisplacementField(displacement_field)
warp_filter.SetInput(itk_img)
warp_filter.Update()
warped_img = warp_filter.GetOutput()
warped_img = np.asarray(warped_img)

Expand Down

0 comments on commit e5afa43

Please sign in to comment.