Page MenuHomePhabricator

Level is changing when Window is set to 0
Closed, ResolvedPublic

Description

Load Image.
Under the level window you find 2 edit boxes.
Upper one is Level (determines a histogram-value as center)
Lower one is Window (determines the range).

Type in 0 in the Window-Box, it will automatically change to 1.
Do it again: Level is decremented (should not).

Event Timeline

User goetzm has pushed new remote branch:

bug-13147-FixedMovingWindowWhenZero

Cause of bug:
If the lower bound and the upper bound are equal (i.e. window = 0) then the upper bound is increased by 1. This leads to a new window of 1 (as desired) but shifts the level about 0.5

Proposed Fix:
Instead of increasing only one bound by 1, both boundaries are changed about 0.5.
Also the limits are checked with std::min and std::max

Affected files:
Modules/Core/src/DataManagment/mitkLevelWindow.cpp

Test:
Manual tests

[214b05]: Merge branch 'bug-13147-FixedMovingWindowWhenZero'

Merged commits:

2015-07-15 15:03:24 Michael Goetz [a85197]
Changed correction behavior for equal values

User goetzm has pushed new remote branch:

bug-13147-FixTextForLevelWindow

[2b12d1]: Merge branch 'bug-13147-FixTextForLevelWindow'

Merged commits:

2015-08-25 11:28:33 Michael Goetz [8eeb46]
COMP: Adapted test to new behaviour and fixed inconsistency in LevelWindow