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

Home » Public Forums » archive » Re: Image subtraction
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: Image subtraction [message #11635] Thu, 21 May 1998 00:00
pford is currently offline  pford
Messages: 33
Registered: September 1996
Member
Try
tvscl, image1 - A * image2

where A is a correction factor for intensity. One of the problems here is
how are negative numbers handled, should you change the images to float
to allow non integer As, and what value should A be, see? (I could not
resist the pun.)

To set values less than 0 to 0, you could use one of those matrix logical
something like: img = img * (img GE 0.0)
(I don't have the ref material handy and unlike many here, I need to
lookup all but the simplest of stuff.)

For A, there are many ways to determine a value, such as the average of
the images ratio, max ratio, etc. Or the one I commonly use, trial and
error.

You could always write(e-mail) the author of NIH Image to find out what he
is
doing, whose name escapes me. He
usually is fairly responsive, or you could examine the sourse code that,
at least in the past, was available.


BTW, is NIH image still just a Mac program?

Patrick Ford, MD
Baylor College of Medicine
pford@bcm.tmc.edu


FRANCOIS LAROSE (aah904@agora.ulaval.ca) wrote:
: Ok,

: Let me explain, I take two gray scale images and subtract them togethers.
: Then, I display the result on screen with TVSCL command. When I say, I get
: poor
: result, is because I compare the result of this subtraction with the
: result
: of a program that make image subtraction (NIH image). The two are very
: different. So, I suppose I should do something else to get the same
: result.

: For the package, I working in research so I can't afford a expensive one.
: Maybe, you can point me some web site...

: Tanks

: Frank

: At 09:59 18/05/98 -0600, you wrote:
: >you writes:
: >
: >> I need to do some image subtraction. With IDL, if I only do
: >> Image1 - image2 and I get poor result. Does it have best code to
: >> do image subtraction?
: >
: >Poor result how? Can't see it? Doesn't look like what
: >you expect? Don't believe the results?
: >
: >Try this:
: >
: > TV, BytScl(image1 - image2, top=!D.N_Colors-1)
: >
: >Does that help?
: >
: >> PS If you know a good package of image analisys in IDL, just let me
: know!
: >
: >How much would you be willing to pay for this? :-)
: >
: >David
: >
: >-----------------------------------------------------------
: >David Fanning, Ph.D.
: >Fanning Software Consulting
: >E-Mail: davidf@dfanning.com
: >Phone: 970-221-0438
: >Coyote's Guide to IDL Programming: http://www.dfanning.com/
: >
: >
Re: Image subtraction [message #11659 is a reply to message #11635] Tue, 19 May 1998 00:00 Go to previous message
FRANCOIS LAROSE is currently offline  FRANCOIS LAROSE
Messages: 2
Registered: May 1998
Junior Member
Ok,

Let me explain, I take two gray scale images and subtract them togethers.
Then, I display the result on screen with TVSCL command. When I say, I get
poor
result, is because I compare the result of this subtraction with the
result
of a program that make image subtraction (NIH image). The two are very
different. So, I suppose I should do something else to get the same
result.

For the package, I working in research so I can't afford a expensive one.
Maybe, you can point me some web site...

Tanks

Frank

At 09:59 18/05/98 -0600, you wrote:
> you writes:
>
>> I need to do some image subtraction. With IDL, if I only do
>> Image1 - image2 and I get poor result. Does it have best code to
>> do image subtraction?
>
> Poor result how? Can't see it? Doesn't look like what
> you expect? Don't believe the results?
>
> Try this:
>
> TV, BytScl(image1 - image2, top=!D.N_Colors-1)
>
> Does that help?
>
>> PS If you know a good package of image analisys in IDL, just let me
know!
>
> How much would you be willing to pay for this? :-)
>
> David
>
> -----------------------------------------------------------
> David Fanning, Ph.D.
> Fanning Software Consulting
> E-Mail: davidf@dfanning.com
> Phone: 970-221-0438
> Coyote's Guide to IDL Programming: http://www.dfanning.com/
>
>
Re: Image subtraction [message #11670 is a reply to message #11659] Mon, 18 May 1998 00:00 Go to previous message
davidf is currently offline  davidf
Messages: 2866
Registered: September 1996
Senior Member
FRANCOIS LAROSE (aah904@agora.ulaval.ca) writes:

> I need to do some image subtraction. With IDL, if I only do
> Image1 - image2 and I get poor result. Does it have best code to
> do image subtraction?

Poor result how? Can't see it? Doesn't look like what
you expect? Don't believe the results?

Try this:

TV, BytScl(image1 - image2, top=!D.N_Colors-1)

Does that help?

> PS If you know a good package of image analisys in IDL, just let me know!

How much would you be willing to pay for this? :-)

David

-----------------------------------------------------------
David Fanning, Ph.D.
Fanning Software Consulting
E-Mail: davidf@dfanning.com
Phone: 970-221-0438
Coyote's Guide to IDL Programming: http://www.dfanning.com/
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: accessing Siemens magnetom MR images
Next Topic: Re: Euclidean distance

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

Current Time: Wed Oct 08 16:00:53 PDT 2025

Total time taken to generate the page: 0.00800 seconds