Skip to content

Commit

Permalink
Fix inverse_transform
Browse files Browse the repository at this point in the history
  • Loading branch information
clementpoiret committed Sep 1, 2021
1 parent 547395f commit e5390a7
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion roiloc/locator.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from typing import Optional

import ants
import numpy as np
from ants.core import ANTsImage

from .location import crop, get_coords
Expand Down Expand Up @@ -128,7 +129,10 @@ def inverse_transform(self, image: ANTsImage) -> ANTsImage:
Returns:
ANTsImage: Inverse transformed image.
"""
return ants.decrop_image(image, self._image)
empty_image = self._image.new_image_like(
np.zeros_like(self._image.numpy()))

return ants.decrop_image(image, empty_image)


def test():
Expand Down

0 comments on commit e5390a7

Please sign in to comment.