Page MenuHomePhabricator

BugFix: SetAuto function in mitk::LevelWindow
Closed, ResolvedPublic

Description

BugFix: When loading an image sometimes the Auto is not working fine.
Changed mitk::LevelWindow::SetAuto() to use the image of the center of all the
time steps to compute the max and min range values of the levelWindow

Event Timeline

With this modification the full image is used for calculating the auto level. This can lead to performance issues for very large datasets. Daniel, can you please comment, is there a way to make both ways easily accessible?

There has already been a possibility to use the whole image for calculating the grayvalue range in the context menu which should be used in cases when the normal way does not lead to sufficient results. Does your change do the same as the context menu option?

If you think I did not understand your issue correctly, please try to explain it again and feel free to reopen the bug.

The problem arise when using a 3D+T image.
The image has T time steps and XxYxZ dimensions. The image is black except in the middle part of T (from t=2 to t=T-1). In this part, it has a white block in the upper zone that appears and dissapears.

With the old code there was no possibility to adjust the WindowLevel to be able to see the white block correctly.

The first option (guessByCentralSlice == true) uses only the slice in the middle of the middel time step, that is completelly black.
The second option (guessByCentralSlice == false) uses the first time step with all the slices, but the white block in the first time step is not present.

So the code has been changed to use all the slices of the middle time step.
Another option could be to use the whole image with all time steps when calling the function GetScalarValueMin( ).

If you need more explanation we can contact by phone.

[SVN revision 21098]
FIX (#3208): If guessByCentralSlice is set to false the whole image with all timesteps is now considered for calculating the min and max value for level window. Can be accessed via the context menu of the level window slider.