Tract lengths

  • tckstats example-1-standard.tck: We expect this to be erroneously close to example-1.tck, since the non-linear transformations of all but the start and endpoints of each streamline are not being properly taken into account.

  • tckstats example-1-standard.tck -explicit: This is actually the result that looks erroneous to me, not the resampling. The mean / min / max are all decreased, and the standard deviation is very much decreased. So I think this is where the main error is (see below)

  • tckstats example-1-standard-resampled.tck: I expect these to be close-but-not-identical to tckstats example-1.tck, since the streamlines have in fact been non-linearly transformed, but no humongous differences are expected. This is I think what we see in the raw numbers.

  • tckstats example-1-standard-resampled.tck -explicit: This is expected to be almost identical to tckstats example-1-standard-resampled.tck, within floating-point precision. The difference is a little greater than that, which I think I now know why (see below).

So, the issue with both points 2 and 4 is that when I introduced the -explicit option in tckstats, I achieved it by calling a pre-existing function for calculating the length of a streamline when the step size is not known. However back when that function was written it was based on the premise that the step size of the streamline is unknown, but is nevertheless constant (for all but the first and last segment of each streamline). This means that if the distance between streamline vertices is not consistent along its entire length, the streamline length calculation using this function is going to be erroneous (specifically, it gets the distance between the two most central points on the streamline, and then assumes that that distance is accurate for all other non-endpoint segments; for a nonlinearly-warped streamline this will not be the case).

Unfortunately this is a major stuff-up on my part, and is definitely going to require re-checking your results (the lengths following resampling should be trustworthy). With trying to keep up with demand I don’t get to test everything as thoroughly as would be ideal; heck I only get to answer forum questions on Sundays. I’ll also push a fix to the master branch so hopefully nobody else will get caught out.

Pleading for forgiveness :pray:
Rob