Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 6 additions & 15 deletions tests/test_core_ants_image.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,10 +178,10 @@ def test_new_image_like(self):
vecimg = ants.from_numpy(np.random.randn(69,12,3).astype('float32'), has_components=True)
new_data = np.random.randn(69,12,4).astype('float32')
vecimg.new_image_like(new_data)

def test_from_numpy_like(self):
img = ants.image_read(ants.get_data('mni'))

arr = img.numpy()
arr *= 2
img2 = ants.from_numpy_like(arr, img)
Expand Down Expand Up @@ -242,9 +242,6 @@ def test__add__(self):
img3 = img + img2

def test__radd__(self):
if os.name == "nt":
return

#self.setUp()
for img in self.imgs:
# op on constant
Expand Down Expand Up @@ -283,9 +280,6 @@ def test__sub__(self):
img3 = img - img2

def test__rsub__(self):
if os.name == "nt":
return

#self.setUp()
for img in self.imgs:
# op on constant
Expand Down Expand Up @@ -324,9 +318,6 @@ def test__mul__(self):
img3 = img * img2

def test__rmul__(self):
if os.name == "nt":
return

#self.setUp()
for img in self.imgs:
# op on constant
Expand Down Expand Up @@ -666,21 +657,21 @@ def test_allclose(self):
self.assertTrue(ants.allclose(img,img2))
self.assertTrue(ants.allclose(img*6.9, img2*6.9))
self.assertTrue(not ants.allclose(img, img2*6.9))

def test_pickle(self):
import ants
import pickle
img = ants.image_read( ants.get_ants_data("mni"))
img_pickled = pickle.dumps(img)
img2 = pickle.loads(img_pickled)

self.assertTrue(ants.allclose(img, img2))
self.assertTrue(ants.image_physical_space_consistency(img, img2))

img = ants.image_read( ants.get_ants_data("r16"))
img_pickled = pickle.dumps(img)
img2 = pickle.loads(img_pickled)

self.assertTrue(ants.allclose(img, img2))
self.assertTrue(ants.image_physical_space_consistency(img, img2))

Expand Down