find first or second maximum in a cell containing stacks of images

1 view (last 30 days)
Hey
I have a cell containing 26 dipimage(size 111*111*17) Now i want for each pixel value in the original dipimage to know the second maximum of the 26 values corresponding to that pixel.
Since the size a loop is not really an option. The dipimage part is not really relevant if there is a normal matlab way.
grtz
Rob
  1 Comment
Image Analyst
Image Analyst on 17 Mar 2012
Just wondering ... why is a loop not an option because of the size? A loop can certainly be used with small arrays like this. There is no minimum size limit that says an array has to be bigger than a certain size. It would work fine with your small array.

Sign in to comment.

Answers (2)

Image Analyst
Image Analyst on 17 Mar 2012
Use
meanValue = max(dipImage3D, [], 3);
to get the max value of each of the 26 images. Then set them to nan or the min values, so now the second highest value will now be the highest. Now you have 26 images that are only 2D instead of 2D. Then you can convert those 26 2D images into a 3D image in a variety of ways and use the same code to find the second highest max value for each x,y pixel location.

rob
rob on 17 Mar 2012
well maybe i should elaborate further. Every pixel is the reslult of a convolution on a 3d volume of pixels with a sphere of several radius. So each of the 26 volumes corresponds to a different radius. Usually the highest maximum(real maxium) is not the correct one i need the one with a small radius and high value.
  1 Comment
Image Analyst
Image Analyst on 17 Mar 2012
Not sure what that means, but it sounds like you need some sort of image restoration algorithm like Richardson-Lucy or something similar (see the help). Are you saying each cell is one 2D image and that image was convolved several times with PSFs (kernels) or different radii? Well you know from the central limit theorem that that would be pretty darn close to convolving with a Gaussian.

Sign in to comment.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!