Skip to content

Repository files navigation

Nd_spacing — README

Overview

This subfolder contains the Python port of the original MATLAB image analysis pipeline for measuring local Nd-rich spacing and orientations from micrographs. The main entrypoint is the ANALYSE_IMAGES.py script that:

  • reads images,
  • performs contrast enhancement & background-corrected binarisation,
  • computes spacing (local mean distances) and orientations,
  • computes distributions/histograms and exports results per image.

Pipeline (high level)

  1. Image & parameters:

  2. Binarisation:

    • CLAHE + background correction + thresholding (Otsu or adaptive).
    • Implementation: binarisation
  3. Spacing & statistics:

  4. Orientation:

  5. Post-processing / export:

Files of interest

Quick start

  1. Install dependencies:
    pip install -r requirements.txt
  2. Configure PARAMETRES.py for your dataset (sample names, photo counts, paths).
  3. Run the analyzer from the Nd_spacing folder:
    python ANAYLSE_IMAGES.py
    (Script prints progress and writes per-image XLSX in the "Résultats" folder.)

Configuration notes

  • Binarisation parameters (CLAHE clip_limit, tile_grid_size, blur kernel, threshold method, adaptive block_size/C) are configurable in the binarisation call made by ANALYSE_IMAGES.py.
  • Distribution parameters such as dmax and pasdistri are imported from PARAMETRES.py and used by distribution.

Implementation quirks & pointers

  • The pipeline mirrors the original MATLAB flow (see Code_matlab_OT_original for the MATLAB reference).
  • The binarisation routine applies CLAHE then optional Gaussian background estimation before thresholding.
  • distribution computes histogram class boundaries consistent with the MATLAB original.
  • If you want to inspect intermediate outputs, ANALYSE_IMAGES.py writes masks and labeled images (TIFF) for debugging.

____________________________________________________

external folders

segment every grain

Segmenteverygrain on github

DDPM

Conditional Denoising Diffusion Probabilistic Model for the Cast-Forged AZ80 Microstructure

DDPM on github

This is the implementation of conditional denoising diffusion probabilistic model to generate SEM microstructure images of seen and unseen cast-forged AZ80 magnesium alloy components. The model is conditioned based on the cast geometry, casting cooling rate, soaking process, pre-forging heat treatment, forging temperature, location of extracted metallography sample, and magnification.

Please cite our paper as follows: E. Azqadan, H. Jahed, A. Arami, Predictive microstructure image generation using denoising diffusion probabilistic models, Acta Mater. 261 (2023), 119406, https://doi.org/10.1016/j.actamat.2023.119406.

The following repositories were used as inspiration for this implementation: https://github.com/dome272/Diffusion-Models-pytorch/tree/main https://github.com/lucidrains/denoising-diffusion-pytorch https://github.com/CompVis/latent-diffusion

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages