Kurtosis Tensor Rotation

Hi, I am doing single-voxel simulations and I want to apply tensor rotation to the following theoretical tensor: DT[0][0] = 0.1783e-3; DT[0][1] = 0.0011e-3; DT[0][2] = 0.0125e-3; DT[1][0] = 0.0011e-3, DT[1][1] = 0.1459e-3; DT[1][2] = 0.0034e-3; DT[2][0] = 0.0125e-3; DT[2][1] = 0.0034e-3; DT[2][2] = 0.4028e-3 kt[0] = 0.5698; kt[1] = 0.3208; kt[2] = 2.6049; kt[3] = -0.1142; kt[4] = -1.1531, kt[5] = 0.3944; kt[6] = -0.5409; kt[7] = 0.7220; kt[8] = 0.777; kt[9] = 0.2865; kt[10] = 0.4700; kt[11] = 0.2065; kt[12] = -0.0005; kt[13] = 0.1655; kt[14] = -0.4157 This is how I am generating rotation directions: # Simulate tensor rotations: theta = np.pi * np.random.rand(nDTdirs) phi = 2 * np.pi * np.random.rand(nDTdirs) hsph_initial = HemiSphere(theta=theta, phi=phi) hsph_updated, potential = disperse_charges(hsph_initial, 5000) DTdirs = hsph_updated.vertices This is how I am applying tensor rotation: for d_i in tqdm(np.arange(nDTdirs)): time.sleep(0.3) # for current simulated tensor direction angles = DTdirs[d_i] sticks = _check_directions(angles) R = all_tensor_evecs(sticks) DT = np.dot(np.dot(R, DT), R.T) eigvals, eigvects = decompose_tensor(DT) dt_rot = np.array([DT[0][0], DT[0][1], DT[1][1], DT[0][2], DT[1][2], DT[2][2]]) kt_rot = Wrotate(kt, R) I think DT tensor rotation is working well because my estimations are converging to the correct ground truth. However, DKI estimates are not converging, which makes me wonder if the *Wrotate* function is well applied. Thank you for your attention! Ana

Hi Ana, Sorry for the late reply on this. I did not detect any issue with the Wrotate function; however, I've noticed that the variable R is not in the right format - it has to be column-wise oriented as mention on the function documentation. Thus, I think the solution to your problem is just transposing R, i.e: kt_rot = Wrotate(kt, R.T) Also - I've noticed that you are updating the variable DT in each loop of your for loop and not variable kt. To insure that rotations are the same for both diffusion and kurtosis tensors, I recommend to rename your initial diffusion tensor (e.g. DT0). After doing this, please correct line 6 of your for loop by: DT = np.dot(np.dot(R, DT0), R.T) Please let me know if this solves your issue! Best, Rafael Ana Fouto via DIPY <dipy@python.org> escreveu no dia segunda, 14/03/2022 à(s) 19:31:

Hi Rafael, That was it! The problem is solved! Many thanks for your help! Have a nice week! ---------------------------------------------------- Ana Fouto Biomedical Engineering PhD Student Instituto Superior Técnico | Lisbon, Portugal LaSEEB (www.laseeb.org/) Tel: + (351) 937 453 205 Email: anafouto@tecnico.ulisboa.pt ---------------------------------------------------- On Wed, 16 Mar 2022 at 18:42, Rafael Henriques <rafaelnh21@gmail.com> wrote:

Hi Ana, Sorry for the late reply on this. I did not detect any issue with the Wrotate function; however, I've noticed that the variable R is not in the right format - it has to be column-wise oriented as mention on the function documentation. Thus, I think the solution to your problem is just transposing R, i.e: kt_rot = Wrotate(kt, R.T) Also - I've noticed that you are updating the variable DT in each loop of your for loop and not variable kt. To insure that rotations are the same for both diffusion and kurtosis tensors, I recommend to rename your initial diffusion tensor (e.g. DT0). After doing this, please correct line 6 of your for loop by: DT = np.dot(np.dot(R, DT0), R.T) Please let me know if this solves your issue! Best, Rafael Ana Fouto via DIPY <dipy@python.org> escreveu no dia segunda, 14/03/2022 à(s) 19:31:

Hi Rafael, That was it! The problem is solved! Many thanks for your help! Have a nice week! ---------------------------------------------------- Ana Fouto Biomedical Engineering PhD Student Instituto Superior Técnico | Lisbon, Portugal LaSEEB (www.laseeb.org/) Tel: + (351) 937 453 205 Email: anafouto@tecnico.ulisboa.pt ---------------------------------------------------- On Wed, 16 Mar 2022 at 18:42, Rafael Henriques <rafaelnh21@gmail.com> wrote:
participants (2)
-
Ana Fouto
-
Rafael Henriques