diff --git a/src/scilpy/cli/scil_tractogram_segment_connections_from_labels.py b/src/scilpy/cli/scil_tractogram_segment_connections_from_labels.py index 102519f78..ff9e690e0 100755 --- a/src/scilpy/cli/scil_tractogram_segment_connections_from_labels.py +++ b/src/scilpy/cli/scil_tractogram_segment_connections_from_labels.py @@ -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 diff --git a/src/scilpy/tractograms/streamline_and_mask_operations.py b/src/scilpy/tractograms/streamline_and_mask_operations.py index faa0fcce5..93192fcab 100644 --- a/src/scilpy/tractograms/streamline_and_mask_operations.py +++ b/src/scilpy/tractograms/streamline_and_mask_operations.py @@ -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) @@ -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 @@ -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