scijava / scijava-common

A plugin framework and application container with built-in extensibility mechanism :electric_plug:
BSD 2-Clause "Simplified" License
89 stars 52 forks source link

Calibration of a prepopulated image @Parameter does not update #240

Open rimadoma opened 8 years ago

rimadoma commented 8 years ago

The calibration info of a prepopulated image does not update. More specifically CalibratedAxis.getScale does not return the correct value.

Steps to reproduce:

  1. Create a ContextCommand plugin that has a @Parameter Dataset dataset as input
  2. Open "bat_cochlea_volume.tif" (File > Open Samples > Bat Cochlea Volume) in ImageJ. This is an uncalibrated image.
  3. Debug run the plugin. Scale for each axis should be 1.0
  4. Calibrate "bat_cochlea_volume.tif" (Analyze > Set Scale)
  5. Set options: Distance in pixels to 1, Known distance to 1.00, Pixel aspect ratio to 0.5, Unit of length to mm
  6. Rerun the plugin. Scale for dimension 1 should be 0.5

If you skip step 3 and run the plugin for the first time after setting the calibration, it is displayed correctly.

ctrueden commented 8 years ago

Yes, this is an IJ1<->IJ2 syncing issue. It would be fixed by an improved syncing/wrapping strategy, like so many other legacy bugs of this nature.