Skip to content

Calibrate a phasor against a reference measurement - #2

Merged
alex1075 merged 2 commits into
mainfrom
feature/phasor-irf-from-file
Aug 25, 2026
Merged

alex1075 merged 2 commits into
mainfrom
feature/phasor-irf-from-file

Conversation

@alex1075

Copy link
Copy Markdown
Contributor

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 .pqres result carrying its overall decay, or any reference measurement FLIMKit reads such as .ptu or .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.

.pqres is read through ptufile, which handles it as one of PicoQuant's unified tagged formats. A result exported with its TCSPC curve carries VarOverallDecayX and VarOverallDecayY; one without 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, 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.pqres produces 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

FitDialog renders path with 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

alex1075 and others added 2 commits August 25, 2026 09:22
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>
@alex1075
alex1075 merged commit 39c3308 into main Aug 25, 2026
6 checks passed
@alex1075
alex1075 deleted the feature/phasor-irf-from-file branch August 25, 2026 09:24
@alex1075 alex1075 mentioned this pull request Aug 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant