diff --git a/nibabel/streamlines/tck.py b/nibabel/streamlines/tck.py index ad2818d380..3b50949005 100644 --- a/nibabel/streamlines/tck.py +++ b/nibabel/streamlines/tck.py @@ -220,9 +220,8 @@ def save(self, fileobj): tractogram = self.tractogram.to_world(lazy=True) for t in tractogram: - s = t.streamline.astype(dtype) - data = np.r_[s, self.FIBER_DELIMITER] - f.write(data.tostring()) + data = np.r_[t.streamline, self.FIBER_DELIMITER] + f.write(data.astype(dtype).tostring()) nb_streamlines += 1 header[Field.NB_STREAMLINES] = nb_streamlines