function [Matriz_Q, Matriz_Error_Length, Axon_Real_Length, Estimated_Axon_Length, Filas_Centros, Columnas_Centros, Z_Centros] = PRUEBA_II_Sgript_Estim_Long_Axon_Estereo_PLANOS ( AXON_Cell, AXON, Distancias_entre_Planos, Step_Lengths, Grosor_Corte, h_Cortes, lado_x_Frame, lado_y_Frame, sampling_box_height, AZIM, ELEV, ONSET ) % INPUT % h_Cortes = 1; % Analizamos un corte cada 'h_Cortes' cortes de la muestra % % El 'frame' es la sampling box en la que se introduce la esfera; esa caja luego se introduce en la celda de la rejilla en que se ha dividido el corte. % lado_x_Frame = 25; % en micras % lado_y_Frame = 25; % en micras % sampling_box_height = 25; % en micras % Longitud total del axón branch_length = zeros( 1, length(AXON_Cell) ); aa= 0; for i = 1:length(AXON_Cell) dummy = AXON_Cell{1, i}; diff_dummy = diff( dummy, 1, 1 ); branch_length( i ) = sum( sqrt( sum( diff_dummy(:, 1:3).^2, 2 ) ) ); aa = aa + length(dummy); end Axon_Real_Length = sum( branch_length ); % Generamos cortes de en el plano xy CORTES_XY_AXON = cell( 1, length( Step_Lengths ) ); FILAS_REJILLA = cell( 1, length( Step_Lengths ) ); COLUMNAS_REJILLA = cell( 1, length( Step_Lengths ) ); CORTES = cell( 1, length( Step_Lengths ) ); for e = 1:length( Step_Lengths ) % [Cortes_XY_Axon, Filas_Rejilla, Columnas_Rejilla, Cortes] = Script_Corte_y_Rejilla_del_Axon ( AXON, AXON_Cell, Grosor_Corte, Step_Lengths( e ), Step_Lengths( e ) ); [Cortes_XY_Axon, Filas_Rejilla, Columnas_Rejilla, Cortes] = Script_Corte_y_Rejilla_del_Axon_2 ( AXON, AXON_Cell, Grosor_Corte, Step_Lengths( e ), Step_Lengths( e ) ); CORTES_XY_AXON{1, e} = Cortes_XY_Axon; FILAS_REJILLA{1, e} = Filas_Rejilla; COLUMNAS_REJILLA{1, e}= Columnas_Rejilla; CORTES{1, e} = Cortes; disp([num2str(e), ' muestra preparada de ', num2str(length( Step_Lengths ))]); end Matriz_Q = zeros(length( Step_Lengths ), length( Distancias_entre_Planos )); % Filas para los step_lengths y columnas para los diámetros de la sonda Matriz_Error_Length = zeros(length( Step_Lengths ), length( Distancias_entre_Planos )); % Filas para los step_lengths y columnas para lso diámetros de la sonda % Obtenemos las intersecciones de la esfera para estimar la longitud total: for e = 1:length( Step_Lengths ) for d = 1:length( Distancias_entre_Planos ) % Recorremos los diámteros de la sonda esférica: % [Q, ~, Error_Length] = Script_Analisis_Esferas_Neuronas_1 ( CORTES_XY_AXON{1, e}, h_Cortes, Diams_Sonda( d )/2, COLUMNAS_REJILLA{1, e}, Step_Lengths( e ), FILAS_REJILLA{1, e}, Step_Lengths( e ), CORTES{1, e}, Grosor_Corte, lado_x_Frame, lado_y_Frame, sampling_box_height, Axon_Real_Length ); [Q, ~, Error_Length, Estimated_Axon_Length, Filas_Centros, Columnas_Centros, Z_Centros] = PRUEBA_II_Script_Analisis_PLANOS_Neuronas_1 ( CORTES_XY_AXON{1, e}, h_Cortes, COLUMNAS_REJILLA{1, e}, Step_Lengths( e ), FILAS_REJILLA{1, e}, Step_Lengths( e ), CORTES{1, e}, Grosor_Corte, lado_x_Frame, lado_y_Frame, sampling_box_height, Axon_Real_Length, Distancias_entre_Planos( d ), AZIM, ELEV, ONSET ); Matriz_Q( e, d ) = Q; Matriz_Error_Length( e, d ) = Error_Length; disp([e, d]); end end