Skip to content

Commit

Permalink
Update for loop and affine argument
Browse files Browse the repository at this point in the history
Signed-off-by: Andres <[email protected]>
  • Loading branch information
diazandr3s committed Sep 5, 2023
1 parent 1d367a0 commit 44ea27f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions sample-apps/radiology/lib/transforms/transforms.py
Original file line number Diff line number Diff line change
Expand Up @@ -528,13 +528,13 @@ def transform_points(self, point, affine):

def __call__(self, data):
d: Dict = dict(data)
for key_label, val_label in self.label_names.items():
for key_label in self.label_names.keys():
points = d.get(key_label, [])
if len(points) < 1:
continue
reoriented_points = self.transform_points(
np.array(points)[None],
np.linalg.inv(d["image_meta_dict"]["affine"].numpy()) @ d["image_meta_dict"]["original_affine"],
np.linalg.inv(d["image"].meta["affine"].numpy()) @ d["image"].meta["original_affine"],
)
d[key_label] = reoriented_points[0]
return d

0 comments on commit 44ea27f

Please sign in to comment.