# maximum pairwise displacement

Hi AFNI experts,
I am not quite sure how the “maximum pairwise displacement” is calculated in “1d_tool.py”, please see if my understanding is correct. Suppose we have only 3 time points and the 6 head motion parameters at each time points are (a1, b1, c1, d1, e1, f1), (a2, b2, c2, d2, e2, f2), (a3, b3, c3, d3, e3, f3). So the “maximum pairwise displacement” is calculated as this:

max( abs(a1-a2), abs(a1-a3), abs(a2-a3), abs(b1-b2), abs(b1-b3), abs(b2-b3), …, abs(f1-f2), abs(f1-f3), abs(f2-f3) )

Am I correct? Thank you so much!

That is not quite correct. Distances are taken to be
Euclidean (sqrt of sum of squared differences).

The maximum pairwise displacement from 1d_tool.py is
computed as follows. Let the distance between any two
time points be the Euclidean distance of the motion
parameters in 6 dimensions (sqrt(sum squares of 6 diffs)).

The help shows how to understand this in 1 dimension
just as a simple example (where Euclidean dist is the
same as abs(diff)). But that does not extend to the
6 dimensional space.