Is there a way in Slicer to calculate the mean DTI distortion (e.g. as mean transform needed to align DTI to T2w, like the root mean square deviation).
"We also calculated the root mean square (RMS) deviation for each subject, which combines the six rigid body parameters into a single estimator of mean displacement [Jenkinson, 1999; Reuter et al., 2015]:
RMS = sqrt{r∗r ∕ 5 + tr[(M−I)T(M − I)] + tTt},
where t is the translation vector, M is (here) the 3×3 rotation matrix, I is the identity matrix, tr[] is the trace operator, and r is the approximate spherical radius of the brain (here, estimated from the data to be 65 mm). The rigid body parameters and RMS values of the navigator logs were also examined."
I have a slicer transform file (.h5) for each of my subjects and wonder if there is a way to calculate the RMS (or a similar measure) from them.
This script works in recent Slicer Preview Releases. If you need to use latest Slicer Stable Release (4.10.2) then you can copy the slicer.util.arrayFromTransformMatrix method from here.