Calibrate a phasor against a reference measurement - #2
Merged
Merged
Conversation
The IRF setting was a dropdown of installed machine IRFs, so there was no way to point at an IRF you had measured. It is a path field now, and takes a machine IRF .npy, an IRF workbook, or any reference measurement FLIMKit can read, whose summed decay becomes the instrument response. An installed machine IRF id still resolves, and the schema carries the installed list so a client can offer them. PicoQuant .pqres result files are not supported. FLIMKit has no reader for them, so the error says so rather than failing obscurely. Verified on real files: exp_irf_glass.ptu calibrating bi_01.ptu moves the mean phasor from G 0.7057 S 0.5583 to G 0.7947 S 0.4253. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
ptufile reads pqres as one of PicoQuant's unified tagged formats, and a result exported with its TCSPC curve carries VarOverallDecayX and VarOverallDecayY. Those become the instrument response directly, so a SymPhoTime result works as a calibration without exporting anything. FLIMKit's own registry does not route .pqres, so this reads it through ptufile rather than FLIMFile. A result without the curve says so instead of failing obscurely. Verified on ATTO488_2_OTCSPC.pqres, 3125 points, and on TCSPC_Fitting_1.pqres, which carries no curve and is refused. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The IRF setting was a dropdown of installed machine IRFs, so there was no way to point at an IRF you had actually measured. It is a path field now and takes four things: a machine IRF
.npy, an IRF workbook, a PicoQuant.pqresresult carrying its overall decay, or any reference measurement FLIMKit reads such as.ptuor.sdt, whose summed decay becomes the instrument response. Typing an installed machine IRF id still resolves, and the schema carries the installed list so a client can still offer them..pqresis read throughptufile, which handles it as one of PicoQuant's unified tagged formats. A result exported with its TCSPC curve carriesVarOverallDecayXandVarOverallDecayY; one without says so rather than failing obscurely.Verified on real files.
exp_irf_glass.ptucalibratingbi_01.ptumoves the mean phasor from G 0.7057 S 0.5583 to G 0.7947 S 0.4253, near the universal semicircle where it belongs.Known limitation
Every reference is treated as a zero-lifetime scatter measurement. Pointing at a reference dye of known lifetime instead gives coordinates off the semicircle:
ATTO488_2_OTCSPC.pqresproduces G 1.0245 S -0.1815, and a negative S is unphysical. Calibrating against a known-lifetime reference is different maths and needs the lifetime supplied alongside the file. Use a scatter or IRF measurement until that lands.Trade-off
FitDialogrenderspathwith a text field and a Choose button, so QuPath picks this up with no Java change. Installed machine IRFs stop being a dropdown and become something you browse to or type.256 tests pass.
🤖 Generated with Claude Code