Skip to content

Commit 95df42e

Browse files
committed
TEST: Test that multiline header items can be parsed
1 parent be2cc87 commit 95df42e

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

nibabel/streamlines/tests/test_tck.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ def setup_module():
3131
# standard.tck contains only streamlines
3232
DATA['standard_tck_fname'] = pjoin(data_path, 'standard.tck')
3333
DATA['matlab_nan_tck_fname'] = pjoin(data_path, 'matlab_nan.tck')
34+
DATA['multiline_header_fname'] = pjoin(data_path, 'multiline_header_field.tck')
3435

3536
DATA['streamlines'] = [
3637
np.arange(1 * 3, dtype='f4').reshape((1, 3)),
@@ -87,6 +88,14 @@ def test_load_matlab_nan_file(self):
8788
assert len(streamlines) == 1
8889
assert streamlines[0].shape == (108, 3)
8990

91+
def test_load_multiline_header_file(self):
92+
for lazy_load in [False, True]:
93+
tck = TckFile.load(DATA['multiline_header_fname'], lazy_load=lazy_load)
94+
streamlines = list(tck.tractogram.streamlines)
95+
assert len(tck.header['command_history'].splitlines()) == 3
96+
assert len(streamlines) == 1
97+
assert streamlines[0].shape == (253, 3)
98+
9099
def test_writeable_data(self):
91100
data = DATA['simple_tractogram']
92101
for key in ('simple_tck_fname', 'simple_tck_big_endian_fname'):
4.31 KB
Binary file not shown.

0 commit comments

Comments
 (0)