123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263 |
- function [Entropy_1D, THETA, Prob_Angles, THETA_Edges] = Isotropia_Proyeccion( AXON_Cell, h_Theta )
- % Isotropía de los ángulos en la proyección del axón
- % h_Theta = 20;
- THETA_Edges = [-180:h_Theta:180];
- % ---------------- Plano Proyección XY --------------------
- THETA.XY = [];
- for i = 1:length(AXON_Cell) % Recorremos las ramas del axón
-
- dummy = diff( AXON_Cell{1, i}(:, 1:3),1, 1 );
- theta = cart2pol( dummy(:, 1), dummy(:, 2) );
- Angles = rad2deg( theta );
- THETA.XY = [THETA.XY; Angles];
-
- end
- Prob_Angles.XY = histcounts( THETA.XY, THETA_Edges,'Normalization','probability' );
- % Calculamos la entropía del ángulo de las ramas en la proyección del axón
- Pr_An.XY = Prob_Angles.XY(:);
- Pr_An.XY( Pr_An.XY == 0 ) = []; % Eliminamos los valores iguales a 0
- Entropy_1D.XY = -sum( Pr_An.XY.*log( Pr_An.XY ) );
- % ---------------- Plano Proyección XZ ----------------
- THETA.XZ = [];
- for i = 1:length(AXON_Cell) % Recorremos las ramas del axón
-
- dummy = diff( AXON_Cell{1, i}(:, 1:3),1, 1 );
- theta = cart2pol( dummy(:, 1), dummy(:, 3) );
- Angles = rad2deg( theta );
- THETA.XZ = [THETA.XZ; Angles];
-
- end
- Prob_Angles.XZ = histcounts( THETA.XZ, THETA_Edges,'Normalization','probability' );
- % Calculamos la entropía del ángulo de las ramas en la proyección del axón
- Pr_An.XZ = Prob_Angles.XZ(:);
- Pr_An.XZ( Pr_An.XZ == 0 ) = []; % Eliminamos los valores iguales a 0
- Entropy_1D.XZ = -sum( Pr_An.XZ.*log( Pr_An.XZ ) );
- % ---------------- Plano Proyección YZ ----------------
- THETA.YZ = [];
- for i = 1:length(AXON_Cell) % Recorremos las ramas del axón
-
- dummy = diff( AXON_Cell{1, i}(:, 1:3),1, 1 );
- theta = cart2pol( dummy(:, 2), dummy(:, 3) );
- Angles = rad2deg( theta );
- THETA.YZ = [THETA.YZ; Angles];
-
- end
- Prob_Angles.YZ = histcounts( THETA.YZ, THETA_Edges,'Normalization','probability' );
- % Calculamos la entropía del ángulo de las ramas en la proyección del axón
- Pr_An.YZ = Prob_Angles.YZ(:);
- Pr_An.YZ( Pr_An.YZ == 0 ) = []; % Eliminamos los valores iguales a 0
- Entropy_1D.YZ = -sum( Pr_An.YZ.*log( Pr_An.YZ ) );
|