Isotropia_Proyeccion.m 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. function [Entropy_1D, THETA, Prob_Angles, THETA_Edges] = Isotropia_Proyeccion( AXON_Cell, h_Theta )
  2. % Isotropía de los ángulos en la proyección del axón
  3. % h_Theta = 20;
  4. THETA_Edges = [-180:h_Theta:180];
  5. % ---------------- Plano Proyección XY --------------------
  6. THETA.XY = [];
  7. for i = 1:length(AXON_Cell) % Recorremos las ramas del axón
  8. dummy = diff( AXON_Cell{1, i}(:, 1:3),1, 1 );
  9. theta = cart2pol( dummy(:, 1), dummy(:, 2) );
  10. Angles = rad2deg( theta );
  11. THETA.XY = [THETA.XY; Angles];
  12. end
  13. Prob_Angles.XY = histcounts( THETA.XY, THETA_Edges,'Normalization','probability' );
  14. % Calculamos la entropía del ángulo de las ramas en la proyección del axón
  15. Pr_An.XY = Prob_Angles.XY(:);
  16. Pr_An.XY( Pr_An.XY == 0 ) = []; % Eliminamos los valores iguales a 0
  17. Entropy_1D.XY = -sum( Pr_An.XY.*log( Pr_An.XY ) );
  18. % ---------------- Plano Proyección XZ ----------------
  19. THETA.XZ = [];
  20. for i = 1:length(AXON_Cell) % Recorremos las ramas del axón
  21. dummy = diff( AXON_Cell{1, i}(:, 1:3),1, 1 );
  22. theta = cart2pol( dummy(:, 1), dummy(:, 3) );
  23. Angles = rad2deg( theta );
  24. THETA.XZ = [THETA.XZ; Angles];
  25. end
  26. Prob_Angles.XZ = histcounts( THETA.XZ, THETA_Edges,'Normalization','probability' );
  27. % Calculamos la entropía del ángulo de las ramas en la proyección del axón
  28. Pr_An.XZ = Prob_Angles.XZ(:);
  29. Pr_An.XZ( Pr_An.XZ == 0 ) = []; % Eliminamos los valores iguales a 0
  30. Entropy_1D.XZ = -sum( Pr_An.XZ.*log( Pr_An.XZ ) );
  31. % ---------------- Plano Proyección YZ ----------------
  32. THETA.YZ = [];
  33. for i = 1:length(AXON_Cell) % Recorremos las ramas del axón
  34. dummy = diff( AXON_Cell{1, i}(:, 1:3),1, 1 );
  35. theta = cart2pol( dummy(:, 2), dummy(:, 3) );
  36. Angles = rad2deg( theta );
  37. THETA.YZ = [THETA.YZ; Angles];
  38. end
  39. Prob_Angles.YZ = histcounts( THETA.YZ, THETA_Edges,'Normalization','probability' );
  40. % Calculamos la entropía del ángulo de las ramas en la proyección del axón
  41. Pr_An.YZ = Prob_Angles.YZ(:);
  42. Pr_An.YZ( Pr_An.YZ == 0 ) = []; % Eliminamos los valores iguales a 0
  43. Entropy_1D.YZ = -sum( Pr_An.YZ.*log( Pr_An.YZ ) );