Conversion to 32-bit resets the contrast range

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Conversion to 32-bit resets the contrast range

Stein Rørvik
Here is another issue related to min/max values:

If you convert an 8-bit or 16-bit image to 32-bit, the contrast range is changed, so that the current min/max values are lost.

In the below demo macro we see that the T1 Head image (which is not density calibrated)
is reset to a min,max range of 0,230 which seems to be a bit arbitrary.

The CT image (which is density calibrated) is reset to the min/max values of the image.

I see no reason not to preserve the min/max values in these cases, as the dynamic range of the image is always preserved when converting to higher bit depths.

------------------------------
print("\\Clear");

run("T1 Head (2.4M, 16-bits)");
setSlice(nSlices/2);
getMinAndMax(min, max);
print(min, max);
run("32-bit");
getMinAndMax(min, max);
print(min, max);

run("CT (420K, 16-bit DICOM)");
getMinAndMax(min, max);
print(min, max);
run("32-bit");
getMinAndMax(min, max);
print(min, max);
------------------------------

I am using daily build ImageJ 1.52k with Java 1.6 on Windows 7/64-bit.


Stein


--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

Re: Conversion to 32-bit resets the contrast range

Cammer, Michael-2
For macros I often find it is useful to keep the contrast scaling and channel colors in variables (usually an array of # channels) to reapply after processing or remerging.
Cheers-
Michael C

-----Original Message-----
From: Stein Rørvik <[hidden email]>
Sent: Friday, January 11, 2019 5:41 AM
To: [hidden email]
Subject: Conversion to 32-bit resets the contrast range

Here is another issue related to min/max values:

If you convert an 8-bit or 16-bit image to 32-bit, the contrast range is changed, so that the current min/max values are lost.

In the below demo macro we see that the T1 Head image (which is not density calibrated) is reset to a min,max range of 0,230 which seems to be a bit arbitrary.

The CT image (which is density calibrated) is reset to the min/max values of the image.

I see no reason not to preserve the min/max values in these cases, as the dynamic range of the image is always preserved when converting to higher bit depths.

------------------------------
print("\\Clear");

run("T1 Head (2.4M, 16-bits)");
setSlice(nSlices/2);
getMinAndMax(min, max);
print(min, max);
run("32-bit");
getMinAndMax(min, max);
print(min, max);

run("CT (420K, 16-bit DICOM)");
getMinAndMax(min, max);
print(min, max);
run("32-bit");
getMinAndMax(min, max);
print(min, max);
------------------------------

I am using daily build ImageJ 1.52k with Java 1.6 on Windows 7/64-bit.


Stein


--
ImageJ mailing list: https://urldefense.proofpoint.com/v2/url?u=http-3A__imagej.nih.gov_ij_list.html&d=DwIFAw&c=j5oPpO0eBH1iio48DtsedbOBGmuw5jHLjgvtN2r4ehE&r=vfUn-WSoz3z11I1Wutm3wYYMExfQInQ6nJuvEPYzlnE&m=3XGlb2M6UGFsnpF6ug1R7mJWD-0ljIS4lUCyd2SYocQ&s=gMB2hNsEUlunnW_t_hj4-DeTB57wBCeUAQAMheH3Xq8&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
Reply | Threaded
Open this post in threaded view
|

Re: Conversion to 32-bit resets the contrast range

Wayne Rasband-2
In reply to this post by Stein Rørvik
> On Jan 11, 2019, at 5:40 AM, Stein Rørvik <[hidden email]> wrote:
>
> Here is another issue related to min/max values:
>
> If you convert an 8-bit or 16-bit image to 32-bit, the contrast range is changed, so that the current min/max values are lost.

This bug is fixed in the latest ImageJ daily build (1.52k17).

-wayne

> In the below demo macro we see that the T1 Head image (which is not density calibrated)
> is reset to a min,max range of 0,230 which seems to be a bit arbitrary.
>
> The CT image (which is density calibrated) is reset to the min/max values of the image.
>
> I see no reason not to preserve the min/max values in these cases, as the dynamic range of the image is always preserved when converting to higher bit depths.
>
> ------------------------------
> print("\\Clear");
>
> run("T1 Head (2.4M, 16-bits)");
> setSlice(nSlices/2);
> getMinAndMax(min, max);
> print(min, max);
> run("32-bit");
> getMinAndMax(min, max);
> print(min, max);
>
> run("CT (420K, 16-bit DICOM)");
> getMinAndMax(min, max);
> print(min, max);
> run("32-bit");
> getMinAndMax(min, max);
> print(min, max);
> ------------------------------
>
> I am using daily build ImageJ 1.52k with Java 1.6 on Windows 7/64-bit.

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html