Skip to content

Commit

Permalink
DOC: Add example.
Browse files Browse the repository at this point in the history
  • Loading branch information
ntustison committed Nov 24, 2024
1 parent 1623ebf commit 45c190a
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions ants/registration/registration.py
Original file line number Diff line number Diff line change
Expand Up @@ -1631,8 +1631,22 @@ def label_image_registration(fixed_label_images,
Example
-------
>>>
>>>
>>> import ants
>>>
>>> r16 = ants.image_read(ants.get_ants_data('r16'))
>>> r16_seg1 = ants.threshold_image(r16, "Kmeans", 3) - 1
>>> r16_seg2 = ants.threshold_image(r16, "Kmeans", 5) - 1
>>> r64 = ants.image_read(ants.get_ants_data('r64'))
>>> r64_seg1 = ants.threshold_image(r64, "Kmeans", 3) - 1
>>> r64_seg2 = ants.threshold_image(r64, "Kmeans", 5) - 1
>>> reg = ants.label_image_registration([r16_seg1, r16_seg2],
[r64_seg1, r64_seg2],
fixed_intensity_images=r16,
moving_intensity_images=r64,
type_of_linear_transform='affine',
type_of_transform='antsRegistrationSyNQuick[bo]',
label_image_weighting=[1.0, 2.0],
verbose=True)
"""

# Perform validation check on the input
Expand Down

0 comments on commit 45c190a

Please sign in to comment.