Skip to content

AdvancedPhotonSource/MIDAS

Repository files navigation

MIDAS Logo

MIDAS — Microstructural Imaging using Diffraction Analysis Software

License

MIDAS is an open-source suite for reconstructing three-dimensional microstructures from High-Energy Diffraction Microscopy (HEDM) data. Developed at the Advanced Photon Source at Argonne National Laboratory, it supports the complete data-reduction pipeline — from raw detector frames to grain maps, strain tensors, spatially resolved orientation fields, and tomographic reconstructions.

Contact: Hemant Sharma (hsharma@anl.gov)


Key Capabilities

Technique What It Produces Detector Distance
Far-Field HEDM (FF-HEDM) Grain centroids, average orientations, full elastic strain tensors ≈ 1 m
Near-Field HEDM (NF-HEDM) Spatially resolved 3D orientation maps, grain morphology, grain boundary networks ≈ 5–10 mm
Point-Focus HEDM (PF-HEDM) High-resolution grain orientations from focused beam ≈ 1 m
Radial Integration (Caking) 1D intensity vs. 2θ profiles for Rietveld refinement (GSAS-II)
Tomography (CT) Absorption-contrast cross-sections via gridrec algorithm

Repository Layout

MIDAS/
├── FF_HEDM/          # Far-field HEDM analysis codes (calibration, indexing, fitting, integration)
├── NF_HEDM/          # Near-field HEDM reconstruction codes
├── DT/               # Data transformation utilities
├── TOMO/             # Tomographic reconstruction (gridrec CT engine)
├── utils/            # Python utilities (integrator, auto-calibration, workflow drivers)
├── gui/              # Interactive visualization GUI
├── manuals/          # Comprehensive documentation (see below)
├── cmake/            # CMake build configuration and dependency management
├── build.sh          # Build script (Linux / macOS)
├── build_wsl_windows.sh  # Build script (Windows via WSL)
├── environment.yml   # Conda environment specification
├── CMakeLists.txt    # Top-level CMake configuration
└── LICENSE           # UChicago Argonne open-source license

Documentation

Full manuals are in the manuals/ directory. Start with the manuals README for an overview of all HEDM techniques, coordinate systems, and a getting-started checklist.

Manual Topic
FF_calibration FF-HEDM geometry calibration
FF_Analysis FF-HEDM grain indexing and fitting
FF_RadialIntegration Radial integration / caking
FF_Interactive_Plotting Interactive FF-HEDM visualization
FF_dual_datasets Dual-dataset FF-HEDM analysis
PF_Analysis Point-Focus HEDM analysis
NF_calibration NF-HEDM detector calibration
NF_Analysis NF-HEDM reconstruction workflow
NF_MultiResolution_Analysis Multi-resolution NF-HEDM
NF_gui NF-HEDM interactive GUI
ForwardSimulationManual Forward simulation for validation
GSAS-II_Integration Importing MIDAS output into GSAS-II
Tomography_Reconstruction Absorption-contrast CT reconstruction

Installation

Prerequisites

Platform Requirements
macOS Homebrew, LLVM, libomp, GCC, CMake, jemalloc
Linux GCC ≥ 9, CMake ≥ 3.16
Windows WSL with Ubuntu

MIDAS automatically downloads and builds these C/C++ dependencies during compilation: NLOPT, LIBTIFF, FFTW, HDF5, BLOSC, BLOSC-2, ZLIB, LIBZIP.

Clone

git clone https://github.com/marinerhemant/MIDAS.git
cd MIDAS

macOS

  1. Install Homebrew (if not already installed):

    /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

    Without sudo access, install to your home directory:

    mkdir homebrew && curl -L https://github.com/Homebrew/brew/tarball/main | tar xz --strip-components 1 -C homebrew
    eval "$(homebrew/bin/brew shellenv)"
    brew update --force --quiet
    chmod -R go-w "$(brew --prefix)/share/zsh"

    Add Homebrew to your PATH:

    echo 'eval $(/opt/homebrew/bin/brew shellenv)' >> ~/.zshrc
    source ~/.zshrc
  2. Install dependencies:

    brew install llvm libomp gcc cmake jemalloc
  3. Configure environment variables:

    echo 'export PATH="/opt/homebrew/opt/llvm/bin:$PATH"' >> ~/.zshrc
    echo 'export LDFLAGS="-L/opt/homebrew/opt/llvm/lib $LDFLAGS"' >> ~/.zshrc
    echo 'export CPPFLAGS="-I/opt/homebrew/opt/llvm/include $CPPFLAGS"' >> ~/.zshrc
    echo 'export LDFLAGS="-L/opt/homebrew/opt/libomp/lib $LDFLAGS"' >> ~/.zshrc
    echo 'export CPPFLAGS="-I/opt/homebrew/opt/libomp/include $CPPFLAGS"' >> ~/.zshrc
    echo 'CC=/opt/homebrew/opt/gcc/bin/gcc-15' >> ~/.zshrc
    echo 'export CC' >> ~/.zshrc
    echo 'CXX=/opt/homebrew/opt/gcc/bin/g++-15' >> ~/.zshrc
    echo 'export CXX' >> ~/.zshrc
    source ~/.zshrc
  4. Build:

    ./build.sh

Linux

./build.sh

Windows (WSL)

sudo ./build_wsl_windows.sh

Disabling CUDA

./build.sh --cuda OFF

Building a Single Target

cd build
cmake --build . --target <TargetName>

Python Environment

conda env create -f environment.yml
conda activate midas_env

Quick Start

  1. Calibrate the detector geometry → FF_calibration
  2. Run FF-HEDM grain indexing and fitting → FF_Analysis
  3. Visualize results interactively → FF_Interactive_Plotting
  4. Reconstruct NF-HEDM orientation maps → NF_Analysis
  5. Validate with forward simulation → ForwardSimulationManual

See the manuals README for the full step-by-step checklist.


Citing MIDAS

If you use MIDAS in your research, please cite:

In review, citations coming soon.

FF-HEDM methodology:

H. Sharma, R. M. Huizenga & S. E. Offerman, "A fast methodology to determine the characteristics of thousands of grains using three-dimensional X-ray diffraction. I. Overlapping diffraction peaks and parameters of the experimental setup," J. Appl. Cryst. 45, 693–704 (2012). DOI: 10.1107/S0021889812025563

H. Sharma, R. M. Huizenga & S. E. Offerman, "A fast methodology to determine the characteristics of thousands of grains using three-dimensional X-ray diffraction. II. Volume, centre-of-mass position, crystallographic orientation and strain state of grains," J. Appl. Cryst. 45, 705–718 (2012). DOI: 10.1107/S0021889812025599


Acknowledgments

  • SGInfo library for HKL calculations
  • ODFPF package (Cornell) for misorientation functions

License

MIDAS is released under the UChicago Argonne open-source license.

Copyright © 2012, UChicago Argonne, LLC. All rights reserved.

This product includes software produced by UChicago Argonne, LLC under Contract No. DE-AC02-06CH11357 with the Department of Energy.

About

No description, website, or topics provided.

Resources

License

Contributing

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •