3.0

3.0 | 2 ratings Rate this file 21 Downloads (last 30 days) File Size: 1.42 KB File ID: #38491

Adjust window level of image using mouse button

by

 

04 Oct 2012 (Updated )

You can adjust the window level using mouse

| Watch this File

File Information
Description

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;

Required Products MATLAB
MATLAB release MATLAB 7.12 (R2011a)
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (4)
13 Jun 2013 Jan Simon

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.

30 Oct 2012 Yi Sui

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.

13 Oct 2012 uc3m Cristobal

Can you explain how the function works?

06 Oct 2012 Jan Simon

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
12 Jun 2013

rewrite the code

Contact us