Finding Peaks on 2D waves and return coordinates

Sorry if this is a repost. I did some search but only one user replied to say it was easy (not for me I guess).

Here is the deal. I have a image imported into Igor and I would like to find the bright spot (they are usually much brighter than the background) and return its x-y coordinate.

What I do now is do a point to point compare on the whole image and find the brightest spot. This yields the brightest pixel on the image, I then reset this pixel and its nearest 3X3 pixel to be background, then repeat the whole process again.

My question is: is there a better and more efficient way to do this? Like a function that you can call to perform the task on a 2D wave?

Thanks in advance!
Hello liangcheng,

If you have some idea how to quantify the "spot" in terms of intensity one approach could be:

1. Obtain the max and min values of the data using WaveMin() and WaveMax().
2. Determine a threshold value Tv say 5% below the max.
3. Run ImageThreshold/T=Tv/i to segment the image.
4. Run ImageAnalyzeParticles on the thresholded image.

The result of (4) would give you everything you may want to know about the bright spot.

Note that there are various built-in threshold methods that might work well with your image. In that case the process would be:

1. ImageThreshold/i/M=methodOfChoice imageWave
2. ImageAnalyzeParticles

In some cases, if the shape of the spot is known, a 2D curve fit (e.g., to a Gaussian shape) could give you the spot's location.

If you have multiple bright spots that do not fall within the same intensity range then a couple of options come to mind:

1. Find all the spots within a given intensity interval, mask them in the ROI and iterate using any of the approaches I described above.

2. Remap your intensity range (e.g., convert to log scale) and then iterate as above.

HTH,

A.G.
WaveMetrics, Inc.
Thanks, I'll give it a try.

Igor wrote:
Hello liangcheng,

If you have some idea how to quantify the "spot" in terms of intensity one approach could be:

1. Obtain the max and min values of the data using WaveMin() and WaveMax().
2. Determine a threshold value Tv say 5% below the max.
3. Run ImageThreshold/T=Tv/i to segment the image.
4. Run ImageAnalyzeParticles on the thresholded image.

The result of (4) would give you everything you may want to know about the bright spot.

Note that there are various built-in threshold methods that might work well with your image. In that case the process would be:

1. ImageThreshold/i/M=methodOfChoice imageWave
2. ImageAnalyzeParticles

In some cases, if the shape of the spot is known, a 2D curve fit (e.g., to a Gaussian shape) could give you the spot's location.

If you have multiple bright spots that do not fall within the same intensity range then a couple of options come to mind:

1. Find all the spots within a given intensity interval, mask them in the ROI and iterate using any of the approaches I described above.

2. Remap your intensity range (e.g., convert to log scale) and then iterate as above.

HTH,

A.G.
WaveMetrics, Inc.

Encourage the author by voting for the package!

--Jim Prouty
Software Engineer, WaveMetrics, Inc.