Skip to content

Sort-range attractive long-range repulsive particle clustering: a data clustering and pattern analysis method for locating the centroids of partially overlapping convex objects and distributions.

License

Notifications You must be signed in to change notification settings

jkpld/SALR_Clustering

Repository files navigation

SALR particle clustering

A method for locating the centers of partially overlapping convex objects and distributions.

This project is apart of the manuscript J. Kapaldo et al. (submitted).

SALR particle clustering is a simple technique for finding the centers of objects. It can be used to locate the centers of overlapping cell nuclei (see to the right), and it can be used to locate the cluster centers in scatter point data. Further details with examples can be seen at the »project website« and in the manuscript.

Installation

  1. Download the repository.
  2. Open Matlab on your computer, and change the current folder to the downloaded repository.
  3. Run setup.m. This function will
    • Add the necessary files to your Matlab path.
    • Attempt to compile two C functions that will increase the program speed. If a C compiler is not found on your computer, then the code will still run, but it could be slower.
  4. Start by browsing the examples located in the examples/ folder. These same examples can also be seed on the project website under examples.

Installation Notes

  • The GitHub repository could take a few minutes to download as the repository is ~200 MB. The majority of this space comes from the example data included.
  • setup.m will not permanently add the files to your Matlab path. If you want the files to remain on your Matlab path, the run the command savepath in the Matlab command window after running setup.m.

Requirements

  • Matlab version R2016b or higher. This is the first version that allows for implicit expansion, which is a feature heavily used in the code.
  • The Image Processing Toolbox.
  • The Statistics and Machine Learning Toolbox.
  • The Parallel Computing Toolbox - This toolbox is optional, but if you have it, then you will be able to run computations in parallel.

Example use

% Load test image
BW = imread('snowflake.tif');

% Setup parameters
options = seedPointOptions();
options.Wigner_Seitz_Radius = 4;
options.Potential_Parameters = [-1,2,10];
options.Iterations = 3;
options.Minimum_Cluster_Size = 2;
options.Debug = true;

% Compute seed-points
[seedPoints,Info] = computeObjectSeedPoints(logical(BW),options);

% Overlay onto the image the initial positions of all three iterations
% as small blue dots and the final seed-point locations as large red dots.
figure, imshow(BW), hold on;
plot(Info.r0(:,2),Info.r0(:,1),'.b','MarkerSize',3)
plot(seedPoints(:,2),seedPoints(:,1),'.r','MarkerSize',12)

About

Sort-range attractive long-range repulsive particle clustering: a data clustering and pattern analysis method for locating the centroids of partially overlapping convex objects and distributions.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published