Closed loomcode closed 4 years ago
I think the answer is here: https://github.com/imagej/imagej/issues/141
Is this somewhere in the documentation?
I don't think #141 is in any way related, as that issue is dealing with synchronization of properties between ImageJ2 (this repository) and ImageJ1.x.
You are asking about the Brightness&Contrast plugin, which is a pure ImageJ 1.x plugin implemented here:
How can I do this in the Java API?
The best way to find out is running the macro recorder (Plugins > Macros > Record...) in Java mode:
IJ.run(imp, "Apply LUT", "");
See also the documentation of the tool here: https://imagej.net/docs/guide/146-28.html#sub:Brightness/Contrast...[C]
In general, please ask questions about ImageJ usage and API on https://forum.image.sc/tags/imagej
From the GUI I can use Image->Adjust->Brightness/Contrast tool. When I click, "Apply", the scale is stretched between 0-65553 (for a 16 bit image).. How can I do this in the Java API? I can set min/max on an ImagePlus or ImageProcessor, but I don't know how to change the scale so that the lowest value is zero.
More broadly, how do I apply changes in general to the image pixel array? If I use setMinAndMax(100, 1000) then getMin() and getMax() reflect the changes, but they aren't applied to the image if I save it to disk.