Skip to content

Commit a8af94c

Browse files
committed
DOC: add docstring for function giving affine
Add docstring for function giving RAS+ affine from trackvis header.
1 parent 84dd196 commit a8af94c

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

nibabel/streamlines/trk.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,24 @@
8888

8989

9090
def get_affine_trackvis_to_rasmm(header):
91+
""" Get affine mapping trackvis voxelmm space to RAS+ mm space
92+
93+
The streamlines in a trackvis file are in 'voxelmm' space, where the
94+
coordinates refer to the corner of the voxel.
95+
96+
Compute the # affine matrix that will bring them back to RAS+ mm space,
97+
where the coordinates refer to the center of the voxel.
98+
99+
Parameters
100+
----------
101+
header : dict
102+
Dict containing trackvis header.
103+
104+
Returns
105+
-------
106+
aff_tv2ras : shape (4, 4) array
107+
Affine array mapping coordinates in 'voxelmm' space to RAS+ mm space.
108+
"""
91109
# TRK's streamlines are in 'voxelmm' space, we will compute the
92110
# affine matrix that will bring them back to RAS+ and mm space.
93111
affine = np.eye(4)

0 commit comments

Comments
 (0)