How to obtain the true fiber length

Hi, Dear MRtrix3.

     Recently I want to filter the U fibers by their shape and length. I need to obtain the true fiber length of each streamline. However, I am not sure whether I'm right. My post-process is shown below. 

Using ‘read_mrtrix_track.m’ to read the ‘U_fibers.tck’ and get the structure format and the data cell array 191022 cell. 91022 means the fiber streamline counts. Each element of the cell array contains the coordinates info such as the 993 matrix in the first streamline. I find the 993 coordinates contain both negative values and positive values, that is in the RAS coordinate system. Then I read the dwi b0 image coordinate by spm, find the 44 affine matrix. Then I use the formula : IJK_coordinate = inv(44 affine_matrix) * [each 993 U fiber RAS coordinate; ones(991)]’; And I can obtain the correct the IJK coordinate. Then I calculate the Euclidean distance between each neighboured 993 IJK coordinate and add them together to obtain the fiber length. Whether I need to consider the dwi resolution (112)?