Deconvolution, Time-Correlated Single Photon Counting
fay.tor
I have two decays, one is the fluorescence an the other one respresent the response of the system. I would like to know if ther is a function that allows me to to deconvolve the two signals ?
If your data take the form of a sum of two exponential decays, you could fit it with the built-in dblexp_XOffset or dblexp fit function. This will work if the decays have sufficiently different time constants.
John Weeks
WaveMetrics, Inc.
support@wavemetrics.com
January 16, 2013 at 09:11 am - Permalink
January 16, 2013 at 09:26 am - Permalink
January 16, 2013 at 12:13 pm - Permalink
Of course, you have to be careful to account for the differences between the IRF and data waves (different baseline offset, different peak amplitudes, a possible shift between start time of the signal if the IRF wasn't measured carefully)
January 16, 2013 at 02:33 pm - Permalink
I'm using the version 6.12A of Igor, and I do not want to update (I'm not expert Igor). It seems that the program pFLIM can do it. The procedure pFLIM compile is OK, but I can not make it work! What I want is a simple procedure where I give my fluorescence signal and my IRF, I can calculate the real decay then I can make Fit...
January 18, 2013 at 01:04 am - Permalink
That sounds like you don't want to update *because* you are not an expert. I would say that, since the latest versions contain many bug fixes, that a non-expert really *should* upgrade. It's free, and not at all difficult. Pull down the Help menu and select (at the bottom of the menu) Updates for Igor Pro 6.12. That will launch a browser to a page with download information.
John Weeks
WaveMetrics, Inc.
support@wavemetrics.com
January 18, 2013 at 09:02 am - Permalink
But that is not why I do not want to do the update. I have a procedure that works in this version and when I do the updates it does not work (several errors) and as I am not an expert I can not change these procedures ...;)
January 18, 2013 at 10:01 am - Permalink
John Weeks
WaveMetrics, Inc.
support@wavemetrics.com
January 18, 2013 at 02:45 pm - Permalink
As I predicted. I've just updated and errors in my previous procedure beginning! I do not know how many there are but I start it the:
TO nvar = root: WinGlobals: $ (strProfil): TZ
I do not understand (I've already said that I'm not an expert ). Can you please tell me what is this error and how to fix it ? I hope that is the only error coz my procedure file is too long...
January 21, 2013 at 05:05 am - Permalink
You need to remove the spaces from the path. Make it "root:WinGlobals:$(strProfil):TZ". This is a perfect example of a syntax that a bug allowed to work, but which should be an error.
John Weeks
WaveMetrics, Inc.
support@wavemetrics.com
January 21, 2013 at 09:22 am - Permalink
January 21, 2013 at 09:34 am - Permalink
And as I demonstrated at the beginning of the thread, I'm not much help with that :)
John Weeks
WaveMetrics, Inc.
support@wavemetrics.com
January 22, 2013 at 08:50 am - Permalink
The two approaches are ...
1) Use the deconvolution algorithm given in the Sample Experiments to deconvolve the IRF from your signal. Fit the resulting "real decay" curve to a model decay equation.
2) Fit your experimental signal to a convolution of the measured IRF + a model decay equation.
Both of these two processes have their pros and cons. Both of them require that you have a working set of basic skills in using Igor Pro. Here are some starting points to understand where you might be having problems ...
* What do you mean by "... but I can not make it work"! in your statement about pFLIM? Do you mean, "I know that pFLIM does not have a way to do either method 1 or method 2"? Alternatively, do you mean, "I do not know how to use pFLIM method 1 or pFLIM method 2 on my data"?
... if pFLIM is not going to do what you need, then ...
* Have you tried using the Sample Experiment on deconvolution to deconvolve the IRF from your signal? At what point are you having problems doing this?
* Have you tried fitting your signal to a model equation even though you have not deconvolved the IRF? At what level are you having problems doing this?
--
J. J. Weimer
Chemistry / Chemical & Materials Engineering, UAHuntsville
January 22, 2013 at 09:50 am - Permalink
I'm sure there is a simple method to do this ... I hope that someone using Igor for TCSPC data passes by..
You are talking about "Sample Experiments" where can I find it?
January 23, 2013 at 08:38 am - Permalink
From what I can tell from the explanation of the pFLIM package, the instructions that are given might be the same as though someone who uses Igor for TCSPC analysis is sitting next to you and telling you what to do. The frustration here is trying to understand what specifically is going wrong when you follow those instructions (if indeed you are even reading the instructions and following them)?????
The demo experiment is in your Igor Pro folder using the following path -> Igor Pro 6.3 Folder : Examples : Analysis. The experiment you want is Spectral Deconvolution Demo.
--
J. J. Weimer
Chemistry / Chemical & Materials Engineering, UAHuntsville
January 23, 2013 at 01:37 pm - Permalink
John Weeks
WaveMetrics, Inc.
support@wavemetrics.com
January 23, 2013 at 05:47 pm - Permalink
The usual way to analyse the data is to make an exponential decay then convolve this with your instrument function and match to your experimental decay. One reason for this is the weighting factors - as TCSPC is usually a photon counting experiment, so the weighting given to each data point is simply the square root of its photon count. If one were to try to deconvolve the instrument function, then don't think it would be straight-forward to determine what are appropriate values for the weighting factors.
I have had a play and have written the following demonstration code. This is far from robust, and I have not thoroughly tested it, but it does appear to work and fit a convolved 2-exponential decay to the data. (It took me a while to figure out the x-offsets that result from the convolution function and how that could be made compatible with the cursor limits of the fit).
With your two waves (IRF and Decay_1) in the current datafolder, run the following two functions from the command line:
MakeGraph()
Use the cursors to refine your fit region.
TCSPC_Fit()
Hope this helps.
Kurt
// assumes that waves IRF and Decay_1 already exist in current dataFolder
string sDecayWave = "Decay_1"
string sIRFWave = "IRF"
// Reference these waves
wave wDecay = $sDecayWave
wave wIRF = $sIRFWave
// Make the plot and assign trace names
Display wIRF/TN=IRF, wDecay/TN=Decay
ModifyGraph mode=2, rgb(IRF)=(0,0,65280)
ModifyGraph log(left)=1, mirror(left)=1, minor(left)=1
ModifyGraph mirror=1, minor=1
// display and set cursors
ShowInfo
WaveStats/Q wDecay
Cursor/A=1/H=2 A, Decay, V_maxloc
Cursor/A=1/H=2 B, Decay, 2500
End
Function TCSPC_Fit()
// assumes that waves IRF and Decay_1 already exist in current dataFolder
string sDecayWave = "Decay_1"
string sIRFWave = "IRF"
// Reference these waves
wave wDecay = $sDecayWave
wave wIRF = $sIRFWave
// Make a normalised IRF wave
Duplicate/O wIRF, wIRF_N
variable vSum = sum(wIRF, -inf, inf)
wIRF_N[] /= vSum
// Make Fit-related waves
Duplicate/O wDecay,wWeight
wWeight[] = 1 / sqrt(wWeight[p]) // weighting is from shot noise - set to 1/stdev for each data point
Make/O/N=5 W_coef, W_sigma
Make/O/N=1 W_fitConstants // the x-axis offset
// run non-convolution curve fit first to effectively get a set of starting parameters
W_coef[0] = 0 // hold offset at zero
// This would be for a single exponentail fit:
// CurveFit/H="100"/NTHR=0/L=(pcsr(B)-pcsr(A)+1) exp_XOffset, kwCWave=W_coef, wDecay[pcsr(A),pcsr(B)] /D /R /W=wWeight
// This is for a double exponential fit:
CurveFit/H="10000"/NTHR=0/L=(pcsr(B)-pcsr(A)+1) dblexp_XOffset, kwCWave=W_coef, wDecay[pcsr(A),pcsr(B)] /D /R /W=wWeight
string sFitDecay="fit_"+sDecayWave
wave wFit=$sFitDecay
ModifyGraph rgb($sFitDecay)=(0,65280,0)
Make/O/N=5 wFitParams
wFitParams[]=W_coef[p]
FuncFit/NTHR=0/L=(pcsr(B)-pcsr(A)+1) TCSPC_Convolution,wFitParams, wDecay[pcsr(A),pcsr(B)] /D /R /W=wWeight
End
Function TCSPC_Convolution(wFitParams,yw,xw) : FitFunc
Wave wFitParams,yw,xw
wave wIRF_N
// make exponential decay wave
Make/O/N=(pcsr(B) - pcsr(A) + 1) wExpDecay
wExpDecay[] = wFitParams[0] + wFitParams[1] * exp(- x / wFitParams[2])
// This is for 2-exponential fit only:
wExpDecay[] += wFitParams[3] * exp(- x / wFitParams[4])
//Convolve with IRF
Convolve wIRF_N, wExpDecay
//assign the result (note: offset due to cursor fit range)
yw[] = wExpDecay[p + pcsr(A)]
End
January 25, 2013 at 01:14 am - Permalink
I must seriously learn programming in Igor or at least understand the program!! I confessed that I'm a zero.
PS: KurtB, normally all my decays are a first order
January 28, 2013 at 06:32 am - Permalink