File Exchange

image thumbnail

Adjust window level of image using mouse button

version 1.2 (1.42 KB) by

You can adjust the window level using mouse

3 Downloads

Updated

View License

You can adjust the window level by mouse
1 clicking and holding the RIGHT mouse button and moving: adjust current image

2 mid-button or shift+left button: adjust all images in current figure.
Example:
imagesc;
enableWL;

Comments and Ratings (5)

José Rosario

It works very well!

Jan Simon

Jan Simon (view profile)

The updated version of your code is much nicer - thanks!
The local variables are now stored in the figure's UserData, wuch that it can be applied to multiple figures without confusions.

I still see a problem in the missing documentation. While the code does not contain a help section, the only specification is found here in the FEX: "adjust the window level". But what exactly is adjusted?

Now I think, that this function is probably useful. Only the lack of a documentation reduces the usability substantially. A small help sections with a H1-line, which decribes the inputs and the applied procedure clearly, would be enough.

Yi Sui

Yi Sui (view profile)

Thank you for your long comments. Should you ever try the code, you would know it is useful, usable and does work for more than 1 figure at the same time.

Can you explain how the function works?

Jan Simon

Jan Simon (view profile)

This function does not contain any documentation. If a FEX user downloads it, even the short single line of the description here is not available anymore.
On the other hand the purpose of the function is not getting clear when the source code is read also. There are some deprecated large strings used as callbacks - function handles would be smarter, safer and more clear.
The code contains a magic string: "
randstr = 'oE_3rT4x_'". Magic strings are a bad programming pattern. In addition I wonder, if this function will run correctly, if it is applied to more than 1 figure at the same time.
My conclusion: Not usable. I cannot decide if it is useful. No docs or comments. Bad programming style.

Please brush up the function to make it more useful and usable. Then I will rate this again.

Updates

1.2

rewrite the code

MATLAB Release
MATLAB 7.12 (R2011a)

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video