@@ -267,25 +267,25 @@ def test_ornt2axcodes():
267
267
# Recoding orientation to axis codes
268
268
labels = (('left' , 'right' ), ('back' , 'front' ), ('down' , 'up' ))
269
269
assert ornt2axcodes ([[0 , 1 ],
270
- [1 , 1 ],
271
- [2 , 1 ]], labels ) == ('right' , 'front' , 'up' )
270
+ [1 , 1 ],
271
+ [2 , 1 ]], labels ) == ('right' , 'front' , 'up' )
272
272
assert ornt2axcodes ([[0 , - 1 ],
273
- [1 , - 1 ],
274
- [2 , - 1 ]], labels ) == ('left' , 'back' , 'down' )
273
+ [1 , - 1 ],
274
+ [2 , - 1 ]], labels ) == ('left' , 'back' , 'down' )
275
275
assert ornt2axcodes ([[2 , - 1 ],
276
- [1 , - 1 ],
277
- [0 , - 1 ]], labels ) == ('down' , 'back' , 'left' )
276
+ [1 , - 1 ],
277
+ [0 , - 1 ]], labels ) == ('down' , 'back' , 'left' )
278
278
assert ornt2axcodes ([[1 , 1 ],
279
- [2 , - 1 ],
280
- [0 , 1 ]], labels ) == ('front' , 'down' , 'right' )
279
+ [2 , - 1 ],
280
+ [0 , 1 ]], labels ) == ('front' , 'down' , 'right' )
281
281
# default is RAS output directions
282
282
assert ornt2axcodes ([[0 , 1 ],
283
- [1 , 1 ],
284
- [2 , 1 ]]) == ('R' , 'A' , 'S' )
283
+ [1 , 1 ],
284
+ [2 , 1 ]]) == ('R' , 'A' , 'S' )
285
285
# dropped axes produce None
286
286
assert ornt2axcodes ([[0 , 1 ],
287
- [np .nan , np .nan ],
288
- [2 , 1 ]]) == ('R' , None , 'S' )
287
+ [np .nan , np .nan ],
288
+ [2 , 1 ]]) == ('R' , None , 'S' )
289
289
# Non integer axes raises error
290
290
with pytest .raises (ValueError ):
291
291
ornt2axcodes ([[0.1 , 1 ]])
@@ -365,10 +365,8 @@ def test_axcodes2ornt():
365
365
def test_aff2axcodes ():
366
366
assert aff2axcodes (np .eye (4 )) == tuple ('RAS' )
367
367
aff = [[0 , 1 , 0 , 10 ], [- 1 , 0 , 0 , 20 ], [0 , 0 , 1 , 30 ], [0 , 0 , 0 , 1 ]]
368
- assert (aff2axcodes (aff , (('L' , 'R' ), ('B' , 'F' ), ('D' , 'U' ))) ==
369
- ('B' , 'R' , 'U' ))
370
- assert (aff2axcodes (aff , (('L' , 'R' ), ('B' , 'F' ), ('D' , 'U' ))) ==
371
- ('B' , 'R' , 'U' ))
368
+ assert aff2axcodes (aff , (('L' , 'R' ), ('B' , 'F' ), ('D' , 'U' ))) == ('B' , 'R' , 'U' )
369
+ assert aff2axcodes (aff , (('L' , 'R' ), ('B' , 'F' ), ('D' , 'U' ))) == ('B' , 'R' , 'U' )
372
370
373
371
374
372
def test_inv_ornt_aff ():
0 commit comments