@@ -27,7 +27,8 @@ def setUp(self):
27
27
img2d = ants .image_read (ants .get_ants_data ('r16' ))
28
28
img3d = ants .image_read (ants .get_ants_data ('mni' ))
29
29
self .imgs = [img2d , img3d ]
30
- self .pixeltypes = ['unsigned char' , 'unsigned int' , 'float' ]
30
+ self .pixeltypes = ['unsigned char' , 'unsigned int' , 'float' , 'double' ]
31
+ self .numpy_pixeltypes = ['uint8' , 'uint32' , 'float32' , 'float64' ]
31
32
32
33
def tearDown (self ):
33
34
pass
@@ -138,10 +139,10 @@ def test_clone(self):
138
139
#self.setUp()
139
140
for img in self .imgs :
140
141
orig_ptype = img .pixeltype
141
- for ptype in self .pixeltypes :
142
+ for ptype in [ * self .pixeltypes , * self . numpy_pixeltypes ] :
142
143
imgclone = img .clone (ptype )
143
144
144
- self .assertEqual ( imgclone .pixeltype , ptype )
145
+ self .assertIn ( ptype , [ imgclone .dtype , imgclone . pixeltype ] )
145
146
self .assertEqual (img .pixeltype , orig_ptype )
146
147
# test physical space consistency
147
148
self .assertTrue (ants .image_physical_space_consistency (img , imgclone ))
@@ -530,7 +531,7 @@ def setUp(self):
530
531
img2d = ants .image_read (ants .get_ants_data ('r16' )).clone ('float' )
531
532
img3d = ants .image_read (ants .get_ants_data ('mni' )).clone ('float' )
532
533
self .imgs = [img2d , img3d ]
533
- self .pixeltypes = ['unsigned char' , 'unsigned int' , 'float' ]
534
+ self .pixeltypes = ['unsigned char' , 'unsigned int' , 'float' , 'double' ]
534
535
535
536
def tearDown (self ):
536
537
pass
0 commit comments