PRELIMINAR_Isotropia_Neuronas.m 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  1. clear all;
  2. %
  3. clc
  4. % Leemos el archivo de Matlab conteniendo las neuronas
  5. Num_File = 6;
  6. load(['Neurona_Matlab_', num2str(Num_File), '.mat']);
  7. % Ploteamos
  8. clc
  9. colores = {'r', 'b', 'm', 'k', 'g'};
  10. % figure;
  11. % hold on;
  12. % for i = 1:length(AXON_Cell)
  13. %
  14. % Puntos_Axon = AXON_Cell{1, i};
  15. % plot3( Puntos_Axon(:, 1), Puntos_Axon(:, 2), Puntos_Axon(:, 3), '-k', 'linewidth', 1.5 );
  16. % xlabel('X');
  17. % ylabel('Y');
  18. % zlabel('Z');
  19. % % zlim([150 200]);
  20. % % view([-96, -90]);
  21. % % axis equal
  22. % end
  23. % %% Calculamos los alpha óptimos para estimar la long total del axón de la long de la proyección en los tres planos
  24. clc
  25. % ---------------- Plano Proyección XY --------------------
  26. [alpha_Opt.XY, Axon_Length, Axon_Length_Proyecc.XY] = Estim_Long_Axon_Proyeccion( AXON_Cell, 1, 2 );
  27. % ---------------- Plano Proyección XZ --------------------
  28. [alpha_Opt.XZ, Axon_Length, Axon_Length_Proyecc.XZ] = Estim_Long_Axon_Proyeccion( AXON_Cell, 1, 3 );
  29. % ---------------- Plano Proyección YZ --------------------
  30. [alpha_Opt.YZ, Axon_Length, Axon_Length_Proyecc.YZ] = Estim_Long_Axon_Proyeccion( AXON_Cell, 2, 3 );
  31. % %% Isotropía de los ángulos esféricos
  32. h_Azim = 20;
  33. h_Elev = 10;
  34. [Entropy2D, AZIM, ELEV, Prob_Angles_2D, AZIM_Edges, ELEV_Edges] = Isotropia_Angulos_Esfericos( AXON_Cell, h_Azim, h_Elev );
  35. % %% Isotropía de los ángulos en la proyección del axón
  36. h_Theta = 20;
  37. [Entropy_1D, THETA, Prob_Angles_1D, THETA_Edges] = Isotropia_Proyeccion( AXON_Cell, h_Theta );
  38. % % %%
  39. % clc
  40. %
  41. % figure;
  42. % bar(THETA_Edges(1:end-1), Prob_Angles_1D.XY);
  43. % xlabel('Theta', 'fontsize', 15);
  44. % title( ['Neuron ', num2str(Num_File), '. Entropy XY = ', num2str(Entropy_1D.XY)], 'fontsize', 15 );
  45. % %% Ploteamos el histograma
  46. AZIM_Centers = AZIM_Edges(1:end-1) + diff(AZIM_Edges)/2;
  47. ELEV_Centers = ELEV_Edges(1:end-1) + diff(ELEV_Edges)/2;
  48. [AA, EE] = meshgrid(AZIM_Centers, ELEV_Centers);
  49. figure('color', 'w');
  50. surf(AA, EE, Prob_Angles_2D');
  51. xlim([-170, 170]);
  52. ylim([-80, 80]);
  53. view([0, 90])
  54. axis square
  55. xlabel('Azimuth (deg)', 'fontsize', 18);
  56. ylabel('Elevation (deg)', 'fontsize', 18);
  57. title(['Entropy = ', num2str(Entropy2D)], 'fontsize', 16);
  58. % colorbar
  59. %%
  60. figure;
  61. bar(AZIM_Centers, sum(Prob_Angles_1D.XY, 1));
  62. xlabel('Theta', 'fontsize', 15);
  63. title( ['Neuron ', num2str(Num_File), '. Entropy XY = ', num2str(Entropy_1D.XY)], 'fontsize', 15 );
  64. %% Alpha vs. Entropía de los ángulos esféricos
  65. Ent = [4.786 5.328 4.633 4.545];
  66. Alp = [1.14 1.26 1.15 1.03];
  67. figure;
  68. plot(Ent, Alp, 'o', 'markerfacecolor', 'b', 'markersize', 10);
  69. xlabel('Entropy 2D', 'fontsize', 16);
  70. ylabel('Alpha', 'fontsize', 16);
  71. %% %%%%%%%%%%
  72. %%
  73. % Entropy_3 = Entropy_1D;
  74. % alpha_Opt_3 = alpha_Opt;
  75. % Entropy_4 = Entropy_1D;
  76. % alpha_Opt_4 = alpha_Opt;
  77. % Entropy_5 = Entropy_1D;
  78. % alpha_Opt_5 = alpha_Opt;
  79. Entropy_6 = Entropy_1D;
  80. alpha_Opt_6 = alpha_Opt;
  81. %% Ploteamos
  82. Ent_XY = [Entropy_3.XY, Entropy_4.XY, Entropy_5.XY, Entropy_6.XY];
  83. Ent_XZ = [Entropy_3.XZ, Entropy_4.XZ, Entropy_5.XZ, Entropy_6.XZ];
  84. Ent_YZ = [Entropy_3.YZ, Entropy_4.YZ, Entropy_5.YZ, Entropy_6.YZ];
  85. Alp_XY = [alpha_Opt_3.XY, alpha_Opt_4.XY, alpha_Opt_5.XY, alpha_Opt_6.XY];
  86. Alp_XZ = [alpha_Opt_3.XZ, alpha_Opt_4.XZ, alpha_Opt_5.XZ, alpha_Opt_6.XZ];
  87. Alp_YZ = [alpha_Opt_3.YZ, alpha_Opt_4.YZ, alpha_Opt_5.YZ, alpha_Opt_6.YZ];
  88. figure;
  89. hold on;
  90. plot(Ent_XY, Alp_XY, 'o', 'markerfacecolor', 'b', 'markersize', 10);
  91. plot(Ent_XZ, Alp_XZ, 'o', 'markerfacecolor', 'r', 'markersize', 10);
  92. plot(Ent_YZ, Alp_YZ, 'o', 'markerfacecolor', 'k', 'markersize', 10);
  93. xlabel('Entropy 1D', 'fontsize', 16);
  94. ylabel('Alpha', 'fontsize', 16);
  95. legend('XY', 'XZ', 'YZ');