MathGroup Archive 2010

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Changing image from grey-scale to another

  • To: mathgroup at smc.vnet.net
  • Subject: [mg109902] Re: Changing image from grey-scale to another
  • From: Matthias Odisio <matthias at wolfram.com>
  • Date: Sat, 22 May 2010 00:41:01 -0400 (EDT)

Jason,


On 5/21/10 5:45 AM, ebaugh at illinois.edu wrote:
> How would one convert a grey scale image into another color
> scale?
>
> By "another color-scale" I mean rather than rendered in shades
> of grey, rendered in shades of a different color.
>
> Many thanks,
> Jason
>
>
> In case you were wondering why I am asking:
> I am attempting to use Mathematica to analyse microarray data.
> The capture software outputs multi-image tifs.
> One image represents a green wavelength, another image
> represents a green wave length. But they are rendered in grey
> scale. These images get combined to give a ratio of the two
> wavelength, but for that to work, they have to be converted from
> greyscale.

I'm unsure I understood what you're looking for, so my answers may be 
too widespread.

Did you mean that one image represents a green wavelength and the other 
other one a red wavelength?

 From your two single-channel images imggreen and imgred, you can create 
a RGB color image like that, creating a blue channel that is equal to 0 
everywhere:

ColorCombine[{imgred, imggreen, ImageMultiply[imgred, 0]}]

Or would you like to visualize the two images in two different colors?
ImageApply[#*{1, 0, 0} &, imgred]
ImageApply[#*{0, 1, 0} &, imggreen]

If you'd like to compute a ratio between, say, the log of the pixel values:

lr = Log[2, 1 + ImageData[imgred, "Byte"]];
lg = Log[2, 1 + ImageData[imggreen, "Byte"]];
ratio = lr - lg

ListPlot[Transpose[Flatten /@ {.5*(lg + lr), lr - lg}]]

Matthias Odisio
Wolfram Research


  • Prev by Date: Re: Changing image from grey-scale to another
  • Next by Date: Re: combining ArrayPlot with ListLinePlot
  • Previous by thread: Re: Changing image from grey-scale to another
  • Next by thread: Re: Numerical solution of differential equation with boundary