Add drift QC: per-FOV drift_{fov}.csv and fishtank plot-drift#14
Open
leonardosepulveda wants to merge 3 commits into
Open
Add drift QC: per-FOV drift_{fov}.csv and fishtank plot-drift#14leonardosepulveda wants to merge 3 commits into
leonardosepulveda wants to merge 3 commits into
Conversation
detect-spots now measures drift at sub-pixel resolution (upsample_factor=10) and
writes a per-FOV drift table drift_{fov}.csv (fov, series, x_drift, y_drift, distance);
the applied image correction stays integer-pixel. Adds a fishtank.pl.plot_drift
function and a fishtank plot-drift CLI subcommand that render a 3-panel QC figure:
drift-vector scatter (colored by round), drift-distance histogram, and a fov x round
distance-minus-median heatmap.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Reverts the upsample_factor=10 sub-pixel registration in detect-spots
(which significantly slowed drift calculation) back to integer-pixel
phase cross-correlation, and drops the redundant drift_{fov}.csv output
since x_drift/y_drift are already recorded in channels_{fov}.csv.
plot-drift now reads channels_{fov}.csv (deduped to one row per
(fov, series)) instead of drift_{fov}.csv.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The plugin argument is deprecated in skimage.io.imread, so drop the plugin and **plugin_args parameters from read_img and the now-unused plugin=... passthrough to imread. read_dax never accepted extra kwargs, so **plugin_args was only ever valid when empty. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Contributor
|
@leonardosepulveda I removed the |
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.
Summary
Adds drift quality-control output and a plotting command to
detect-spots.channels_{fov}.csv.detect-spotsalready records theper-series integer-pixel drift (
x_drift,y_drift) it applies during intensityquantification in
channels_{fov}.csv. This PR reuses that record for QC rather thanrecomputing or duplicating it.
fishtank plot-drift. A new CLI subcommand (andfishtank.pl.plot_driftfunction)that reads the per-FOV
channels_*.csv, de-duplicates to one drift value per(fov, series), and renders a three-panel QC figure:symmetric axes (with an outlier-resistant
--scatter_max autooption);x_drift/y_drift) with the median marked;fov x roundheatmap ofdrift distance − median(diverging colormap).Rationale for revisions
The original version of this PR measured drift at sub-pixel resolution
(
phase_cross_correlation(..., upsample_factor=10)) and wrote a separatedrift_{fov}.csvtable. Both were reverted:upsample_factor=10significantly slows down thedrift calculation, and since the drift applied to images stays integer-pixel anyway, the
extra precision was never used — it only fed the QC record.
detect-spotsis back to theoriginal integer-pixel
phase_cross_correlation(...).drift_{fov}.csvwas removed as redundant. Thefov,series,x_drift, andy_driftcolumns it contained are already written tochannels_{fov}.csv.plot-driftnow reads
channels_{fov}.csvdirectly (deduping to one row per(fov, series)), so thereis a single source of truth and no extra output file.
Notes
detect-spotsbehavior is unchanged.matplotlib,numpy,pandas).<input>/drift_qc.png; axis limits, histogram bin width, colormapand font size are all parameters (with
autolimits available for scatter/histogram).🤖 Generated with Claude Code