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

WIP: Time-varying transform for landmarks. #415

Merged
merged 4 commits into from
Nov 21, 2022
Merged

WIP: Time-varying transform for landmarks. #415

merged 4 commits into from
Nov 21, 2022

Conversation

ntustison
Copy link
Member

Hey @stnava ,

When you get some time, it would be great if you could take a look. I think I'm close on this one.

import ants
import numpy as np
fixed = np.array([[50.0,50.0],[200.0,50.0],[200.0,200.0]])
moving = np.array([[50.0,50.0],[50.0,200.0],[200.0,200.0]])
domain_image = ants.image_read(ants.get_ants_data("r16"))
xfrm = ants.fit_transform_to_paired_points(moving, fixed, transform_type="tv", 
   domain_image=domain_image, number_of_fitting_levels=5, composition_step_size=10.0,
   number_of_integration_points=4)
grid = ants.create_warped_grid(domain_image)

xfrm_forward = ants.transform_from_displacement_field(ants.integrate_velocity_field(xfrm, 0, 1))
ants.plot(ants.apply_ants_transform_to_image(xfrm_forward, grid, grid))

xfrm_inverse = ants.transform_from_displacement_field(ants.integrate_velocity_field(xfrm, 1, 0))
ants.plot(ants.apply_ants_transform_to_image(xfrm_inverse, grid, grid))

@ntustison ntustison merged commit b14d1ec into master Nov 21, 2022
@ntustison ntustison deleted the TvLandamrks branch November 21, 2022 20:39
@ntustison
Copy link
Member Author

Hey @stnava, I think this is working now (as well as the one over in ANTsR). I'll probably add a verbose for the diffeo transforms but that'll be a future commit. Note that I had to update both the ITK and ANTs tag so I hope I didn't cause any problems there.

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 this pull request may close these issues.

None yet

1 participant