Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,7 @@ def main():
# Get the indices of the voxels traversed by each streamline
logging.info('*** Computing voxels traversed by each streamline ***')
time1 = time.time()
sft.streamlines._data = sft.streamlines._data.astype(np.float32)
indices, points_to_idx = streamlines_to_voxel_coordinates(
sft.streamlines,
return_mapping=True
Expand Down
3 changes: 3 additions & 0 deletions src/scilpy/tractograms/streamline_and_mask_operations.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ def get_head_tail_density_maps(sft, point_to_select=1, to_millimeters=False,

dimensions = sft.dimensions
# Get the indices of the voxels intersected
streamlines._data = streamlines._data.astype(np.float32)
list_indices, points_to_indices = streamlines_to_voxel_coordinates(
streamlines, return_mapping=True)

Expand Down Expand Up @@ -328,6 +329,7 @@ def cut_streamlines_with_mask(sft, mask,

# Get the indices of the voxels
# intersected by the streamlines and the mapping from points to indices
sft.streamlines._data = sft.streamlines._data.astype(np.float32)
indices, points_to_idx = streamlines_to_voxel_coordinates(
sft.streamlines,
return_mapping=True
Expand Down Expand Up @@ -429,6 +431,7 @@ def cut_streamlines_between_labels(
mask = label_data_2 != unique_vals[1]
label_data_2[mask] = 0

sft.streamlines._data = sft.streamlines._data.astype(np.float32)
(indices, points_to_idx) = streamlines_to_voxel_coordinates(
sft.streamlines,
return_mapping=True
Expand Down