Skip to content

A peak-finding routine in Matlab for (electron) diffraction images

License

Notifications You must be signed in to change notification settings

RealPolitiX/peakfind2D

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

50 Commits
 
 
 
 
 
 
 
 

Repository files navigation

peakfind2D

A peak-finding routine in Matlab for static and time-resolved (electron) diffraction images

Advantages

  1. No need to consider the symmetry group
  2. Not based on gradients (robust to noise)

Limitations

  1. Have trouble distinguishing highly overlapping peaks
  2. May not find all peaks for complex low-symmetry diffraction patterns, especially if certain diffraction peaks exhibit nonconvex shapes (e.g. due to crystallite shape, the level of orientational disorder/mosaicity)

General steps (see example)

  1. Load diffraction image
  2. Apply median filter to the image to remove salt-and-pepper noise (medfilt2)
  3. Center-blocking (centerblock)
  4. Disection of image matrix into small blocks of the same size (matsect)
  5. Find the region with potential peaks (peak candidates) according to ranking of summed intensity (findPeakCandidates)
  6. Apply distance filter to the peak candidates (distanceFilter)
  7. Apply Gaussian filter to the peak candidates 1-2 times (GaussfitFilter)
  8. Calculate the averaged intensity of a number of pixels around the peak (avgnearest)

Major free parameters (see example)

  1. Center position (rcent, ccent) and radii (rrad, crad) in centerblock
  2. Disected block image matrix dimensions in matsect along the row and column directions (runit, cunit).
  3. Distance limit in distanceFilter (dist): depends on the density/sparsity of peaks in the diffraction pattern (easily estimated by eye). A sound choice can reduce computation cost for the following steps.
  4. Intensity ranking cutoff in findPeakCandidates (ntop): usually in the hundreds or more (0 < ntop < total number of block matrices after matsect).

Visualization of results (see example below)

N.B. the intensity at the peak locations are set to zero for better illustration in the visualization functions

  1. Peak-location-annotated images (peakLocationPlot) Si electron diffraction pattern
  2. Panel plot of all found peaks (peakPanelPlot) Peak gallery #1 Peak gallery #2 Peak gallery #3

About

A peak-finding routine in Matlab for (electron) diffraction images

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages