Hello,
I am having an issue with setting the contrast (min/max values) on large 32 bit images. I am working on some large images where I need exact control of the LUT range to create display colors showing features of interest. The problem is that the Set button in the Brightness/Contrast dialog usually (but not always) fails for these images; the contrast range is usually stuck to the current range. Other times, it gets stuck to the min and max values currently present in the image. Changing the scroll bars always work, but I cannot use them because the range I need usually expands outside the values present in the image. Also, I need to set the contrast with 3 decimals precision since my absolute values are below 1.0. Moving the scroll bars only displays the min/max values with 2 decimals. Maybe this can be changed? Changing the contrast from a macro always works as it should. So this is an issue with the way the Brightness/Contrast dialog works. The attached image and below macro illustrates what I am trying to do: The image has a range of -1.0 to -0.5. I need to change the contrast to a different range, say -1.0 to -0.6. This fails when using the user interface, but works fine from a macro. I hope you are able to reproduce this problem. I tried this using ImageJ version 1.50c on Windows 7. It only seems to affect fairly large images, a few thousands of pixels each side. I have attached a sample image which is shrunk 10 times, so it can be expanded again to demonstrate the problem. I am unable to determine under what exact conditions this works and fails; it seems to fail 9 out of 10 times for me, on different computers. Stein Macro code: //original image too big to send by email, it was shrunk 10 times open("C:\\MyDownloadDir\\TestContrast-32bit-Shrinked-10.tif"); //restore original size by expanding 10 times run("Scale...", "x=10 y=10 width=3160 height=4360 interpolation=Bilinear average create title=TestContrast-32bit-Restored-10.tif"); //In this image the contrast range is Min -1.0, Max -0.50 run("Brightness/Contrast..."); //change the contrast, works fine from a macro showMessage("Changing contrast into range -1.0 to -0.6 works fine from a macro."); setMinAndMax(-1.0, -0.60); //restore contrast, works fine from a macro showMessage("Contrast will now be restored into range -1.0 to -0.50 by the macro."); setMinAndMax(-1.0, -0.50); showMessage("Now try to do the same from the user interface.\nPlease change the range to -1.0 to -0.6 using the Set button.\nThis usually fails, but not always."); -- ImageJ mailing list: http://imagej.nih.gov/ij/list.html TestContrast-32bit-Shrinked-10.tif (741K) Download Attachment |
My mail program destroyed the code by removing the linewraps, trying again here:
//original image too big to send by email, it was shrunk 10 times open("C:\\MyDownloadDir\\TestContrast-32bit-Shrinked-10.tif"); //restore original size by expanding 10 times run("Scale...", "x=10 y=10 width=3160 height=4360 interpolation=Bilinear average create title=TestContrast-32bit-Restored-10.tif"); //In this image the contrast range is Min -1.0, Max -0.50 run("Brightness/Contrast..."); //change the contrast, works fine from a macro showMessage("Changing contrast into range -1.0 to -0.6 works fine from a macro."); setMinAndMax(-1.0, -0.60); //restore contrast, works fine from a macro showMessage("Contrast will now be restored into range -1.0 to -0.50 by the macro."); setMinAndMax(-1.0, -0.50); showMessage("Now try to do the same from the user interface.\nPlease change the range to -1.0 to -0.6 using the Set button.\nThis usually fails, but not always."); -----Original Message----- From: ImageJ Interest Group [mailto:[hidden email]] On Behalf Of Stein Rørvik Sent: 13. oktober 2015 21:27 To: [hidden email] Subject: Problems with setting contrast range on 32 bit images Hello, I am having an issue with setting the contrast (min/max values) on large 32 bit images. I am working on some large images where I need exact control of the LUT range to create display colors showing features of interest. The problem is that the Set button in the Brightness/Contrast dialog usually (but not always) fails for these images; the contrast range is usually stuck to the current range. Other times, it gets stuck to the min and max values currently present in the image. Changing the scroll bars always work, but I cannot use them because the range I need usually expands outside the values present in the image. Also, I need to set the contrast with 3 decimals precision since my absolute values are below 1.0. Moving the scroll bars only displays the min/max values with 2 decimals. Maybe this can be changed? Changing the contrast from a macro always works as it should. So this is an issue with the way the Brightness/Contrast dialog works. The attached image and below macro illustrates what I am trying to do: The image has a range of -1.0 to -0.5. I need to change the contrast to a different range, say -1.0 to -0.6. This fails when using the user interface, but works fine from a macro. I hope you are able to reproduce this problem. I tried this using ImageJ version 1.50c on Windows 7. It only seems to affect fairly large images, a few thousands of pixels each side. I have attached a sample image which is shrunk 10 times, so it can be expanded again to demonstrate the problem. I am unable to determine under what exact conditions this works and fails; it seems to fail 9 out of 10 times for me, on different computers. Stein Macro code: //original image too big to send by email, it was shrunk 10 times open("C:\\MyDownloadDir\\TestContrast-32bit-Shrinked-10.tif"); //restore original size by expanding 10 times run("Scale...", "x=10 y=10 width=3160 height=4360 interpolation=Bilinear average create title=TestContrast-32bit-Restored-10.tif"); //In this image the contrast range is Min -1.0, Max -0.50 run("Brightness/Contrast..."); //change the contrast, works fine from a macro showMessage("Changing contrast into range -1.0 to -0.6 works fine from a macro."); setMinAndMax(-1.0, -0.60); //restore contrast, works fine from a macro showMessage("Contrast will now be restored into range -1.0 to -0.50 by the macro."); setMinAndMax(-1.0, -0.50); showMessage("Now try to do the same from the user interface.\nPlease change the range to -1.0 to -0.6 using the Set button.\nThis usually fails, but not always."); -- ImageJ mailing list: http://imagej.nih.gov/ij/list.html -- ImageJ mailing list: http://imagej.nih.gov/ij/list.html |
Free forum by Nabble | Edit this page |