Skip to content

Commit

Permalink
Modify doc for to_center()
Browse files Browse the repository at this point in the history
  • Loading branch information
frheault committed Dec 12, 2024
1 parent 9892ac4 commit 3918ffb
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions scilpy/connectivity/connectivity.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def compute_triu_connectivity_from_labels(tractogram, data_labels,
tractogram: StatefulTractogram, or list[np.ndarray]
Streamlines. A StatefulTractogram input is recommanded.
When using directly with a list of streamlines, streamlines must be in
vox space, corner origin.
vox space, center origin.
data_labels: np.ndarray
The loaded nifti image.
keep_background: Bool
Expand All @@ -59,9 +59,7 @@ def compute_triu_connectivity_from_labels(tractogram, data_labels,
For each streamline, the label at ending point.
"""
if isinstance(tractogram, StatefulTractogram):
# Vox space, corner origin
# = we can get the nearest neighbor easily.
# Coord 0 = voxel 0. Coord 0.9 = voxel 0. Coord 1 = voxel 1.
# vox space, center origin: compatible with map_coordinates
sfs_2_pts = resample_streamlines_num_points(tractogram, 2)
sfs_2_pts.to_vox()
sfs_2_pts.to_center()
Expand All @@ -78,8 +76,7 @@ def compute_triu_connectivity_from_labels(tractogram, data_labels,

matrix = np.zeros((nb_labels, nb_labels), dtype=int)

labels = map_coordinates(data_labels, streamlines._data.T,
order=0, mode='nearest')
labels = map_coordinates(data_labels, streamlines._data.T, order=0)
start_labels = labels[0::2]
end_labels = labels[1::2]

Expand Down

0 comments on commit 3918ffb

Please sign in to comment.