File tree Expand file tree Collapse file tree 1 file changed +18
-2
lines changed
nibabel/streamlines/tests Expand file tree Collapse file tree 1 file changed +18
-2
lines changed Original file line number Diff line number Diff line change @@ -85,5 +85,21 @@ def test_load_write_file(self):
8585 loaded_tck = TckFile .load (filename , lazy_load = False )
8686 assert_tractogram_equal (loaded_tck .tractogram , tck .tractogram )
8787
88- tck_file .seek (0 , os .SEEK_SET )
89- #assert_equal(tck_file.read(), open(filename, 'rb').read())
88+ # tck_file.seek(0, os.SEEK_SET)
89+ # assert_equal(tck_file.read(), open(filename, 'rb').read())
90+
91+ # Save tractogram that has an affine_to_rasmm.
92+ for lazy_load in [False , True ]:
93+ tck = TckFile .load (self .simple_tck_filename , lazy_load = lazy_load )
94+ affine = np .eye (4 )
95+ affine [0 , 0 ] *= - 1 # Flip in X
96+ tractogram = Tractogram (tck .streamlines , affine_to_rasmm = affine )
97+
98+ new_tck = TckFile (tractogram )
99+ tck_file = BytesIO ()
100+ new_tck .save (tck_file )
101+ tck_file .seek (0 , os .SEEK_SET )
102+
103+ loaded_tck = TckFile .load (tck_file , lazy_load = False )
104+ assert_tractogram_equal (loaded_tck .tractogram ,
105+ tractogram .to_world (lazy = True ))
You can’t perform that action at this time.
0 commit comments