From: Rahul on 25 Sep 2009 16:25 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 25 Sep 2009 17:17 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 25 Sep 2009 17:27 Oops sorry, change 'min' to 'max', imerode to imdilate. Bruno
From: Rahul on 25 Sep 2009 19:05 "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 25 Sep 2009 19:47 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
|
Next
|
Last
Pages: 1 2 3 4 5 Prev: finding eigenvalues of a sparce matrix Next: Removing a data cursor programmatically |