If the code is useful for you, please cite the paper below.
"On-the-fly Segmentation Approaches for X-ray Diffraction Datasets for Metallic Glasses" authored by Fang Ren, Travis Williams, Jason Hattrick-Simpers, Apurva Mehta, in revision, MRS Communications.
A copy can be shared upon request.