36
36
data_path = pjoin (nib_data , 'nitest-freesurfer' , DATA_SDIR )
37
37
have_freesurfer = isdir (data_path )
38
38
39
+ < << << << HEAD
39
40
freesurfer_test = pytest .mark .skipif (not have_freesurfer , reason = 'cannot find freesurfer {0} directory' .format (DATA_SDIR ))
41
+ == == == =
42
+ freesurfer_test = pytest .mark .skipif (not have_freesurfer ,
43
+ reason = 'cannot find freesurfer {0} directory' .format (DATA_SDIR ))
44
+ > >> >> >> 2 fb977b1605f5a4c4394f3b1b694e0a5e8f66de5
40
45
41
46
def _hash_file_content (fname ):
42
47
hasher = hashlib .md5 ()
@@ -59,10 +64,16 @@ def test_geometry():
59
64
surf_path , read_metadata = True , read_stamp = True )
60
65
61
66
assert 0 == faces .min ()
67
+ < << << << HEAD
62
68
assert coords .shape [0 ] == (faces .max () + 1 )
63
69
assert 9 == len (volume_info )
64
70
# assert np.array_equal([2, 0, 20],volume_info['head'])
65
71
np .testing .assert_array_equal ([2 , 0 , 20 ],volume_info ['head' ])
72
+ == == == =
73
+ assert coords .shape [0 ] == faces .max () + 1
74
+ assert 9 == len (volume_info )
75
+ assert np .array_equal ([2 , 0 , 20 ], volume_info ['head' ])
76
+ >> >> >> > 2 fb977b1605f5a4c4394f3b1b694e0a5e8f66de5
66
77
assert create_stamp == ['created by greve on Thu Jun 8 19:17:51 2006' ] # this creates assertion error - should we just remove it?
67
78
68
79
# Test equivalence of freesurfer- and nibabel-generated triangular files
@@ -80,8 +91,12 @@ def test_geometry():
80
91
for key in ('xras' , 'yras' , 'zras' , 'cras' ):
81
92
assert_allclose (volume_info2 [key ], volume_info [key ],
82
93
rtol = 1e-7 , atol = 1e-30 )
94
+ < << << << HEAD
83
95
#assert.array_equal(volume_info2['cras'], volume_info['cras'])
84
96
np .testing .assert_array_equal (volume_info2 ['cras' ], volume_info ['cras' ])
97
+ == == == =
98
+ assert np .array_equal (volume_info2 ['cras' ], volume_info ['cras' ])
99
+ >> >> >> > 2 fb977b1605f5a4c4394f3b1b694e0a5e8f66de5
85
100
with open (surf_path , 'rb' ) as fobj :
86
101
np .fromfile (fobj , ">u1" , 3 )
87
102
read_create_stamp = fobj .readline ().decode ().rstrip ('\n ' )
@@ -156,7 +171,11 @@ def test_write_morph_data():
156
171
for shape in okay_shapes :
157
172
write_morph_data ('test.curv' , values .reshape (shape ))
158
173
# Check ordering is preserved, regardless of shape
174
+ < << << << HEAD
159
175
assert np .array_equal (read_morph_data ('test.curv' ) ,values )
176
+ == == == =
177
+ assert np .array_equal (read_morph_data ('test.curv' ), values )
178
+ >> >> >> > 2 fb977b1605f5a4c4394f3b1b694e0a5e8f66de5
160
179
with pytest .raises (ValueError ):
161
180
write_morph_data ('test.curv' , np .zeros (shape ), big_num )
162
181
# Windows 32-bit overflows Python int
@@ -166,7 +185,10 @@ def test_write_morph_data():
166
185
for shape in bad_shapes :
167
186
with pytest .raises (ValueError ):
168
187
write_morph_data ('test.curv' , values .reshape (shape ))
188
+ < << << << HEAD
169
189
190
+ == == == =
191
+ >> >> >> > 2 fb977b1605f5a4c4394f3b1b694e0a5e8f66de5
170
192
171
193
@freesurfer_test
172
194
def test_annot ():
0 commit comments