Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IRF-read should handle *.asc files #4

Open
JenuC opened this issue Apr 9, 2020 · 17 comments
Open

IRF-read should handle *.asc files #4

JenuC opened this issue Apr 9, 2020 · 17 comments
Assignees
Labels
enhancement New feature or request priority:medium
Milestone

Comments

@JenuC
Copy link

JenuC commented Apr 9, 2020

IRF -expected file should be a 1-dimensional ASCII file (T-axis). unless there is a reason. Not all IRF are sdt files. Conventionally its tab-delimited *.asc file.

@Xanthorapedia Xanthorapedia transferred this issue from flimlib/flimj-ops Apr 9, 2020
@Xanthorapedia Xanthorapedia added the enhancement New feature or request label Apr 9, 2020
@Xanthorapedia
Copy link
Contributor

This can be addressed in future development. The current system sees transients as coming from datasets and it takes some effort to adapt it to single transients.

@JenuC
Copy link
Author

JenuC commented Apr 10, 2020

Most IRF that we handle in TCSPC labs are *.asc files. IRF-sdt is only an acquisition unit. One uses a single-pixel time-curve as IRF and not the whole image. This is because IRF is not distributed equally in an image. An image with urea crystal may have only 1 pixel that is from SHG and that is why I think we should handle .asc files ( even "instead" of sdt files).

@Xanthorapedia
Copy link
Contributor

Are .asc files coming from raw .sdt's? The UI allows you to select a single pixel from a .sdt file as the IRF. Is that sufficient? Or are you suggesting that the acquisition unit is doing the work and generating the .asc file?

@JenuC
Copy link
Author

JenuC commented Apr 13, 2020

a) .asc file is just one-pixel time-curve written in ascii format. It is easy to modify on a notepad and is derived from the acquisition software(either SPCM or SPCimage).
b) Maybe I can retry this on the UI after the manual is ready. I couldn't find a way to assign a single pixel for IRF. Maybe we should optionally display IRF with the fit so that the relative IRF position and shape can be evaluated before fitting dataset.
c)The common format of handling IRF is as a single time curve than sdt file for SPCImage. Users can generate that during acquisition or on the FLIMJ UI as you suggest. But the .asc file should be saved so that it can be loaded at a later stage (instead of the full sdt).

Xanthorapedia added a commit that referenced this issue May 15, 2020
As suggested in #4
@JenuC
Copy link
Author

JenuC commented Jul 8, 2020

@Xanthorapedia please upload/send_me an example *.asc file you used for enabling this feature. I can't make it work yet. Find attached a sample IRF ASCII file I used.
IRF.txt

@JenuC
Copy link
Author

JenuC commented Jul 8, 2020

I tried a single T-axis, tab-delimited transposed axis, and a few others. nothing worked out. maybe refer to this site: https://www.becker-hickl.com/faq/how-to-use-a-measured-irf-in-flim-analysis-in-spcimage/

@Xanthorapedia
Copy link
Contributor

Xanthorapedia commented Jul 8, 2020

Just a single list of photon counts delimited by whitespace (space, tab, newline, etc.) like in their example should work. Are you on the newest version?

Your IRF should look like this if you remove the time column:
image

@JenuC
Copy link
Author

JenuC commented Jul 13, 2020

@Xanthorapedia : I like the way it looks. But please send me the modified file you used, so that I can test it on my end. It seems like I am missing something. My flimj-UI is current according to the FLIMJ-update site. Is there a different version on GitHub that I should try for this?

@JenuC
Copy link
Author

JenuC commented Jul 13, 2020

I just tried with the flimj-ui-1,0.7 version on github. but i can't make the asc-loading to work. I tried with single column files with newline and whitespace separation. There is no error. i don't see the irf peak. that's all. I guess it would be easier for me if you could just send me the format that worked for you. at least i can rule out the file-format issue

@Xanthorapedia
Copy link
Contributor

Xanthorapedia commented Jul 13, 2020

Can you try this one? Make sure your file has .asc as extension and select "Show IRF Intensity" option.

@JenuC
Copy link
Author

JenuC commented Jul 13, 2020

okay. so it was not the file format. it was the secret "show-irf- intensity" dropdown menu. But now, I cannot see the IRF when the data file is loaded. I need to optimize the vertical bars/ fitting range based on where my IRF peak is. how can we fix that?

@Xanthorapedia
Copy link
Contributor

The secret dropdown is documented in the manual. The default behavior is that if the IRF loading goes wrong, The error will be reported in the debug console. One improvement could be to automatically jump to "IRF Intensity" once an IRF is set. Shall we take that?

As for manually setting the ranges, any idea as to how to detect the peak boundary?

@JenuC
Copy link
Author

JenuC commented Jul 14, 2020

One of the purposes of IRF is to decide if the lifetime-datafile file fitting-endpoints are justified or not. automatically feeding the IRF into the LMA/Bayes may cause errors if the shift between them is larger. And I think that we should not try to find peak/shift the IRF. It will add more confusion unless we add more controls for the user to adjust the shift-position. So I would say, the simplest solution is to let the green curve from the IRF-dropdown menu stick even when that menu is back to Intensity-mode.

@ctrueden ctrueden added this to the paper milestone Jul 23, 2020
@JenuC
Copy link
Author

JenuC commented Aug 10, 2020

@Xanthorapedia : there is no changes to this feature. The idea I mentioned is a way to see both lifetime and irf curve together in the plotting panel regardless of which pixel lifetime curve is drawn from. This step has a lot of practical purposes. The current version, we can do only irf or intensity. I suggest, to have a both lifetime curve and a "normalized IRF to the lifetime curve" plotted together? let me know what you think.

@Xanthorapedia
Copy link
Contributor

@JenuC I think the problem is that the IRF and lifetime curve are so different in magnitude that plotting one dwarfs the other. But both are actually there. I'm experimenting with normalizing IRF before plotting (this screenshot is taken in IRF mode, I plotted IRF to have the same height as the data):
image

I also adjusted the way IRF is displayed in intensity mode if that makes more sense: The part of the green curve selected in the IRF mode is left-justified, and you can adjust the start cursor in IRF mode to shift the peak left and right (assuming there are enough leading zeros in the IRF).
image

Please let me know if this would help.

@JenuC
Copy link
Author

JenuC commented Aug 15, 2020

yeah. this looks good. I tried to test it, but i cant get the UI to start with the current build version

Exception in thread "JavaFX Application Thread" java.lang.NoClassDefFoundError: flimlib/flimj/fitworker/FitWorker$FitEventHandler
	at flimlib.flimj.ui.FLIMJCommand.initFX(FLIMJCommand.java:134)
	at flimlib.flimj.ui.FLIMJCommand.lambda$run$0(FLIMJCommand.java:57)
	at flimlib.flimj.ui.FLIMJCommand.lambda$runAndWait$2(FLIMJCommand.java:96)
	at com.sun.javafx.application.PlatformImpl.lambda$null$172(PlatformImpl.java:295)
	at java.security.AccessController.doPrivileged(Native Method)
	at com.sun.javafx.application.PlatformImpl.lambda$runLater$173(PlatformImpl.java:294)
	at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95)
	at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
	at com.sun.glass.ui.win.WinApplication.lambda$null$147(WinApplication.java:177)
	at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.ClassNotFoundException: flimlib.flimj.fitworker.FitWorker$FitEventHandler
	at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
	... 10 more
[WARNING] FLIMJ: UI init failed or aborted by user. Exiting.

Xanthorapedia added a commit that referenced this issue Aug 15, 2020
Makes sure huge IRF peaks doesn't dwarf data and make it easier to
estimate shift.

Requested in #4.
@Xanthorapedia
Copy link
Contributor

@JenuC Can you please try again now? Make sure to include the newly released flimj-ops:2.1.0 if you are installing by copying jars. I will make a release and upload to the update site after this issue is closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request priority:medium
Projects
None yet
Development

No branches or pull requests

3 participants