Skip to content

Pixel size (Δx / Δy) input field corrupts typed values in image properties #320

@PierreRaybaut

Description

@PierreRaybaut

Summary

In DataLab 1.0.0+, when editing the pixel size of an image (Δx or Δy field in the image properties panel), the input field behaves strangely: most digits typed after the first one are interpreted as decimal places of the first digit, instead of being appended to the value.

Reproduction

  1. Open DataLab and load (or create) an image.
  2. In the image properties panel, locate the pixel size fields (Δx, Δy).
  3. Click into the Δx field and select its entire content (e.g. 1.0).
  4. Type 52.

Observed: the field shows 5.02 (the 5 is taken as units, but the 2 is interpreted as hundredths). Apply does not save the intended value.

Expected: the field shows 52, and applying saves Δx = 52.

Other examples:

  • Typing 0.25 in place of 1.0 produces 0.0.25 (invalid).
  • Typing 7 in place of 1.0 produces 7.0 then any next keystroke is appended after the spurious decimal part.

Impact

  • Makes pixel size editing essentially unusable: any multi-character entry is corrupted.
  • Affects calibration workflows where users need to set non-trivial Δx / Δy values (e.g. wavelengths, micrometers per pixel).
  • Reported on DataLab 1.2.0; reproduced on current main.

Root cause and fix

The bug originates in guidata (since v3.13.0), in the reactive update mechanism that refreshes computed fields (e.g. xmin, xmax, ymin, ymax) when an editable field they depend on (Δx, Δy) changes. Each refresh re-entered the same callback with a different "exclusion target" and ended up overwriting the field the user was actively typing in.

A fix has been applied in guidata. DataLab will pick it up automatically once the corresponding guidata release is published and DataLab's minimum required version is bumped accordingly.

See companion guidata issue: PlotPyStack/guidata#104.

Validation (after guidata fix)

  • Editing Δx / Δy from the image properties panel now accepts arbitrary multi-digit values (52, 0.25, 7, …).
  • Computed fields (xmin, xmax, ymin, ymax) update correctly after Apply.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions