32 bit color LUT editor

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

32 bit color LUT editor

Knecht, David
I would like to do a ratio of two images and then color code the 32 bit result so that pixels greater than 1 are coded in one gradation of color (red) and the pixels less than 1 are coded in another color gradation (green) to highlight areas which have different relative amounts of two fluorescent proteins.  The color LUT editor appears to be only in 0-255 so how do I do this?  Thanks- Dave

Dr. David Knecht
Professor of Molecular and Cell Biology
Core Microscopy Facility Director
University of Connecticut
91 N. Eagleville Rd.
Storrs, CT 06269
860-486-2200


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

Re: 32 bit color LUT editor

Michael Schmid
Hi Dave,

in ImageJ, LUTs are always 8 bits wide.
For 16-bit and 32-bit images, they apply to the display range that you can define with setMinAndMax in a macro or the 'Set' button of the Brightness&Contrast panel.

So, define a LUT with values 0-127 in the color used for negative numbers, and 128-255 for the positive side, and make sure that the display range is symmetric around zero (e.g. min= -5, max= +5).

But don't use red and green: a significant percentage of the male population in Europe or the US won't be able to distinguish these colors due to dichromacy (color blindness).

There are ImageJ plugins to examine what an image looks like with various types of dichromacy, e.g. on Gabriel Landini's web site
  http://www.mecourse.com/landinig/software/software.html

Michael
________________________________________________________________
On May 28, 2015, at 15:09, David Knecht wrote:

> I would like to do a ratio of two images and then color code the 32 bit result so that pixels greater than 1 are coded in one gradation of color (red) and the pixels less than 1 are coded in another color gradation (green) to highlight areas which have different relative amounts of two fluorescent proteins.  The color LUT editor appears to be only in 0-255 so how do I do this?  Thanks- Dave

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

Re: 32 bit color LUT editor

Kenneth R Sloan
With a ratio image, you may want to take extra care.

The idea is to map your expected range of values to [0,255].  You have values which fall in
[0.0, 1.0) on the one hand, and (0.0,<pick a big number>) on the other hand (with 1.0 being the dividing line.

So, the trick is to design a mapping s.t.:

0.0 -> 0

1.0 -> 127

<pick a big number> -> 254

greater than <pick a big number> -> 255

The reason I specify <pick a big number> is that you probably don’t want to go out to infinity, but rather have some value in mind that is as big as you want to consider

I would then design a LUT for which:

0 —> a distinctive color meaning 0.0000000

[1,126] —> color representing one side

127 -> a distinctive color meaning “the two images match here”

[128, 254] -> color representing the other side

255 -> a distinctive color meaning “to infinity, and beyond”

That leaves you with 5 colors to choose.  I won’t step into the debate on who can see what colors.  If all you need is a binary distinction - use BLACK and WHITE.  The “distinctive colors” representing single values can be dispensed with - but I recommend keeping them.

So - your remaining problem is to produce the mapping from [0.0, <pick a big number>] -> [0,255].

Again, if you simply need two values (less than 1, greater than 1), this is fairly easy.  I recommend working out a mapping that scales the two sides of your scale to something close to linear - so that if you were to swap the images and then invert the ratio image you would get exactly the same image.

Good luck.


--
Kenneth Sloan
[hidden email]
Vision is the art of seeing what is invisible to others.




> On May 28, 2015, at 08:27 , Michael Schmid <[hidden email]> wrote:
>
> Hi Dave,
>
> in ImageJ, LUTs are always 8 bits wide.
> For 16-bit and 32-bit images, they apply to the display range that you can define with setMinAndMax in a macro or the 'Set' button of the Brightness&Contrast panel.
>
> So, define a LUT with values 0-127 in the color used for negative numbers, and 128-255 for the positive side, and make sure that the display range is symmetric around zero (e.g. min= -5, max= +5).
>
> But don't use red and green: a significant percentage of the male population in Europe or the US won't be able to distinguish these colors due to dichromacy (color blindness).
>
> There are ImageJ plugins to examine what an image looks like with various types of dichromacy, e.g. on Gabriel Landini's web site
>  http://www.mecourse.com/landinig/software/software.html
>
> Michael
> ________________________________________________________________
> On May 28, 2015, at 15:09, David Knecht wrote:
>
>> I would like to do a ratio of two images and then color code the 32 bit result so that pixels greater than 1 are coded in one gradation of color (red) and the pixels less than 1 are coded in another color gradation (green) to highlight areas which have different relative amounts of two fluorescent proteins.  The color LUT editor appears to be only in 0-255 so how do I do this?  Thanks- Dave
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html


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

Re: 32 bit color LUT editor

Michael Schmid
Hi Kenneth, Dave,

oops, sorry, I forgot a step:

The method I considered was meant for the logarithm of the ratio. It the ratio is 1, the logarithm is zero. If the ratio is 0.5 or 2, the deviation from zero will be the same.

It does not work if there are pixel values of 0 in one of the image; the division will result in infinity or the logarithm of 0 will be NaN.

Michael
________________________________________________________________
On May 28, 2015, at 16:31, Kenneth R Sloan wrote:

> With a ratio image, you may want to take extra care.
>
> The idea is to map your expected range of values to [0,255].  You have values which fall in
> [0.0, 1.0) on the one hand, and (0.0,<pick a big number>) on the other hand (with 1.0 being the dividing line.
>
> So, the trick is to design a mapping s.t.:
>
> 0.0 -> 0
>
> 1.0 -> 127
>
> <pick a big number> -> 254
>
> greater than <pick a big number> -> 255
>
> The reason I specify <pick a big number> is that you probably don’t want to go out to infinity, but rather have some value in mind that is as big as you want to consider
>
> I would then design a LUT for which:
>
> 0 —> a distinctive color meaning 0.0000000
>
> [1,126] —> color representing one side
>
> 127 -> a distinctive color meaning “the two images match here”
>
> [128, 254] -> color representing the other side
>
> 255 -> a distinctive color meaning “to infinity, and beyond”
>
> That leaves you with 5 colors to choose.  I won’t step into the debate on who can see what colors.  If all you need is a binary distinction - use BLACK and WHITE.  The “distinctive colors” representing single values can be dispensed with - but I recommend keeping them.
>
> So - your remaining problem is to produce the mapping from [0.0, <pick a big number>] -> [0,255].
>
> Again, if you simply need two values (less than 1, greater than 1), this is fairly easy.  I recommend working out a mapping that scales the two sides of your scale to something close to linear - so that if you were to swap the images and then invert the ratio image you would get exactly the same image.
>
> Good luck.
>
>
> --
> Kenneth Sloan
> [hidden email]
> Vision is the art of seeing what is invisible to others.
>
>
>
>
>> On May 28, 2015, at 08:27 , Michael Schmid <[hidden email]> wrote:
>>
>> Hi Dave,
>>
>> in ImageJ, LUTs are always 8 bits wide.
>> For 16-bit and 32-bit images, they apply to the display range that you can define with setMinAndMax in a macro or the 'Set' button of the Brightness&Contrast panel.
>>
>> So, define a LUT with values 0-127 in the color used for negative numbers, and 128-255 for the positive side, and make sure that the display range is symmetric around zero (e.g. min= -5, max= +5).
>>
>> But don't use red and green: a significant percentage of the male population in Europe or the US won't be able to distinguish these colors due to dichromacy (color blindness).
>>
>> There are ImageJ plugins to examine what an image looks like with various types of dichromacy, e.g. on Gabriel Landini's web site
>> http://www.mecourse.com/landinig/software/software.html
>>
>> Michael
>> ________________________________________________________________
>> On May 28, 2015, at 15:09, David Knecht wrote:
>>
>>> I would like to do a ratio of two images and then color code the 32 bit result so that pixels greater than 1 are coded in one gradation of color (red) and the pixels less than 1 are coded in another color gradation (green) to highlight areas which have different relative amounts of two fluorescent proteins.  The color LUT editor appears to be only in 0-255 so how do I do this?  Thanks- Dave
>>
>> --
>> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
>
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html

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

Re: 32 bit color LUT editor

Knecht, David
As I said below, I am now focused on using image subtraction so getting negative numbers in one color range and positive in the other.  Can I do that?  Dave

On May 28, 2015, at 2:48 PM, Michael Schmid <[hidden email]<mailto:[hidden email]>> wrote:

Hi Kenneth, Dave,

oops, sorry, I forgot a step:

The method I considered was meant for the logarithm of the ratio. It the ratio is 1, the logarithm is zero. If the ratio is 0.5 or 2, the deviation from zero will be the same.

It does not work if there are pixel values of 0 in one of the image; the division will result in infinity or the logarithm of 0 will be NaN.

Michael
________________________________________________________________
On May 28, 2015, at 16:31, Kenneth R Sloan wrote:

With a ratio image, you may want to take extra care.

The idea is to map your expected range of values to [0,255].  You have values which fall in
[0.0, 1.0) on the one hand, and (0.0,<pick a big number>) on the other hand (with 1.0 being the dividing line.

So, the trick is to design a mapping s.t.:

0.0 -> 0

1.0 -> 127

<pick a big number> -> 254

greater than <pick a big number> -> 255

The reason I specify <pick a big number> is that you probably don’t want to go out to infinity, but rather have some value in mind that is as big as you want to consider

I would then design a LUT for which:

0 —> a distinctive color meaning 0.0000000

[1,126] —> color representing one side

127 -> a distinctive color meaning “the two images match here”

[128, 254] -> color representing the other side

255 -> a distinctive color meaning “to infinity, and beyond”

That leaves you with 5 colors to choose.  I won’t step into the debate on who can see what colors.  If all you need is a binary distinction - use BLACK and WHITE.  The “distinctive colors” representing single values can be dispensed with - but I recommend keeping them.

So - your remaining problem is to produce the mapping from [0.0, <pick a big number>] -> [0,255].

Again, if you simply need two values (less than 1, greater than 1), this is fairly easy.  I recommend working out a mapping that scales the two sides of your scale to something close to linear - so that if you were to swap the images and then invert the ratio image you would get exactly the same image.

Good luck.


--
Kenneth Sloan
[hidden email]<mailto:[hidden email]>
Vision is the art of seeing what is invisible to others.




On May 28, 2015, at 08:27 , Michael Schmid <[hidden email]> wrote:

Hi Dave,

in ImageJ, LUTs are always 8 bits wide.
For 16-bit and 32-bit images, they apply to the display range that you can define with setMinAndMax in a macro or the 'Set' button of the Brightness&Contrast panel.

So, define a LUT with values 0-127 in the color used for negative numbers, and 128-255 for the positive side, and make sure that the display range is symmetric around zero (e.g. min= -5, max= +5).

But don't use red and green: a significant percentage of the male population in Europe or the US won't be able to distinguish these colors due to dichromacy (color blindness).

There are ImageJ plugins to examine what an image looks like with various types of dichromacy, e.g. on Gabriel Landini's web site
http://www.mecourse.com/landinig/software/software.html

Michael
________________________________________________________________
On May 28, 2015, at 15:09, David Knecht wrote:

I would like to do a ratio of two images and then color code the 32 bit result so that pixels greater than 1 are coded in one gradation of color (red) and the pixels less than 1 are coded in another color gradation (green) to highlight areas which have different relative amounts of two fluorescent proteins.  The color LUT editor appears to be only in 0-255 so how do I do this?  Thanks- Dave

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


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

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

Dr. David Knecht
Professor of Molecular and Cell Biology
Core Microscopy Facility Director
University of Connecticut
91 N. Eagleville Rd.
Storrs, CT 06269
860-486-2200


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

Re: 32 bit color LUT editor

Michael Schmid
Hi Dave,

if you subtract the images, don't use the logarithm. Just set the display range symmetric around 0, e.g. min=-100, max=+100. Then any LUT with one hue for 0-127 and another hue for 128-255 should be fine.

Michael
________________________________________________________________
On May 28, 2015, at 22:48, Knecht, David wrote:

> As I said below, I am now focused on using image subtraction so getting negative numbers in one color range and positive in the other.  Can I do that?  Dave
>
> On May 28, 2015, at 2:48 PM, Michael Schmid <[hidden email]<mailto:[hidden email]>> wrote:
>
> Hi Kenneth, Dave,
>
> oops, sorry, I forgot a step:
>
> The method I considered was meant for the logarithm of the ratio. It the ratio is 1, the logarithm is zero. If the ratio is 0.5 or 2, the deviation from zero will be the same.
>
> It does not work if there are pixel values of 0 in one of the image; the division will result in infinity or the logarithm of 0 will be NaN.
>
> Michael
> ________________________________________________________________
> On May 28, 2015, at 16:31, Kenneth R Sloan wrote:
>
> With a ratio image, you may want to take extra care.
>
> The idea is to map your expected range of values to [0,255].  You have values which fall in
> [0.0, 1.0) on the one hand, and (0.0,<pick a big number>) on the other hand (with 1.0 being the dividing line.
>
> So, the trick is to design a mapping s.t.:
>
> 0.0 -> 0
>
> 1.0 -> 127
>
> <pick a big number> -> 254
>
> greater than <pick a big number> -> 255
>
> The reason I specify <pick a big number> is that you probably don’t want to go out to infinity, but rather have some value in mind that is as big as you want to consider
>
> I would then design a LUT for which:
>
> 0 —> a distinctive color meaning 0.0000000
>
> [1,126] —> color representing one side
>
> 127 -> a distinctive color meaning “the two images match here”
>
> [128, 254] -> color representing the other side
>
> 255 -> a distinctive color meaning “to infinity, and beyond”
>
> That leaves you with 5 colors to choose.  I won’t step into the debate on who can see what colors.  If all you need is a binary distinction - use BLACK and WHITE.  The “distinctive colors” representing single values can be dispensed with - but I recommend keeping them.
>
> So - your remaining problem is to produce the mapping from [0.0, <pick a big number>] -> [0,255].
>
> Again, if you simply need two values (less than 1, greater than 1), this is fairly easy.  I recommend working out a mapping that scales the two sides of your scale to something close to linear - so that if you were to swap the images and then invert the ratio image you would get exactly the same image.
>
> Good luck.
>
>
> --
> Kenneth Sloan
> [hidden email]<mailto:[hidden email]>
> Vision is the art of seeing what is invisible to others.
>
>
>
>
> On May 28, 2015, at 08:27 , Michael Schmid <[hidden email]> wrote:
>
> Hi Dave,
>
> in ImageJ, LUTs are always 8 bits wide.
> For 16-bit and 32-bit images, they apply to the display range that you can define with setMinAndMax in a macro or the 'Set' button of the Brightness&Contrast panel.
>
> So, define a LUT with values 0-127 in the color used for negative numbers, and 128-255 for the positive side, and make sure that the display range is symmetric around zero (e.g. min= -5, max= +5).
>
> But don't use red and green: a significant percentage of the male population in Europe or the US won't be able to distinguish these colors due to dichromacy (color blindness).
>
> There are ImageJ plugins to examine what an image looks like with various types of dichromacy, e.g. on Gabriel Landini's web site
> http://www.mecourse.com/landinig/software/software.html
>
> Michael
> ________________________________________________________________
> On May 28, 2015, at 15:09, David Knecht wrote:
>
> I would like to do a ratio of two images and then color code the 32 bit result so that pixels greater than 1 are coded in one gradation of color (red) and the pixels less than 1 are coded in another color gradation (green) to highlight areas which have different relative amounts of two fluorescent proteins.  The color LUT editor appears to be only in 0-255 so how do I do this?  Thanks- Dave
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
>
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
>
> Dr. David Knecht
> Professor of Molecular and Cell Biology
> Core Microscopy Facility Director
> University of Connecticut
> 91 N. Eagleville Rd.
> Storrs, CT 06269
> 860-486-2200
>
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html

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