@@ -178,10 +178,10 @@ def test_new_image_like(self):
178
178
vecimg = ants .from_numpy (np .random .randn (69 ,12 ,3 ).astype ('float32' ), has_components = True )
179
179
new_data = np .random .randn (69 ,12 ,4 ).astype ('float32' )
180
180
vecimg .new_image_like (new_data )
181
-
181
+
182
182
def test_from_numpy_like (self ):
183
183
img = ants .image_read (ants .get_data ('mni' ))
184
-
184
+
185
185
arr = img .numpy ()
186
186
arr *= 2
187
187
img2 = ants .from_numpy_like (arr , img )
@@ -242,9 +242,6 @@ def test__add__(self):
242
242
img3 = img + img2
243
243
244
244
def test__radd__ (self ):
245
- if os .name == "nt" :
246
- return
247
-
248
245
#self.setUp()
249
246
for img in self .imgs :
250
247
# op on constant
@@ -283,9 +280,6 @@ def test__sub__(self):
283
280
img3 = img - img2
284
281
285
282
def test__rsub__ (self ):
286
- #if os.name == "nt":
287
- # return
288
-
289
283
#self.setUp()
290
284
for img in self .imgs :
291
285
# op on constant
@@ -324,9 +318,6 @@ def test__mul__(self):
324
318
img3 = img * img2
325
319
326
320
def test__rmul__ (self ):
327
- if os .name == "nt" :
328
- return
329
-
330
321
#self.setUp()
331
322
for img in self .imgs :
332
323
# op on constant
@@ -666,21 +657,21 @@ def test_allclose(self):
666
657
self .assertTrue (ants .allclose (img ,img2 ))
667
658
self .assertTrue (ants .allclose (img * 6.9 , img2 * 6.9 ))
668
659
self .assertTrue (not ants .allclose (img , img2 * 6.9 ))
669
-
660
+
670
661
def test_pickle (self ):
671
662
import ants
672
663
import pickle
673
664
img = ants .image_read ( ants .get_ants_data ("mni" ))
674
665
img_pickled = pickle .dumps (img )
675
666
img2 = pickle .loads (img_pickled )
676
-
667
+
677
668
self .assertTrue (ants .allclose (img , img2 ))
678
669
self .assertTrue (ants .image_physical_space_consistency (img , img2 ))
679
-
670
+
680
671
img = ants .image_read ( ants .get_ants_data ("r16" ))
681
672
img_pickled = pickle .dumps (img )
682
673
img2 = pickle .loads (img_pickled )
683
-
674
+
684
675
self .assertTrue (ants .allclose (img , img2 ))
685
676
self .assertTrue (ants .image_physical_space_consistency (img , img2 ))
686
677
0 commit comments