RiFRET Plugin Help (SOLVED)

Tags: #<Tag:0x00007fb87e2bc030>


Hi there, I´m having problems changing the formula the plugin calculates FRET efficiency in line 1610

ipDDP[i] = (float)(((double)ipDAP[i]-((s3Factor*(double)ipAAP[i])-(s2Factor*(double)ipDDP[i]))-((s1Factor*(double)ipDDP[i])-(s4Factor*(double)ipAAP[i])))/(((double)ipDAP[i]-((s3Factor*(double)ipAAP[i])-(s2Factor*(double)ipDDP[i]))-((s1Factor*(double)ipDDP[i])-(s4Factor*(double)ipAAP[i])))+(alphaFactor+(s1Factor*(double)ipDDP[i]))));

by something like:


But I don´t have any experience programming and I dont know what is float or double. Anyone willing to help? Thanks a lot in advance.



Hello Javier @milhousito,

Welcome to the forum.

What exactly are you trying to achieve with your FRET effficiency formula? Can you explain ipDAPee?

RiFRET relies on donor, transfer and acceptor images to calculate FRET efficiency on a pixel-by-pixel basis by taking the ImagePlus for the corresponding channel (e.g. donorInDImage for the donor channel), creating an ImageProcessor from this (e.g. ipDD, then producing a float[] array from the pixels in this ImageProcessor, (e.g. ipDDP).

Edit: To answer your question, the spectral correction factors (“S factors”) in the formulae are all double as each S factor entered in the corresponding text field is parsed to double.

The original formula can also possibly be made easier to read to look something like this:

ipDDP[i] = (float) ((s1Factor * s2Factor * (ipDAP[i] * (1 - s3Factor * s4Factor) - ipDDP[i] * (s1Factor - s2Factor * s3Factor) - ipAAP[i] * (s2Factor - s1Factor * s4Factor))) / ((s1Factor - s2Factor * s3Factor) * (ipDDP[i] * s2Factor - ipDAP[i] * s4Factor) * alphaFactor))

The source code for RiFRET can be found here.

(I’m happy to expand on this more, and I’m aware my edit count is racking up, but I’m currently in a pharmacology lecture…)


Sorry, it was a typo. What I´m trying to do is to change the way the plugin calcuates the FRET efficiency but with other formula, as the one Leica uses in it´s propietary software as in “Correcting Confocal Acquisition to Optimize Imaging of Fluorescence Resonance Energy Transfer by Sensitized Emission
van Rheenen, J., Langeslag, M., & Jalink, K. (2004). Correcting Confocal Acquisition to Optimize Imaging of Fluorescence Resonance Energy Transfer by Sensitized Emission. Biophysical Journal, 86(4), 2517–2529. http://doi.org/10.1016/S0006-3495(04)74307-6” So, that is the formula I would like to apply in the plugin.



Ah I see! I couldn’t access the paper from the link, but found the paper online.

I think there are still some typos in your proposed formula - I will take a look at it for you. If you could at least carefully check through it in the meantime, and use whitespace to make it a bit more readable, that would be excellent.

I have been working on the RiFRET plugin for the past year(?) and hope to make an announcement on the forum soon, with the plugin distributed via a Fiji update site. There is a new menu with additional optional corrections that can be applied to the FRET efficiency calculation, and I’m sure this would be a good addition!

Best wishes,



Hi Cameron, that´s great news. I already have a barelymodified version of the plugin based on “Photobleaching-corrected FRET efficiency imaging of live cells
Zal, T., & Gascoigne, N. R. J. (2004). Photobleaching-corrected FRET efficiency imaging of live cells. Biophysical Journal, 86(6), 3923–3939. http://doi.org/10.1529/biophysj.103.022087” in which S1,S2,S3 & S4 Factors were modified to be a,b,c,d and alpha modified to be G, according to that paper. Now in the new algorithm from van Rheenen et al, they use alpha, beta, gamma and delta. To sum up:

s3=not used in Zal et al=delta

So basically adding those correction factors to the plugin and changing the formula will be enough to generate the resulting E-FRET image:


best regards,



Hi Javi,

I would be very interested to see your modified version - I’m familiar with this paper.

You may well have solved this by now, but it looks like you are mixing the float arrays and ImageProcessors I mentioned above in your formula. If we correct this, the plugin can be built and run without errors to produce a FRET image using the following formula:

ipDDP[i] = (float) (ipDAP[i] - (ipDDP[i] * s1Factor) - ipAAP[i] * (s2Factor - (s4Factor * s1Factor)) / (ipAAP[i] * (1 - (s1Factor * s3Factor))));

Please note I have not had a chance to test this formula yet!

I look forward to hearing your progress!


Hi Cameron,

If you give me your e-mail I can send over the plugin, is basically the same RiFRET plugin but renaming Factors and dialogs ad changing E-FRET formula. Apparently I can not attach anything in the forum since I´m a new user. Your formula completed with (double) before each ipDD, ipAA and iDA values I think is working. Thanks a lot. BTW Do you think the plugin can analyze time series because I´m not sure.

Again thanks a lot



I increased your account’s trust level, so you should now be able to attach files. Let us know if you still have issues.

I’d like to encourage you to keep the discussion open, so others can benefit from it as well. If you made changes to a plugin, you can also share the code via gist or as a github repository.


@imagejan Thank you Jan!


RiFRET_Plugin.java.zip (25.3 KB)

There you go, hope it works for you. The plugin is fully functional to calculate correction factors, except G, but you can just introduce G value calculated elsewhere.

Best regards,



Hi Cameron,

How could I get this FRET plugin your working on? Thanks.


Hi Javier,

As I said above, I hope we can release it via a Fiji update site soon!