From: Rahul on
I have a numerical (x,y,z) dataset with multiple peaks (local maxima) in it
that I want to detect. I've seen many routines for (x,y) peak detection but
none that I know so far do it for (x,y,z) data.

Any routines around that I am missing?

--
Rahul
From: Bruno Luong on
Rahul <nospam(a)nospam.invalid> wrote in message <Xns9C919CEBE24EA6650A1FC0D7811DDBC81(a)188.40.43.213>...
> I have a numerical (x,y,z) dataset with multiple peaks (local maxima) in it
> that I want to detect. I've seen many routines for (x,y) peak detection but
> none that I know so far do it for (x,y,z) data.
>
> Any routines around that I am missing?
>


You could you this file minmaxfilt on FEX.
http://www.mathworks.com/matlabcentral/fileexchange/24705

% Data
A=rand(100,100,100);

% Engine
Amin=minmaxfilt(A,3,'min','same'); % alternatively use imerode in image processing
[i j k]=ind2sub(size(A),find(Amin==A)); % <- index of local minima

% Remove index in the borders if interested in inside local minima only
% Keep this steps otherwise
idxkeep=find(i>1 & i<100 & j>1 & j<100 & k>1 & k<100);
i=i(idxkeep);
j=j(idxkeep);
k=k(idxkeep);

% Bruno
From: Bruno Luong on
Oops sorry, change 'min' to 'max', imerode to imdilate.

Bruno
From: Rahul on
"Bruno Luong" <b.luong(a)fogale.findmycountry> wrote in news:h9jc0f$5vg$1
@fred.mathworks.com:

> You could you this file minmaxfilt on FEX.
> http://www.mathworks.com/matlabcentral/fileexchange/24705
>
>

Thanks Bruno. Your code seems to be doing exactly what I want!

But I get an error when I use it:

#####################################
Amin=minmaxfilt(A,3,'min','same'); % alternatively use imerode in image
processing
??? Attempt to execute SCRIPT lemire_nd_minengine as a function:
C:\Documents and Settings\rpnabar\My Documents\Downloads\MinMaxFilterFolder
\MinMaxFilterFolder\lemire_nd_minengine.m

Error in ==> minmaxfilt at 117
[minval minidx] = lemire_nd_minengine(minval, minidx, win,
shapeloc);
########################################

Any clues what I am doing wrong?



--
Rahul
From: Rahul on
Rahul <nospam(a)nospam.invalid> wrote in
news:Xns9C91B815B24F6650A1FC0D7811DDBC81(a)188.40.43.213:

> \MinMaxFilterFolder\lemire_nd_minengine.m
>
> Error in ==> minmaxfilt at 117
> [minval minidx] = lemire_nd_minengine(minval, minidx, win,
> shapeloc);
>########################################
>
> Any clues what I am doing wrong?
>
>

Stupid me! Got that figured out. Needed a mex compile.


--
Rahul