Skip to content

Commit

Permalink
BUG: need to incrementally add.
Browse files Browse the repository at this point in the history
  • Loading branch information
ntustison committed Nov 23, 2024
1 parent 6b220c5 commit 6b7d638
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ants/registration/registration.py
Original file line number Diff line number Diff line change
Expand Up @@ -1683,7 +1683,7 @@ def label_image_registration(fixed_label_images,
moving_label_geoms = ants.label_geometry_measures(moving_label_images[i])
moving_label_ids = np.array(moving_label_geoms['Label'])
common_label_ids.append(np.intersect1d(moving_label_ids, fixed_label_ids))
total_number_of_labels = len(common_label_ids[i])
total_number_of_labels += len(common_label_ids[i])
if verbose:
print("Common label ids for image pair ", str(i), ": ", common_label_ids[i])
if len(common_label_ids) == 0:
Expand Down Expand Up @@ -1716,7 +1716,7 @@ def label_image_registration(fixed_label_images,
for j in range(len(common_label_ids[i])):
label = common_label_ids[i][j]
if verbose:
print(" Finding center of mass for label " + str(label))
print(" Finding center of mass for image " + str(i) + ", label " + str(label))
fixed_single_label_image = ants.threshold_image(fixed_label_images[i], label, label, 1, 0)
fixed_centers_of_mass[count, :] = ants.get_center_of_mass(fixed_single_label_image)
moving_single_label_image = ants.threshold_image(moving_label_images[i], label, label, 1, 0)
Expand Down

0 comments on commit 6b7d638

Please sign in to comment.