Login  Register

Re: Applying modified LUT to 16-bit image in macro

Posted by MatthewThompson on Sep 24, 2015; 9:54pm
URL: http://imagej.273.s1.nabble.com/Applying-modified-LUT-to-16-bit-image-in-macro-tp5013606p5014451.html

If you convert the image to 8-bit first, the issue will be resolved.

Use:

run("8-bit"); //Equivalent to Image > Type > 8-bit
setMinAndMax(0, 20000);
run("Apply LUT");

That doesn't exactly answer the question of why it works manually and not in a macro, but it's a workaround that seems to do the trick

lesuaz wrote
Hi all,

I use the latest version of Fiji to open a 16-bit grayscale image, change the minimum/maximum displayed values under Image -> Adjust -> Brightness/Contrast and then hit "Apply", which gives me a 16-bit image with a modified LUT. However, when I try to do the same thing in a macro...

setMinAndMax(0, 20000);
run("Apply LUT");

... I get an error message saying that:

"Apply LUT" requires an image of type: 8-bit grayscale, 8-bit color, RGB color.

I don't understand why I can perform the 16-bit image conversion manually, but not in a macro. Does anyone know a solution to this problem?

Thank you very much!