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):
394
394
t .data_per_streamline [::- 1 ],
395
395
t .data_per_point [::- 1 ])
396
396
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
+
397
407
def test_tractogram_copy (self ):
398
408
# Create a copy of a tractogram.
399
409
tractogram = DATA ['tractogram' ].copy ()
You can’t perform that action at this time.
0 commit comments