@@ -245,10 +245,11 @@ def __init__(self, streamlines=None,
245245 of ndarrays of shape ($N_t$, $M_i$) where $N_t$ is the number of
246246 points for a particular streamline $t$ and $M_i$ is the number
247247 scalar values to store for that particular information $i$.
248- affine_to_rasmm : ndarray of shape (4, 4)
248+ affine_to_rasmm : ndarray of shape (4, 4), optional
249249 Transformation matrix that brings the streamlines contained in
250250 this tractogram to *RAS+* and *mm* space where coordinate (0,0,0)
251- refers to the center of the voxel.
251+ refers to the center of the voxel. By default, the streamlines
252+ are assumed to be already in *RAS+* and *mm* space.
252253 """
253254 self .streamlines = streamlines
254255 self .data_per_streamline = data_per_streamline
@@ -608,12 +609,13 @@ def __getitem__(self, idx):
608609 raise NotImplementedError ('`LazyTractogram` does not support indexing.' )
609610
610611 def __iter__ (self ):
611- i = 0
612- for i , tractogram_item in enumerate ( self .data , start = 1 ) :
612+ count = 0
613+ for tractogram_item in self .data :
613614 yield tractogram_item
615+ count += 1
614616
615617 # Keep how many streamlines there are in this tractogram.
616- self ._nb_streamlines = i
618+ self ._nb_streamlines = count
617619
618620 def __len__ (self ):
619621 # Check if we know how many streamlines there are.
@@ -642,13 +644,13 @@ def copy(self):
642644 def apply_affine (self , affine ):
643645 """ Applies an affine transformation to the streamlines.
644646
645- The transformation will be applied just before returning the
646- streamlines .
647+ The transformation given by the `affine` matrix is applied after any
648+ other pending transformations to the streamline points .
647649
648650 Parameters
649651 ----------
650652 affine : 2D array (4,4)
651- Transformation that will be applied on each streamline.
653+ Transformation matrix that will be applied on each streamline.
652654
653655 Returns
654656 -------
0 commit comments