Skip to content

Commit 0a75431

Browse files
committed
TEST: Simple load test for matlab_nan.tck
1 parent 10ae9bc commit 0a75431

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

nibabel/streamlines/tests/test_tck.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ def setup():
3232
"simple_big_endian.tck")
3333
# standard.tck contains only streamlines
3434
DATA['standard_tck_fname'] = pjoin(data_path, "standard.tck")
35+
DATA['matlab_nan_tck_fname'] = pjoin(data_path, "matlab_nan.tck")
3536

3637
DATA['streamlines'] = [np.arange(1 * 3, dtype="f4").reshape((1, 3)),
3738
np.arange(2 * 3, dtype="f4").reshape((2, 3)),
@@ -64,6 +65,13 @@ def test_load_simple_file(self):
6465
tck = TckFile(tractogram, header=hdr)
6566
assert_tractogram_equal(tck.tractogram, DATA['simple_tractogram'])
6667

68+
def test_load_matlab_nan_file(self):
69+
for lazy_load in [False, True]:
70+
tck = TckFile.load(DATA['matlab_nan_tck_fname'], lazy_load=lazy_load)
71+
streamlines = list(tck.tractogram.streamlines)
72+
assert_equal(len(streamlines), 1)
73+
assert_equal(streamlines[0].shape, (108, 3))
74+
6775
def test_writeable_data(self):
6876
data = DATA['simple_tractogram']
6977
for key in ('simple_tck_fname', 'simple_tck_big_endian_fname'):

0 commit comments

Comments
 (0)