Particle Analysis help
Catalin B.
I am analyzing some STEM pictures of nano particles using Igor Pro. I have successfully removed the background, enhanced the contrast and used the ImageAnalyzeParticles in order to identify the particles' area, number, boundaries and so on. I have also approximated the particles using the ellipse option.
My question is: is there a way in which I can obtain all of the intensity values of the pixels inside the boundaries of each ellipse ("particle")? I want to integrate over these values or perform other operations such as adding them or plotting etc.
Thank you.
The most direct solution I can think of is to set up a loop over all the detected particles, where you create a masking image for each of the particles. This can be done using the "mark" keyword to ImageAnalyzeParticles. Then simply sum all the pixels that belong to the mask.
Here's the solution in pseudocode:
wave M_MySegmentedImage // result of thresholding
for (i = 0; i < numParticles; i+=1)
variable xx = W_SpotX[i]
variable yy = W_SpotY[i]
ImageAnalyzeParticles /L=(xx, yy) mark M_MySegmentedImage
wave M_ParticleMarker
M_ParticleMarker = (M_ParticleMarker[p][q] == 0) ? 1 : 0
// M_ParticleMarker now contains 1 if this pixel belongs to this particle, 0 otherwise
MatrixOP W_SummedIntensities = sum(M_MyRealData * M_ParticleMarker)
// W_SummedIntensities[0] now contains the summed intensity for particle i
endfor
I assume my code may fail if you have funny-looking particles (e.g. ring-shaped) where the pixel at (W_SpotX, W_SpotY) may not be part of the object. That can be overcome but takes a bit more work.
March 21, 2013 at 03:40 am - Permalink
You can get the integrated values from ImageAnalyzeParticles if you use the (somewhat obscure) /D flag. For example, if your original image is in wave1 and your thresholded image is in wave2 then:
This will create for you (among other things) the waves W_IntAvg and W_ImageObjArea. If you multiply the respective entries you get the integrated intensities, i.e.,
I hope this helps,
A.G.
WaveMetrics, Inc.
March 21, 2013 at 10:03 am - Permalink
March 25, 2013 at 03:25 am - Permalink
Would these be the integrated intensities for each individual particle?
C
March 26, 2013 at 10:32 am - Permalink
Yes.
Each entry in W_IntAvg corresponds to a particle's average intensity which is computed from the integrated intensity divided by the number of pixels in each particle. If you now multiply these entries by the corresponding number of pixels (stored in W_ImageObjArea) you should get the integrated intensity for each particle.
AG
March 26, 2013 at 10:49 am - Permalink