Skip to content

Commit

Permalink
call from top-level module
Browse files Browse the repository at this point in the history
  • Loading branch information
dyollb committed Nov 18, 2024
1 parent 26fc83b commit 3433a63
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions tests/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -1012,9 +1012,7 @@ def tearDown(self):
pass

def test_from_sitk(self):
from ants.utils.sitk_to_ants import from_sitk

ants_img = from_sitk(self.img)
ants_img = ants.from_sitk(self.img)

with TemporaryDirectory() as temp_dir:
temp_fpath = os.path.join(temp_dir, "img.nrrd")
Expand All @@ -1029,14 +1027,12 @@ def test_from_sitk(self):
nptest.assert_almost_equal(self.img.GetDirection(), img.GetDirection())

def test_ito_sitk(self):
from ants.utils.sitk_to_ants import to_sitk

with TemporaryDirectory() as temp_dir:
temp_fpath = os.path.join(temp_dir, "img.nrrd")
sitk.WriteImage(self.img, temp_fpath)
ants_img = ants.image_read(temp_fpath)

img = to_sitk(ants_img)
img = ants.to_sitk(ants_img)

nptest.assert_equal(
sitk.GetArrayViewFromImage(self.img), sitk.GetArrayViewFromImage(img)
Expand Down

0 comments on commit 3433a63

Please sign in to comment.