Converting 8-bit grey values to 16-bit original values

segmentation

#1

Hi all,

Hopefully this is not too basic a question. How do I transform a grey value measured on a converted 8-bit image back to its original 16-bit value? I have a method (described below) but not sure it is giving reliable results

As background:

I am interested in extracting the mean grey values of bone in a whole body CT of mice and then comparing mean values of groups to values from a phantom. My original images are 16-bit signed RAW files.

I then thresholded out the bone as a 8 bit binary stack. Then I used image calculator to subtract this image from an 8-bit version of the original, leaving only pixels with bone with values higher than zero.

My understanding is that the 8-bit conversion transforms the 16-bit values with maximum becoming 255 and minimum 0. Therefore, I have to convert back to 16 bit to compare between different individuals and to grey values of phantoms.

To do that I wrote a linear equation for each stack using (0, 16 bit minimum) and (255, 16 bit max grey value). I then plug in my mean bone value to get the original 16 bit value for each stack. Is that correct or am I wrong?

Hope this is not too confusing.

Thanks,

Ben


Transperent background
#2

Good day Ben,

it is confusing …

In general there is no way back from 8bit to 16bit.

With 8bit images you can have 256 shades of gray, with 16bit you may have 65536 shades of gray.

So if you have a 16bit image that shows more than 256 shades of gray and you convert it to 8bit, you definitely loose gray-levels. They are gone for ever and won’t reappear if you convert back to 16bit. If you do the latter, you will see at best 256 shades of gray.

This doesn’t mean however, that your processing can’t be changed to circumvent this loss. But in order to help you with this, you need to describe more precisely what you want to do and why.

Regards

Herbie


#3

Hi,

Thanks for the info.

I want to measure bone density in mice responding to different types of treatment/injury.

I have in-vivo scans of the whole body. I want to threshold out only bone, clean out any noise, and calculate the mean grey value of the bone. This will be compared between groups, with bone density calculated using a phantom for calibration.

My issue is that to get mean bone grey values I had to convert 16-bit to 8 bit to apply a threshold and then subtract the thresholded image from the original to leave only the bone pixels. Does that make sense?

As I understand it 8-bit conversions are specific to the stack and cannot be compared across animals and phantoms from different scans, is that correct?

Is there anyway to do this analysis without converting to 8-bit so as to preserve the original grey values?

Thanks!


#4

PS: Or can I just convert everything to 8-bit tiff and compare across stacks?


#5

My issue is that to get mean bone grey values I had to convert 16-bit to 8 bit to apply a threshold and then subtract the thresholded image from the original to leave only the bone pixels. Does that make sense?

Not yet …

Is there anyway to do this analysis without converting to 8-bit so as to preserve the original grey values?

Please post a typical raw image in 16bit TIF-format as ZIP-archive or let us access it via a drop box.

Explain in detail what you want to extract and why you think this extraction needs thresholding.

As I understand it 8-bit conversions are specific to the stack and cannot be compared across animals and phantoms from different scans, is that correct?

No idea what you mean.

If possible, stay with 16bit images, because they contain much more gray-value information.

Please study the ImageJ User Guide to get an idea of the basics, such as image formats etc.:
https://imagej.nih.gov/ij/docs/guide/index.html

Regards

Herbie


#6

@Benjamin_Osipov

Your first aim is to get the regions you are interested in - ie - ‘bones’. You can use your images to convert to 8-bit, threshold, yada yada… what you want at the end is a binary mask and then segment the ‘bones’ using Analyze Particles or so… There are also some other plugins for segmentation you might find helpful (linked below). But in the end - you can overlay your saved regions over your ORIGINAL 16-bit image to measure your grey values. Does that make sense? That way - the conversions, etc. don’t affect anything and you don’t need to subtract the threshold image, etc. Take a look at the links I posted below…

If you have specific questions again - just ask.

eta


#7

Thank you, that worked!


#8

Thanks for your advice about staying in 16 bit. I used a new protocol to make that happen.