Skip to content

A collection of functions work together to analyze, visualize, and save data about particles in segmented images, including their statistics, identifying clusters, and connection pathways and providing associated stats.

License

Notifications You must be signed in to change notification settings

SivaKumarValluri/9.Tracking-Percolation-in-Powder-Packed-Beds

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 

Repository files navigation

Defining Clustering and Tracking Percolation

The modules in this code accept segmented SEM/optical images of white particles in black background to provide particle stats as well as cluster stats. Additional modules follow connected paths between particles and offer plotting convinience. image

Here's a summary of what each section of the Python code does:

1.Regionprops_Irregular_Particle_Analyzer: (Not very effective use module 2 for sizing and particle identification )

- Purpose: Analyzes particles in a segmented image using skimage.

- Inputs:

    segmentedimage: The segmented image to analyze.
    
    choice2: User choice to display plots or not.
    
- Outputs:

    * Displays plots of particle centroids, orientations, and bounding boxes if choice2 indicates to show plots.
    
    * Returns a dataframe with particle statistics including area, centroid, orientation, and axis lengths.

2.Particle_Finder_and_Sizer_with_Statistics:

- Purpose: Identifies particles using OpenCV contours and computes various statistics.

- Inputs:

    * img_gray: The grayscale segmented image.
    
    * imagename: Name of the image for labeling results.
    
- Outputs:

    Returns:
    
    * Contours of identified particles.
    
    * A dataframe with particle statistics such as centroid, area, perimeter, bounding circle, and rectangle details.
    
    * Bounding boxes for each particle.

Here is an example image of segmented image supplied that is used to identify particles (red outlines):

image

3.Cluster_Finder_with_Statistics: (Contact Network Clustering)

- Purpose: Finds and analyzes clusters of particles based on their contact points.

- Inputs:

    *contours: Contours of particles. (from previous module)
    
    *img_gray: The grayscale segmented image.
    
    *address: Path to save images.
    
    *imagename: Name of the image for labeling results.
    
    *choice2: Whether to save images.
    
    *choice3: Whether to display images.
    
- Outputs:

    Returns:
    
    *A dataframe with cluster statistics including bounding rectangle dimensions, number of particles in each cluster, and indices of particles in clusters.
    
    *A dataframe of contact points between particles.
    
    *Optionally saves and/or displays images with cluster outlines.

Here is a sequence of representative images showcasing contact identification at particle scale and clustering based on friend-of-friends algorithm:

image

Some more images showcasing function's capabilities:

image

Typical data obtained plotted:

image

The effectiveness of current approach (using Friend-of-Friend alogrithm) in obtains stats such as average cluster size is shown as compared to sizes obtained from radial density correlation:

image

4.Connection_Paths_Finder:

- Purpose: Finds overlapping or connection pathways between particles.

- Inputs:

    * img_gray: The grayscale segmented image.
    
    * contours: Contours of particles.
    
    * thresholddistance: Distance threshold for dilation to find overlapping regions.
    
- Outputs:

    Returns an overlap/connection pathway mask where particles are connected based on the threshold distance.

Here are some connection paths identified and dilated to generate masks to capture emissions at contact points/interfaces: image

Use case example: image

5. Particle_Plotter_Image_Saver:

- Purpose: Plots and saves images with identified particles and bounding boxes.

- Inputs:

    * img_gray: The grayscale segmented image.
    
    * contours: Contours of particles.
    
    * boundingboxes: Bounding boxes for particles.
    
    * address: Path to save images.
    
    * choice2: Whether to save images.
    
    * choice3: Whether to display images.
    
- Outputs:

    Optionally saves and/or displays an image with particle contours and bounding boxes.

Overall, these functions work together to analyze, visualize, and save data about particles in segmented images, including their statistics, clusters, and connection pathways.

About

A collection of functions work together to analyze, visualize, and save data about particles in segmented images, including their statistics, identifying clusters, and connection pathways and providing associated stats.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages