Skip to content

Commit

Permalink
Update registration.py
Browse files Browse the repository at this point in the history
Allows only_affine to work without fury package (regtools)
  • Loading branch information
DelinteNicolas authored Nov 21, 2022
1 parent 2502706 commit 9b31fb5
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions elikopy/registration.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,14 +58,17 @@ def getTransform(static_volume_file, moving_volume_file, mask_file=None, onlyAff
affine_map = AffineMap(identity,
static.shape, static_grid2world,
moving.shape, moving_grid2world)
resampled = affine_map.transform(moving)

regtools.overlay_slices(static, resampled, None, 0,
"Static", "Moving", "resampled_0.png")
regtools.overlay_slices(static, resampled, None, 1,
"Static", "Moving", "resampled_1.png")
regtools.overlay_slices(static, resampled, None, 2,
"Static", "Moving", "resampled_2.png")

if sanity_check:

resampled = affine_map.transform(moving)

regtools.overlay_slices(static, resampled, None, 0,
"Static", "Moving", "resampled_0.png")
regtools.overlay_slices(static, resampled, None, 1,
"Static", "Moving", "resampled_1.png")
regtools.overlay_slices(static, resampled, None, 2,
"Static", "Moving", "resampled_2.png")

if onlyAffine:
return affine_map
Expand Down

0 comments on commit 9b31fb5

Please sign in to comment.