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

Home » Public Forums » archive » Re: Help With Finding Local Maxima of an Image (locmax)
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: Help With Finding Local Maxima of an Image (locmax) [message #65833 is a reply to message #65826] Wed, 25 March 2009 12:41 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
einszweilieb@gmail.com writes:

> I'm trying to use R. Sterner's "locmax" function (see below) to find
> local maxima (peaks of intensities) in an image. I'm a bit of a
> newbie to IDL so forgive me if my questions are silly :)
>
> As far as I can tell, all I need to do is read in the image (img) and
> use the command "locmax, img". Is that correct?
>
> When I do this I get the error message which says something like
> "return statements in functions must have 1 value" Line 79 (i.e. the
> second to last line below with the "return" statement).
>
> What's going wrong here? Why is the function trying to return
> multiple values? Isn't that what it's supposed to do - return all of
> the places where there's a local max?
>
> Can anyone help me with this? Does anyone know of any other
> procedures/functions which do similar things?

Here is the problem:

> function locmax, img, mask=m, where=w, ix=ix, iy=iy, sort=srt, $
> values=v, value_image=vimg, noedge=noed, help=hlp

Change the word "function" to "pro", compile it, and try it again.
I think this is a typo in the code, because clearly he meant for you
to call this as a procedure, not as a function.

Cheers,

David
--
David Fanning, Ph.D.
Coyote's Guide to IDL Programming (www.dfanning.com)
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
[Message index]
 
Read Message
Read Message
Previous Topic: Re: Passing more than one variable out of a function.
Next Topic: Reading Multiple DICOM Files

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

Current Time: Sat Oct 11 12:46:14 PDT 2025

Total time taken to generate the page: 0.64040 seconds