-
Notifications
You must be signed in to change notification settings - Fork 197
Streamline length calculation #1501
Description
Related to #1185 & marginally to #1153, raised on the forum.
Calculation of streamline lengths was originally based on the product of (number_of_points - 1) and the step size. Since the introduction of downsampling & GM-WM interface cropping in tckgen, which can result in the final step at either end of the streamline being shorter than the step size, any calculations of step size now use the product only for the central section of the streamline, and explicitly calculate the lengths of the first and last segments.
This obviously assumes a constant step size within the central segment, which could be invalidated in a range of scenarios, e.g. various modes of tckresample, tcknormalise, track data from external softwares.
I'm wondering if the computational speed benefit of using the product of the step size is not really worth the hassle, and it would be better to instead just explicitly calculate the distance between streamline vertices in all instances where a streamline length is required. This would remove the need for the -explicit option in tckstats, and make the behaviour as expected in all commands regardless of the nature of the data.