@@ -44,15 +44,28 @@ def test_geometry():
44
44
ntf .close ()
45
45
46
46
surf_path = ntf .name
47
- write_geometry (surf_path , create_stamp , coords , faces )
47
+ create_stamp = "created by %s on %s" % (os .getlogin (), time .ctime ())
48
+ write_geometry (surf_path , coords , faces , create_stamp )
48
49
49
50
coords2 , faces2 = read_geometry (surf_path )
50
51
52
+ with open (surf_path ,'rb' ) as fobj :
53
+ magic = np .fromfile (fobj , ">u1" , 3 )
54
+ read_create_stamp = fobj .readline ().rstrip ('\n ' )
55
+
51
56
# Remove temporary file
52
57
os .unlink (surf_path )
53
58
54
- assert_equal (coords , coords2 )
55
- assert_equal (faces , faces2 )
59
+ assert_equal (create_stamp , read_create_stamp )
60
+
61
+ np .testing .assert_array_equal (coords , coords2 )
62
+ np .testing .assert_array_equal (faces , faces2 )
63
+
64
+ # Validate byte ordering
65
+ coords_swapped = coords .byteswap ().newbyteorder ()
66
+ faces_swapped = faces .byteswap ().newbyteorder ()
67
+ np .testing .assert_array_equal (coords_swapped , coords )
68
+ np .testing .assert_array_equal (faces_swapped , faces )
56
69
57
70
@freesurfer_test
58
71
def test_morph_data ():
0 commit comments