Posted by
Wayne Rasband-2 on
URL: http://imagej.273.s1.nabble.com/Propagate-min-max-does-not-work-via-the-GUI-for-large-16-bit-images-tp5024225p5024226.html
> On Nov 23, 2020, at 11:08 AM, Stein Rørvik <
[hidden email]> wrote:
>
> There is a problem with the Brightness/Contrast dialog for larger images:
>
> If the image size is 3000 pixels or more wide, the propagate min/max choice does not work.
I was able to reproduce this problem on Windows, I added some debug statements to the ContrastAdjuster.propagate() method, but then I was no longer able to reproduce the problem! Here is what the code (in 1.53g46) looks like:
for (int i=0; i<nImages; i++) {
ImagePlus img2 = WindowManager.getImage(list[i]);
if (IJ.debugMode) IJ.log("Propagate: "+i+" "+img+"\n"+img2);
if (img2!=null && img2.getBitDepth()==depth && img2.getID()!=id
&& img2.getNChannels()==1 && img2.getWindow()!=null) {
if (IJ.debugMode) IJ.log(" "+min+" "+max);
ImageProcessor ip2 = img2.getProcessor();
ip2.setMinAndMax(min, max);
img2.updateAndDraw();
}
-wayne
> Instead of propagating the set values, the min/max values of the other images are reset to their min/max pixel value.
> If the image size is smaller like 2000 pixels wide then it works ok. I have 16-bit range set to automatic.
>
> I didn't try to investigate at exactly what image size it fails, but the problem is definitely bound to the image size.
> I checked the ImageJ version by downgrading and it works as expected in version 1.52r and earlier.
>
> Here is a demo macro to help reproduce the issue:
>
> -----------------------
> run("Close All");
> run("CT (420K, 16-bit DICOM)");
> //width=888 height=495
> run("Scale...", "x=4 y=4 interpolation=Bilinear create");
> //width=3552 height=1980
> run("Tile");
> selectWindow("ct.dcm-1.tif");
> run("Brightness/Contrast...");
> waitForUser("Please Set contrast and select 'Propagate to all images'");
> //works until 1.52r
> //fails in 1.52s: min/max is reset when Brightness/Contrast is opened; propagate is ok
> //fails since 1.52t: min/max is not propagated, other images have instead min/max reset
> -----------------------
>
> If you resize to a smaller size like
> run("Scale...", "x=2 y=2 interpolation=Bilinear create");
> then the problem does not occur.
>
> I am using daily build ImageJ 1.53g with Java 1.8.0_172 on Windows 10/64-bit.
>
>
> Stein
--
ImageJ mailing list:
http://imagej.nih.gov/ij/list.html