File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed
nibabel/streamlines/tests Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -394,6 +394,16 @@ def test_tractogram_add_new_data(self):
394394 t .data_per_streamline [::- 1 ],
395395 t .data_per_point [::- 1 ])
396396
397+ # Add new data to a tractogram for which its `streamlines` is a view.
398+ t = Tractogram (DATA ['streamlines' ]* 2 , affine_to_rasmm = np .eye (4 ))
399+ t = t [:len (DATA ['streamlines' ])] # Create a view of `streamlines`
400+ t .data_per_point ['fa' ] = DATA ['fa' ]
401+ t .data_per_point ['colors' ] = DATA ['colors' ]
402+ t .data_per_streamline ['mean_curvature' ] = DATA ['mean_curvature' ]
403+ t .data_per_streamline ['mean_torsion' ] = DATA ['mean_torsion' ]
404+ t .data_per_streamline ['mean_colors' ] = DATA ['mean_colors' ]
405+ assert_tractogram_equal (t , DATA ['tractogram' ])
406+
397407 def test_tractogram_copy (self ):
398408 # Create a copy of a tractogram.
399409 tractogram = DATA ['tractogram' ].copy ()
You can’t perform that action at this time.
0 commit comments