NOTICE! This is a static HTML version of a legacy ImageJ Trac ticket.

The ImageJ project now uses GitHub Issues for issue tracking.

Please file all new issues there.

Ticket #1651 (closed defect: fixed)

Opened 2013-02-11T10:10:33-06:00

Last modified 2014-05-07T04:50:54-05:00

NumberWidget: sliders and scrolls don't work with doubles

Reported by: bdezonia Owned by: curtis
Priority: major Milestone: imagej2-unscheduled
Component: UI Framework Version:
Severity: serious Keywords:
Cc: Blocked By:
Blocking: #1632

Description

While working on the Threshold plugin I came across an issue with NumberWidget. If one chooses widget style of slider or scroll any defined callbacks for the field are never called. Ideally the min and max values in the Threshold plugin would have the style of scroll/slider that shows tick marks and most importantly labels the axis with min and max values. We need to make the widget work correctly and change the definitions in the Threshold plugin.

Change History

comment:1 Changed 2013-02-11T10:10:51-06:00 by bdezonia

  • Blocking 1273 added

comment:2 Changed 2013-02-11T13:53:53-06:00 by curtis

I thought a bit about how to make sliders & scroll bar number widgets support doubles and other non-integers, but in general it is a rather nasty problem. In essence, you have to decide how to reduce a Number from its native min/max/step to a discrete subset of positive ints. I think the general mathematical solution is non-trivial.

For our sanity, we may just want to special-case a few specific supported cases. In particular, a float or double with bounded min/max.

The naive math is steps = (max - min) / stepSize, but there are many corner cases where it will be wrong. In the case where either min or max isn't actually bounded, for example, it blatantly fails.

We could also play some tricks with the UI widgets themselves, updating the ranges dynamically, etc., but it may be more trouble than it is worth. Just having support for doubles with bounded min/max ranges may be sufficient for most use cases.

comment:3 Changed 2013-03-05T16:18:27-06:00 by bdezonia

  • Milestone changed from imagej2-b8-analysis to imagej2-b7-ndim-data

comment:4 Changed 2013-03-06T13:25:26-06:00 by bdezonia

  • Blocking 1632 added; 1273 removed
  • Milestone changed from imagej2-b7-ndim-data to imagej2-unscheduled

comment:5 Changed 2013-03-19T13:25:16-05:00 by curtis

  • Component changed from Core to UI Framework

comment:6 Changed 2013-10-21T13:23:36-05:00 by bdezonia

curtis, was this one handled recently?

comment:7 Changed 2013-10-23T12:18:28-05:00 by curtis

Sort of. See:  https://github.com/imagej/imagej-tutorials/commit/7f828032e407f7e29e434da7c8f0edf87e28c9c3

With respect to the Threshold command specifically, I did not test it recently.

comment:8 Changed 2014-05-07T04:50:54-05:00 by curtis

  • Status changed from new to closed
  • Resolution set to fixed

I declare this ticket "close enough" for now.