Code covered by the BSD License  

Highlights from
Lognormal Perfusion Model

image thumbnail

Lognormal Perfusion Model

by

 

13 Mar 2013 (Updated )

Fit disruption replenishment time-intensity data with the lognormal perfusion model

logperf_fit(signal_dat,t_dat,HW,guess,iterations,Fast);
% *****************************************************************
%
% The Lognormal Perfusion Model
%
% JM Hudson
% March 2013
%
% Reference as:
% Hudson et al. Quantification of flow using ultrasound and microbubbles: 
% a disruption replenishment model based on physical principles. 
% Ultrasound in Medicine & Biology (2009) vol. 35 (12) pp. 2007-20
% 
% or
% 
% Hudson et al. The Lognormal Perfusion Model for Disruption Replenishment 
% Measurements of Blood Flow: In Vivo Validation. 
% Ultrasound in Medicine & Biology (2011) vol. 37 (10) pp. 1571-1578
%
% Given a time-series of disruption replenishment data, this function
% calculates the parameters of the lognormal perfusion model including:
% A = Vascular cross sectional area
% MV = Mean flow speed
% mu = lognormal mean of the flow speed distribution
% sigma = standard deviation of the flow speed distribution
% *****************************************************************
%

function [A,MV,mu,sig,Delay,resnorm,residual] = logperf_fit(signal_dat,t_dat,HW,guess,iterations,Fast);
warning off


	A_guess   = guess(1);
	mu_guess  = guess(2);
	sig_guess = guess(3);
	D_guess   = guess(4);
    t_dat(1) = 0.001;
    % This part estimates an 'A' value with a fixed (assumed known) D
    options = optimset('Display','off'); 
	[coeffs,resnorm,residual]=lsqcurvefit(@logmodel_call_A,[A_guess mu_guess sig_guess],t_dat,signal_dat,[0.1 -2 0.4],[1000 2 1.2],options);  
    %Working for KAthleen [0.1 0.2 0],[10000 10 3]


    % This part takes the 'A' from the above and now fits with 'D' as an
    % unknown
	clear data
	A = coeffs(1);
    mu_guess 	= coeffs(2);
	sig_guess 	= coeffs(3);
	D_guess 	= guess(4);
    
    clear coeffs;

	[coeffs,resnorm,residual]=lsqcurvefit(@logmodel_call_D,[mu_guess sig_guess D_guess],t_dat,signal_dat,[-3 0.4 -5],[3 2 2],options);

	A     = A;
  	mu    = coeffs(1);
   	sig   = coeffs(2);
  	Delay = coeffs(3);




    % **************************************
    % This next part repeats the process by iteration if better fitting is
    % desired - this does not often make a difference

        if iterations >= 2
            D_guess = Delay;
            for i = 1:(iterations-1)
                [coeffs,resnorm,residual]=lsqcurvefit(@logmodel_call_A,[A mu sig],t_dat,signal_dat,[0 0.00  0.0],[100000 10 2],options); %[0 0.00  0.0],[100000 10 2]
                clear data
                A = coeffs(1);
                mu = coeffs(2);
                sig = coeffs(3);
                [coeffs,resnorm,residual]=lsqcurvefit(@logmodel_call_D,[mu sig Delay],t_dat,signal_dat,[0.00 0 -10],[5 5 0.5],options); %[0.00 0 -10],[5 5 0.5]
                A     = A; 
                mu    = coeffs(1);
                sig   = coeffs(2);
                Delay = coeffs(3);         
            end
        end

MV = exp((2.*mu + sig.^2)/2);    

    function F=logmodel_call_A(coeff,t_dat)
        F = logperf_model(coeff(1),coeff(2),coeff(3),HW,D_guess,t_dat,Fast)';
    end
    
    function F=logmodel_call_D(coeff,t_dat)
        F = logperf_model(A,coeff(1),coeff(2),HW,coeff(3),t_dat,Fast)';
    end
    
end
    



Contact us