comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Colour maps overlaid on grey-scale (medical) images
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Colour maps overlaid on grey-scale (medical) images [message #14668 is a reply to message #14614] Sun, 14 March 1999 00:00 Go to previous messageGo to previous message
steinhh is currently offline  steinhh
Messages: 260
Registered: June 1994
Senior Member
> Is it possible to overlay a colour map onto a grey-scale image
> without obliterating information in the grey-scale image ? ie: by making
> the colour overlay "transparent" to some degree ?

The way I understand your question, you want to blend together
two images containing different types of information.

I believe the easiest way to do this is by working in RGB "space"
to blend the two images together into one image and then display
the composite image.

If you normally use colour tables, one simpleminded approach
would be the following (assuming image1 and image2 are of equal
size, and scaled to byte values match the available number of
colours):

; load/modify your grayscale colour table "as usual"
:
; Now, to read this colour table:
tvlct,r,g,b,/get

; Form an RGB image from the byte-scaled image1
im1rgb = [[[r[image1]]],[[g[image1]]],[[b[image1]]]]

; Load/modify your "hot body colour scale"
:
; Then we read it:
tvlct,r,g,b,/get

; Form RGB image from image2
im2rgb = [[[r[image2]]],[[g[image2]]],[[b[image2]]]]

; Take the average of the two images (avoid byte overflow!)

im = byte((fix(im1rgb) + fix(im2rgb))/2)

; Now the trick: Use color_quan to quantize the existing
; colors into one color table:
im_out = COLOR_QUAN(im, 3, red, green, blue)

; Now, load the appropriate color table and display image.
tvlct,red,green,blue
tv,im_out

A better/more flexible approach would be to make some kind of
direct color coding formula based on the actual data to be shown,
i.e:

red_image = func_red(bloodflow,brain_image)
grn_image = func_green(bloodflow,brain_image)
blu_image = func_blue(bloodflow,brain_image)

;; Then:

im = color_quan(red_image,grn_image,blu_image,r,g,b)
tvlct,r,g,b
tv,im

But be warned: Finding good formulas for the final RGB color
based on the input bloodflow/brain_image data can be quite a
challenge!

Best of luck.

Stein Vidar
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: clipboard objects and postscript (unix)
Next Topic: working with very large data sets

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Fri Oct 10 03:16:51 PDT 2025

Total time taken to generate the page: 0.08101 seconds