Skip to content

Feature/visualizer streaming#2

Open
babo989 wants to merge 7 commits intomainfrom
feature/visualizer-streaming
Open

Feature/visualizer streaming#2
babo989 wants to merge 7 commits intomainfrom
feature/visualizer-streaming

Conversation

@babo989
Copy link
Collaborator

@babo989 babo989 commented Mar 19, 2026

Summary

Replace full-file TSV loading with a streaming columnar reader and updated chart nodes. Fixes memory crashes on large datasets (56K+ rows,~81MB files) on Raspberry Pi.

Streaming TSV reader

  • Reads the file once via fs.createReadStream, extracts only the 25 columns used by charts
  • Memory usage drops from ~500MB to ~9MB peak for 56K rows
  • Replaces the previous Size-safe file read function node

Chart node updates (12 nodes)

  • Scatter plots (heatmap, colorspace, aspect, greenness, complexity, texture): reservoir sampling capped at 10K points, us — preserves statistical distribution using reservoir sampling
  • Histograms (ESD, solidity)
  • Gallery & explorer: pre-sorted by area descending, capped at 5K rows, includes object_blur_laplacian for "Sort by Sharpest"
  • Timeline: full temporal resolution preserved
  • Sample Identity: reads directly from pre-extracted metadata

Bug fix

  • Added object_blur_laplacian to the streaming reader's column list and to gallery/explorer keys was missing in the initial implementation, causing "Sort by Sharpest" to have no effect

babo989 added 7 commits March 18, 2026 21:47
- Acq_ID supports leading zeros (text input + smart increment) (#903)
- Sample_ID as string + save confirmation snackbar (#889-893)
- Show project/sample/operator/gear in acquisition page (#894)
- Add flowcell size (µm) to magnification button labels (#901)
- Compose fully-qualified project_sample_acq IDs in update_config (#882)
- Space-to-underscore sanitization in IDs
- Gallery + Explorer URL path sanitization for legacy TSVs
- Replace direct deleteItem with confirmDelete + dialog
- Show acquisition and sample ID in confirmation prompt
- Warning that deletion cannot be undone
- set object_datetime also persists lat/lon if present
- set object_latlon also persists date/time if present
The start acquisition function read acq_nb_frame and acq_interframe_volume
from Node-RED globals, but the globals were written by a parallel message
path. When the user changed form values and clicked Start, the read happened
before the write, causing the acquisition to use stale values.

Fix: start acquisition now reads from msg.payload first (carried with the
command), falling back to globals for backwards compatibility.

handleAcqStatusChange explicitly passes acq values in the start message.
Replace full-file TSV loading with streaming columnar reader that extracts
only the 24 columns used by charts. Memory usage drops from ~500MB to ~9MB
for 56K-row datasets.

Chart node improvements:
- Scatter plots (heatmap, colorspace, aspect, greenness, complexity, texture)
  use reservoir sampling capped at 10K points
- Histograms (ESD, solidity) pass all values for accurate binning
- Gallery and explorer pre-sort by area descending and cap at 5K rows
- Timeline preserves full temporal resolution
…orer

The columnar streaming reader only extracts listed columns. The blur metric
was missing, causing Sort by Sharpest to have no effect in the gallery and
explorer views.
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