Hello,I tried to convert images from 32-bit to 8 bit, which contain a lot of zero pixels, and a few pixels with different values. I checked up in the help and found: ImageJ converts 16-bit and 32-bit images to 8-bit by linearly scaling from min--max to 0--255
Therefore I set one pixel to the value 255, and thought it will result in an 8-bit image, where the original pixel values will be displayed (all of them are smaller than 255, of course). But it did not happen. The original greates value was converted to 255 the others linearly scaled and the pixel which i set to 255 was also converted to 255. After hours of trial and error, i found that converting the image to results, and converting it back to image and then converting it to 8-bit gives the expected pixel values. My questiona are:Why is it so? How can I solve the problem without this back and forth conversion? all the bestsCsaba -- ImageJ mailing list: http://imagej.nih.gov/ij/list.html |
On Monday 05 Dec 2016 08:12:31 Csaba DÁVID wrote:
> After hours of trial and > error, i found that converting the image to results, and converting it back > to image and then converting it to 8-bit gives the expected pixel values. I do not understand what you mean by "converting the image to results". Anyway, in case it helps, are you aware that there is an option in: Edit>Options>Conversions...>Scale when converting Cheers Gabriel -- ImageJ mailing list: http://imagej.nih.gov/ij/list.html |
In reply to this post by Csaba DÁVID
Image > Adjust > Brightness/Contrast
Set (lower left button) the value you want to be zero and the value you want converted to 255. Image > Type > 8-bit ========================================================================= Michael Cammer, Microscopy Core & Skirball Institute, NYU Langone Medical Center Cell: 914-309-3270 Office: Skirball 2nd Floor main office, back right http://ocs.med.nyu.edu/microscopy & http://microscopynotes.com/ -----Original Message----- From: ImageJ Interest Group [mailto:[hidden email]] On Behalf Of Csaba DÁVID Sent: Monday, December 05, 2016 3:13 AM To: [hidden email] Subject: 32-bit to 8-bit conversion problem Hello,I tried to convert images from 32-bit to 8 bit, which contain a lot of zero pixels, and a few pixels with different values. I checked up in the help and found: ImageJ converts 16-bit and 32-bit images to 8-bit by linearly scaling from min--max to 0--255 Therefore I set one pixel to the value 255, and thought it will result in an 8-bit image, where the original pixel values will be displayed (all of them are smaller than 255, of course). But it did not happen. The original greates value was converted to 255 the others linearly scaled and the pixel which i set to 255 was also converted to 255. After hours of trial and error, i found that converting the image to results, and converting it back to image and then converting it to 8-bit gives the expected pixel values. My questiona are:Why is it so? How can I solve the problem without this back and forth conversion? all the bestsCsaba -- ImageJ mailing list: https://urldefense.proofpoint.com/v2/url?u=http-3A__imagej.nih.gov_ij_list.html&d=DgIFaQ&c=j5oPpO0eBH1iio48DtsedbOBGmuw5jHLjgvtN2r4ehE&r=oU_05LztNstAydlbm5L5GDu_vAdjXk3frDLx_CqKkuo&m=IVKQGoj1psYrOxyz18Hu7l4tZ72bod0Fn9gisWqAL18&s=3uCnHrEgIwiyHyIfuwNS8wJRKV136qXt0cOkU2Sa4IA&e= ------------------------------------------------------------ This email message, including any attachments, is for the sole use of the intended recipient(s) and may contain information that is proprietary, confidential, and exempt from disclosure under applicable law. Any unauthorized review, use, disclosure, or distribution is prohibited. If you have received this email in error please notify the sender by return email and delete the original message. Please note, the recipient should check this email and any attachments for the presence of viruses. The organization accepts no liability for any damage caused by any virus transmitted by this email. ================================= -- ImageJ mailing list: http://imagej.nih.gov/ij/list.html |
In reply to this post by Gabriel Landini
Thank you, it worked.
btw: by "converting the image to results" i meant Image/Transform/Image to Results, but i am very happy that i do not have to use it any more.Thank you againCheersCsaba On Monday, December 5, 2016 10:50 AM, Gabriel Landini <[hidden email]> wrote: On Monday 05 Dec 2016 08:12:31 Csaba DÁVID wrote: > After hours of trial and > error, i found that converting the image to results, and converting it back > to image and then converting it to 8-bit gives the expected pixel values. I do not understand what you mean by "converting the image to results". Anyway, in case it helps, are you aware that there is an option in: Edit>Options>Conversions...>Scale when converting Cheers Gabriel -- 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 |