View Issue Details

IDProjectCategoryView StatusLast Update
0003011Slicer4Core: GUIpublic2018-03-31 00:37
ReporterlassoanAssigned Tofinetjul 
PrioritynormalSeverityminorReproducibilityalways
Status assignedResolutionreopened 
Product Version 
Target VersionSlicer 4.11.0Fixed in Version 
Summary0003011: Inconvenient image spacing and origin editing in Volumes module
Description

In the Volumes module Image Spacing and Image Origin fields when trying to enter digits after the decimal point after each keypress the editbox is filled with zeros after the entered digit. Before a new digit is accepted all the zeros have to be deleted. This has to be repeated for each digit, which is very inconvenient.

The issue is probably due to the auto-update of the MRML node during typing and a an automatic update of the GUI based on the changed MRML node. If that's really the root cause of the problem then it can be fixed quite easily: when there is a MRML update then compare the value displayed on the GUI and the value in the MRML and only update the GUI if the two values are different.

With latest Slicer nightly release on Windows 7, 64-bit.

TagsNo tags attached.

Relationships

related to 0003010 closedfinetjul Volume module GUI permanently modifies the spacing of the selected volume 
related to 0002792 closedmillerjv Image Spacing too contrained in Volumes module GUI 
related to 0001885 closedfinetjul Cannot adjust spacing of volume of .png images 

Activities

finetjul

finetjul

2013-07-28 04:27

administrator   ~0009228

Fixed in r22151

lassoan

lassoan

2013-09-03 16:45

developer   ~0009884

Thanks for the fix, it works correctly most of the time.

It still does completely crazy things if you try to enter more than about 16 digits. Just try to enter 1.1111111111111111111111111111111
you'll get something like 1.1111111111111111604543566500070.
It should not be a problem in practice, as 16 digits after the decimal point should be precise enough, but would be nice to not let this happen anyway (and for some numbers this might happen for less than 16 digits).

johan.andruejol

johan.andruejol

2017-04-19 12:00

manager   ~0014431

@lassoan: Should this be marked as fixed ?

dzenanz

dzenanz

2017-04-27 14:07

developer   ~0014446

Double has about 16 decimal digits in mantissa, so it is not surprising that decimal digits after that contain junk.

lassoan

lassoan

2017-04-27 14:24

developer   ~0014447

I find editing is often very frustrating. The main issue is that the number is changed while I'm editing it, for example filling up with zeros.

Example:

  • Clear the x spacing value
  • Enter 12.3
  • Then try to change it to 16.3 by pressing backspace 3x and entering 3.3
    => ERROR! After pressing backspace 2x, the value changes to 12000000.000000
  • Delete the 2 anyway and press 3, then press .
    => ERROR! There is already a decimal digit, so . is ignored
  • Try to get rid of the extra inserted zeros and decimal point by pressing Del key several times
    => ERROR! Deleting the zeros before the decimal point works, but once you delete the decimal point, all the zeros are restored (so you end up with 13000000.000000)

I think the doublespinbox behaves correctly, but the problem is in how its content is constantly updated while the user is editing it. A solution could be to prevent changing content of the doublespinbox that the user is currently editing (that one that triggered the value update).

lassoan

lassoan

2017-04-27 14:25

developer   ~0014448

Sorry, I had to reopen this. I've just added a comment about why the issue is still there.

dzenanz

dzenanz

2017-04-27 14:43

developer   ~0014449

I cannot reproduce the described behavior with ae6f222b1c87ca99215c7bc0e67d2d9c0530f2d0 from two days ago.

Enter 12.3, then try to change it to 16.3 by pressing backspace 3x and entering 6.3

My results:
Enter 12.3, the displayed value is Enter 12.3mm and cursor is after 3 and before mm.
After 3x backspace, it displays 1mm, with cursor after 1.
Pressing 6 causes value to change to 16.0mm, with cursor after 6.
Pressing . moves the cursor after the decimal point.
Pressing 3 changes the value to 16.3mm, and moves the cursor after 3 and before mm units.

This is reasonable behavior. I tested this with MRBrainTumor1 sample dataset.

lassoan

lassoan

2017-04-27 19:15

developer   ~0014452

Maybe my description was not clear enough, see what I tried in this screencast:
https://1drv.ms/v/s!Arm_AFxB9yqHr6VBSC3Rtd8JfdIgAg

I've also added a second part. I cannot enter 12.3333 spacing, as it is kept rounded to 12.33 or 12.333 (I keep pressing '3' key and I see the number alternating between 12.33 and 12.333).

Another one, not on video: Using MRHead enter 12.3 then try to change it to 23.4

  • Enter 12.3 => 12.3 appears, OK
  • Press backspace 3x => |0.0 displayed (| represents caret position)
  • Enter 23 => 23|0.0 displayed => ERROR: I would need 23 here
  • Enter . => ERROR: it is ignored
  • Try to delete with Del key => ERROR: I can delete the 0 but when I delete the . then the 0 and the . comes back; delete with

Another one, not on video: I can enter 23.554554 but I cannot enter 23.5555. If I enter 1.0000001 in the Y spacing then I can enter 23.5555 into the X spacing.

You should be able to reproduce a couple of these.

dzenanz

dzenanz

2017-04-28 10:06

developer   ~0014458

I can reproduce your problem from the video. Such problems do not occur always, but I have also occasionally encountered them while trying to edit the values in edit fields (I think I was using transform matrix editing most often).

This kind of change is best applied consistently over the user interface. I don't know whether changing the edit/spin-boxes to trigger valueChanged() signal only after leaving the control (or maybe pressing enter) would break some things. Those controls seem heavily customized, so somebody must have put in some effort to make it that way for a reason.

dzenanz

dzenanz

2017-04-28 10:09

developer   ~0014459

I think this is best tackled by someone better versed in Slicer's user interface than me.

Issue History

Date Modified Username Field Change
2013-03-14 07:46 lassoan New Issue
2013-03-14 07:46 lassoan Status new => assigned
2013-03-14 07:46 lassoan Assigned To => kikinis
2013-03-14 07:46 lassoan Relationship added related to 0003010
2013-03-14 09:36 kikinis Assigned To kikinis => finetjul
2013-03-19 13:30 finetjul Relationship added related to 0002792
2013-03-19 13:32 finetjul Relationship added related to 0001885
2013-07-28 04:27 finetjul Note Added: 0009228
2013-07-28 04:27 finetjul Status assigned => resolved
2013-07-28 04:27 finetjul Fixed in Version => Slicer 4.3.0
2013-07-28 04:27 finetjul Resolution open => fixed
2013-09-03 16:45 lassoan Note Added: 0009884
2013-09-03 16:45 lassoan Status resolved => assigned
2017-04-19 11:59 johan.andruejol Assigned To finetjul => lassoan
2017-04-19 12:00 johan.andruejol Note Added: 0014431
2017-04-27 14:07 dzenanz Note Added: 0014446
2017-04-27 14:11 dzenanz Status assigned => closed
2017-04-27 14:24 lassoan Note Added: 0014447
2017-04-27 14:25 lassoan Note Added: 0014448
2017-04-27 14:25 lassoan Status closed => new
2017-04-27 14:43 dzenanz Note Added: 0014449
2017-04-27 19:15 lassoan Note Added: 0014452
2017-04-28 10:06 dzenanz Note Added: 0014458
2017-04-28 10:08 dzenanz Assigned To lassoan => finetjul
2017-04-28 10:08 dzenanz Status new => assigned
2017-04-28 10:08 dzenanz Resolution fixed => reopened
2017-04-28 10:08 dzenanz Fixed in Version Slicer 4.3.0 =>
2017-04-28 10:08 dzenanz Target Version => Slicer 4.7.0
2017-04-28 10:09 dzenanz Note Added: 0014459
2017-09-27 11:32 lassoan Target Version Slicer 4.7.0 => backlog
2017-09-27 11:32 lassoan Target Version backlog => Slicer 4.9.0
2018-03-31 00:37 jcfr Target Version Slicer 4.9.0 => Slicer 4.11.0