Skip to content

The package to process rock chemical maps as dimensionally reduced flat images in RGB while maximing the original images content of any micro-analysis technique.

License

Notifications You must be signed in to change notification settings

marcoaaz/chemistry_simplifier

Repository files navigation

Chemistry Simplifier

The package to process rock chemical maps as dimensionally reduced flat images in RGB while maximing the original images content of any micro-analysis technique.

Version: 1.1
Binary download: Executable link (for Windows 11)
Author: Dr Marco Acevedo Z. (maaz.geologia@gmail.com)
Affiliation: School of Earth and Atmospheric Sciences, Queensland University of Technology
Date: 20-February-2026
Citation: Acevedo Zamora et al. 2024
Previous repository: Scripts repository


📖 Overview

Chemistry simplifier allows researchers to do pixel-based image analysis of full resolution micro-analysis maps (e.g., intensity from X-ray lines, mass spectrometry analytes) of any laboratory instrument into representation images using linear and non-linear dimensionality reduction. The available methods are Principal component analysis (PCA), the Uniform Manifold Approximation and Projection (UMAP), and the Symmetrical deep sparse autoencoder (DSA) neural network. The data-driven approach does not demand thinking on the input as much as reduction process parametrisation.

Colourful image outputs are rapidly produced and are much simpler to understand than the separate original inputs since they are richer in information (texture). We call them pseudo-phase maps and they can be friendlier for image segmentation with pixel classification in QuPath (Bankhead et al., 2017), see pixel classifier tool.

Locally, the output intermediate/final montages are saved in a structured folder sequence for each trial/tag combination (see interface). All processing metadata is recorded for potential future documentation in research papers.

Image

With trialling and well-characterised samples, I demonstrated that:

  • PCA tends to focus on mineralogy while DSA is attentive to compositional zonation within crystals
  • PCA is much faster and can more robust to noisy and/or artefact image inputs than DSA
  • UMAP is good at distinguishing mineralogy and superior at denoising the output (grain/zone boundaries) than PCA because it is a non-linear method

🚀 Features

Core Functionality

  • Graphical User Interface (GUI) following three steps for processing a large number of chemical maps with ease
  • High reliability and performance due to parallelised implementation
  • Image file parsing to find your experiment in an input folder using regular expressions
  • Basic image processing to adjust image contrast and flip input/outputs
  • Central image stack menu to select/edit data inputs and models
  • Parametrisation and performance menus for adjusting DSA and UMAP models, pixel sampling and input (training) and output (prediction) image size

Adaptive Interface

  • Grid design - adapts to the window size

🖥️ Requirements*

The current Chemistry simplifier version was demonstrated to work on Windows 11 OS.

  • Python 3.9.13 for making "numba > llvm requirement" work
  • PyQt5 5.15.11 for running GUI (designed with PyQt5-tools)
  • pyinstaller 6.16.0 for compiling with modified generated main.spec file*
  • multiprocessing (included with most Python installations) for parallel processing
  • pickle (included with most Python installations) for saving scalers/models
  • Additional libraries:
    • pyvips 3.0.0** - for enabling extreme processing speed with image pyramid processing link
    • umap-learn 0.5.9.post2 - for UMAP link
    • numba 0.60.0 - for UMAP guts link
    • torch 2.8.0+cu126 - for DSA link
    • scikit-learn 1.6.1 - for incremental PCA link

*Ensure the main.spec file contains:

datas=[
    ("icons", "icons"),        
    ("c:/vips-dev-8.16/bin", "vips"),                
    ("E:/Alienware_March 22/current work/00-new code May_22/dimReduction_v2/chemSimplifier3/Lib/site-packages/llvmlite/*", "llvmlite"),        
    ("E:/Alienware_March 22/current work/00-new code May_22/dimReduction_v2/chemSimplifier3/Lib/site-packages/llvmlite/binding/*", "llvmlite/binding"),
    ],
hiddenimports=['numba.core.runtime', 'numba.core.registry'],
  • **pyvips requires internally defining the path to libvips binaries (Windows DLL) in your PC. I downloaded the folder from link and unzipped to 'c:/vips-dev-8.16/bin'

📁 Versions Available

Cube converter v1 (main.py)

  • File to call the functionality and app interface (cubeConverter_v3.py)
  • Suitable for reading and processing VSI files (CellSense format) saved from Evident VS200 slide scanner (at QUT)
  • All metadata extraction features included

⌨️ Creating the Executable

  1. In VSCode or Anaconda, create/activate
  2. pip install -r requirements.txt
  3. In the terminal, run:
pyinstaller main.py
  1. Edit the main.spec file (see edits in Requirements section above)
pyinstaller main.spec
  1. The executable will be generated next to a bundled app folder at:
    "..<your-environment-name>\dist\Chemistry Simplifier v1\Chemistry Simplifier v1.exe"

📦 Packaged Executable

  • Chemistry simplifier v1.exe works for Windows 11 and it is not fully self contained (for efficiency while opening the app)
  • A Terminal will be open to indicate the progress of processing your file
  • An Error handling mechanism pops up if the user inputs a wrong value in the GUI options. For persistent errors, please, send me a screenshot

Issues and future work

  • This version can be improved with user feedback
  • You are welcome to reach out and share your developing ideas with me. Under a scientific collaboration project, I could help you design, implement, and trial new Cube converter software options.
  • I had in mind:
    • Cloud implementation with more processing cores
  • Support for Mac OS and Linux

Related papers

The software depends on open-source, scientific citations and user feedback. The following research papers already have contributed to its evolution (directly or indirectly):

  • Acevedo Zamora, M. A., Kamber, B. S., Jones, M. W. M., Schrank, C. E., Ryan, C. G., Howard, D. L., Paterson, D. J., Ubide, T., & Murphy, D. T. (2024). Tracking element-mineral associations with unsupervised learning and dimensionality reduction in chemical and optical image stacks of thin sections. Chemical Geology, 650, 121997. https://doi.org/10.1016/j.chemgeo.2024.121997
  • Acevedo Zamora, M. (2024). Petrographic microscopy of geologic textural patterns and element-mineral associations with novel image analysis methods [Thesis by publication, Queensland University of Technology]. Brisbane. https://eprints.qut.edu.au/248815/
  • Ubide, T., Murphy, D. T., Emo, R. B., Jones, M. W. M., Acevedo Zamora, M. A., & Kamber, B. S. (2025). Early pyroxene crystallisation deep below mid-ocean ridges. Earth and Planetary Science Letters, 663, 119423. https://doi.org/10.1016/j.epsl.2025.119423

Thanks.
Marco

About

The package to process rock chemical maps as dimensionally reduced flat images in RGB while maximing the original images content of any micro-analysis technique.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages