find puntual maximum in a 3D array.
4 views (last 30 days)
Show older comments
Hi, I have a 3D array with values of intensity in each voxel. Now I need to find some point sources of intensity that are inside de array, The problem is that there are other voxels with more intensity but they aren't puntual sources.
I add an image of a sagital plane that show which local maximum I want to find.
If I would have only one dimension datas I would use findpeacks and the information of width at half prominence, but I'm lost doing it in a 3D array.
Thank you for your time.
0 Comments
Answers (1)
Sam Cook
on 13 Jun 2018
If you're looking for the local maxima, and you have the Image Processing Toolbox, you can use the imregionalmax function. It returns a logical matrix that identifies the points that you need. From there, you can determine which regions you are specifically looking for.
[X,Y] = meshgrid(0:0.5:10, 0:0.5:10);
Z = min(cos(X) + sin(Y), 1.5);
surf(X, Y, Z);
ix = imregionalmax(Z);
hold on
scatter3(X(ix), Y(ix), Z(ix), 'r', 'LineWidth', 5);
0 Comments
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!