Posted by
Wayne Rasband on
Jun 14, 2006; 7:56pm
URL: http://imagej.273.s1.nabble.com/Window-and-Leveling-tp3702480p3702485.html
Use the setMinAndMax(min, max) function to set the display window and
level, where min and max are calculated from the window width and level
using
min = level - width/2;
max = level + width/2;
Use a macro set such as the one at
http://rsb.info.nih.gov/ij/macros/WindowAndLevel.txtto create menu commands for setting preset values for lungs, bones,
etc. This macro set creates keyboard shortcuts that allow you to switch
to the lung preset values by pressing 1 and to the bone values by
pressing 2. It also includes macros for changing the preset values
using a dialog box and to change them to values defined interactively
using the W&L or B&C tools.
Add the macros in this set to StartupMacros.txt to have them installed
automatically when ImageJ starts up. Information about the ImageJ macro
language can be found at
http://rsb.info.nih.gov/ij/developer/macro/macros.html-wayne
On Jun 13, 2006, at 2:40 PM, Prasad Rajagopal wrote:
> Hi all,
>
> I am pretty much new to the mailing list but I have been using
> ImageJ in my application for about an year. Recently we are required to
> offer a new feature for our Medical Images - Window & Leveling concept.
>
> After going through couple of articles I managed to understand
> clearly what it means. But I also knew that, ImageJ does have W&L
> added in
> the Menu Bar and I did play around with that for a while.
>
> But our requirements are like this. We have specific users who
> wants to have these Window&Level values preset for them.
>
> For example:
>
> Lungs = value1
> Brain = value2
> Bones = value3
> etc.,
>
> So i was thinking to have a drop-down list and have lungs,
> brain, bones etc., listed in them. So when the user chooses one
> of them, it will change the intensity of the Image to their needs.
>
> So, can anybody help me find what API function should I
> exaclty use for setting the values. I could not find any such function
> in the documentation.
>
> But I am pretty much convinced that there is one, because
> W&L of
> the ImageJ has an "Apply" button in it, which exactly does what I need.
>
> Any ideas ?
>
> Thanks
> Prasad
>