File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -424,11 +424,16 @@ def save(self, fileobj):
424424 i4_dtype = np .dtype ("<i4" ) # Always save in little-endian.
425425 f4_dtype = np .dtype ("<f4" ) # Always save in little-endian.
426426
427- # Make sure streamlines are in rasmm then send them to voxmm.
427+ # Since the TRK format requires the streamlines to be saved in
428+ # voxmm, we first transform them accordingly. The transformation
429+ # is performed lazily since `self.tractogram` might be a
430+ # LazyTractogram object, which means we might be able to loop
431+ # over the streamlines only once.
428432 tractogram = self .tractogram .to_world (lazy = True )
429433 affine_to_trackvis = get_affine_rasmm_to_trackvis (header )
430434 tractogram = tractogram .apply_affine (affine_to_trackvis , lazy = True )
431- # Assume looping over the streamlines can be done only once.
435+
436+ # Create the iterator we'll be using for the rest of the funciton.
432437 tractogram = iter (tractogram )
433438
434439 try :
You can’t perform that action at this time.
0 commit comments