@@ -80,7 +80,7 @@ class PerArrayDict(SliceableDataDict):
80
80
81
81
In addition, it makes sure the amount of data contained in those ndarrays
82
82
matches the number of streamlines given at the instantiation of this
83
- dictionary .
83
+ instance .
84
84
"""
85
85
def __init__ (self , nb_elements , * args , ** kwargs ):
86
86
self .nb_elements = nb_elements
@@ -114,7 +114,7 @@ class PerArraySequenceDict(SliceableDataDict):
114
114
115
115
In addition, it makes sure the amount of data contained in those array
116
116
sequences matches the number of elements given at the instantiation
117
- of this dictionary .
117
+ of the instance .
118
118
"""
119
119
def __init__ (self , nb_elements , * args , ** kwargs ):
120
120
self .nb_elements = nb_elements
@@ -136,9 +136,9 @@ def __setitem__(self, key, value):
136
136
class LazyDict (collections .MutableMapping ):
137
137
""" Dictionary of generator functions.
138
138
139
- This container behaves like an dictionary but it makes sure its elements
140
- are callable objects and assumed to be generator function yielding values.
141
- When getting the element associated to a given key, the element (i.e. a
139
+ This container behaves like a dictionary but it makes sure its elements are
140
+ callable objects that it assumes are generator functions yielding values.
141
+ When getting the element associated with a given key, the element (i.e. a
142
142
generator function) is first called before being returned.
143
143
"""
144
144
def __init__ (self , * args , ** kwargs ):
@@ -178,7 +178,7 @@ def __len__(self):
178
178
class TractogramItem (object ):
179
179
""" Class containing information about one streamline.
180
180
181
- :class:`TractogramItem` objects have three main properties : `streamline`,
181
+ :class:`TractogramItem` objects have three public attributes : `streamline`,
182
182
`data_for_streamline`, and `data_for_points`.
183
183
184
184
Parameters
@@ -187,14 +187,14 @@ class TractogramItem(object):
187
187
Points of this streamline represented as an ndarray of shape (N, 3)
188
188
where N is the number of points.
189
189
data_for_streamline : dict
190
- Dictionary containing some data associated to this particular
191
- streamline. Each key `k ` is mapped to a ndarray of shape (Pt,), where
192
- `Pt` is the dimension of the data associated with key `k `.
190
+ Dictionary containing some data associated with this particular
191
+ streamline. Each key ``k` ` is mapped to a ndarray of shape (Pt,), where
192
+ `` Pt`` is the dimension of the data associated with key ``k` `.
193
193
data_for_points : dict
194
194
Dictionary containing some data associated to each point of this
195
- particular streamline. Each key `k` is mapped to a ndarray of
196
- shape (Nt, Mk), where `Nt` is the number of points of this streamline
197
- and ` Mk` is the dimension of the data associated with key `k `.
195
+ particular streamline. Each key ``k`` is mapped to a ndarray of shape
196
+ (Nt, Mk), where `` Nt`` is the number of points of this streamline and
197
+ `` Mk`` is the dimension of the data associated with key ``k` `.
198
198
"""
199
199
def __init__ (self , streamline , data_for_streamline , data_for_points ):
200
200
self .streamline = np .asarray (streamline )
@@ -215,7 +215,7 @@ class Tractogram(object):
215
215
choice as long as you provide the correct `affine_to_rasmm` matrix, at
216
216
construction time, that brings the streamlines back to *RAS+*, *mm* space,
217
217
where the coordinates (0,0,0) corresponds to the center of the voxel
218
- (opposed to a corner).
218
+ (as opposed to the corner of the voxel ).
219
219
220
220
Attributes
221
221
----------
@@ -224,18 +224,18 @@ class Tractogram(object):
224
224
shape ($N_t$, 3) where $N_t$ is the number of points of
225
225
streamline $t$.
226
226
data_per_streamline : :class:`PerArrayDict` object
227
- Dictionary where the items are (str, 2D array).
228
- Each key represents an information $i$ to be kept alongside every
229
- streamline, and its associated value is a 2D array of shape
230
- ($T$, $P_i$) where $T $ is the number of streamlines and $P_i$ is
231
- the number of values to store for that particular information $i$.
227
+ Dictionary where the items are (str, 2D array). Each key represents a
228
+ piece of information $i$ to be kept alongside every streamline, and its
229
+ associated value is a 2D array of shape ($T$, $P_i$) where $T$ is the
230
+ number of streamlines and $P_i $ is the number of values to store for
231
+ that particular piece of information $i$.
232
232
data_per_point : :class:`PerArraySequenceDict` object
233
- Dictionary where the items are (str, :class:`ArraySequence`).
234
- Each key represents an information $i$ to be kept alongside every
235
- point of every streamline, and its associated value is an iterable
236
- of ndarrays of shape ($N_t$, $M_i$) where $N_t$ is the number of
237
- points for a particular streamline $t$ and $M_i$ is the number
238
- values to store for that particular information $i$.
233
+ Dictionary where the items are (str, :class:`ArraySequence`). Each key
234
+ represents a piece of information $i$ to be kept alongside every point
235
+ of every streamline, and its associated value is an iterable of
236
+ ndarrays of shape ($N_t$, $M_i$) where $N_t$ is the number of points
237
+ for a particular streamline $t$ and $M_i$ is the number values to store
238
+ for that particular piece of information $i$.
239
239
"""
240
240
def __init__ (self , streamlines = None ,
241
241
data_per_streamline = None ,
@@ -424,29 +424,29 @@ class LazyTractogram(Tractogram):
424
424
choice as long as you provide the correct `affine_to_rasmm` matrix, at
425
425
construction time, that brings the streamlines back to *RAS+*, *mm* space,
426
426
where the coordinates (0,0,0) corresponds to the center of the voxel
427
- (opposed to a corner).
427
+ (as opposed to the corner of the voxel ).
428
428
429
429
Attributes
430
430
----------
431
431
streamlines : generator function
432
432
Generator function yielding streamlines. Each streamline is an
433
433
ndarray of shape ($N_t$, 3) where $N_t$ is the number of points of
434
434
streamline $t$.
435
- data_per_streamline : :class:`LazyDict` object
435
+ data_per_streamline : instance of :class:`LazyDict`
436
436
Dictionary where the items are (str, instantiated generator).
437
- Each key represents an information $i$ to be kept alongside every
438
- streamline, and its associated value is a generator function
439
- yielding that information via ndarrays of shape ($P_i$,) where
440
- $P_i$ is the number of values to store for that particular
441
- information $i$.
437
+ Each key represents a piece of information $i$ to be kept alongside
438
+ every streamline, and its associated value is a generator function
439
+ yielding that information via ndarrays of shape ($P_i$,) where $P_i$ is
440
+ the number of values to store for that particular piece of information
441
+ $i$.
442
442
data_per_point : :class:`LazyDict` object
443
- Dictionary where the items are (str, instantiated generator).
444
- Each key represents an information $i$ to be kept alongside every
445
- point of every streamline, and its associated value is a generator
446
- function yielding that information via ndarrays of shape
447
- ( $N_t$, $M_i$) where $N_t$ is the number of points for a particular
448
- streamline $t$ and $M_i$ is the number of values to store for
449
- that particular information $i$.
443
+ Dictionary where the items are (str, instantiated generator). Each key
444
+ represents a piece of information $i$ to be kept alongside every point
445
+ of every streamline, and its associated value is a generator function
446
+ yielding that information via ndarrays of shape ($N_t$, $M_i$) where
447
+ $N_t$ is the number of points for a particular streamline $t$ and $M_i$
448
+ is the number of values to store for that particular piece of
449
+ information $i$.
450
450
451
451
Notes
452
452
-----
@@ -599,7 +599,6 @@ def _apply_affine():
599
599
def _set_streamlines (self , value ):
600
600
if value is not None and not callable (value ):
601
601
raise TypeError ("`streamlines` must be a generator function." )
602
-
603
602
self ._streamlines = value
604
603
605
604
@property
0 commit comments