Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # @ImagePlus(label = 'Input Image') imp
- # @Integer(label = 'Noise tolerance', value=10) tol
- from ij import IJ
- from ij.plugin.filter import MaximumFinder
- s = imp.getStack()
- def findAllMaxima(stack, tol = 10):
- X = []
- Y = []
- Z = []
- I = []
- for i in range(s.getSize()):
- mf = MaximumFinder()
- p = s.getProcessor(i+1)
- P = mf.getMaxima(p, 10, True)
- X = X + [x for x in P.xpoints]
- Y = Y + [y for y in P.ypoints]
- Z = Z + [i]*P.npoints
- I = I + [p.getPixel(x,y) for x,y in zip(P.xpoints,P.ypoints)]
- return zip(X,Y,Z,I)
- print findAllMaxima(s,tol)
Add Comment
Please, Sign In to add comment