ApplyLUT problem

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

ApplyLUT problem

Stein Rørvik
I need to open a series of images coming from different sources and normalize them to have a similar min-max range. The easy way to do this in a macro is to use run("Enhance Contrast".. and then run("Apply LUT").

The problem is that I get an error message "the display range must first be updated" if the image already has a min-max range stretching from 0..255. See the below test macro. Here, "Apply LUT" fails for the Line Graph image.

Also, it does not fail for AuPbSn. The min..max range was originally 0..255, and auto contrast changes that to 0..252.
So it seems that Apply LUT fails if the range is 0..255 (meaning no change).

Can this restriction be changed, so that the macro does not break? The "Apply LUT" method could simply return with no changes if no changes are needed, instead of giving an error message. Or the error message could be given only when using the GUI, but not in a macro.


Demo macro:
------------------------------
run("Cell Colony (31K)");
run("Enhance Contrast", "saturated=0.35");
run("Apply LUT");

run("AuPbSn 40 (56K)");
run("Enhance Contrast", "saturated=0.35");
run("Apply LUT");

run("Line Graph (21K)");
run("Enhance Contrast", "saturated=0.35");
run("Apply LUT");
------------------------------


I am using daily build ImageJ 1.52o with Java 1.8 on Windows 7/64-bit.


Stein


--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html