Skip to main content

A simple tool to manually register multiple MSI-related images

Project description

DOI

Installation

  • The main branch always has the latest version. Download, install requirements.txt, and run msiAlign.py.
  • The latest binary is available here.
    Note: You may get a trojan warning due to a PyInstaller issue (see discussions here, here, and here).
    It's a false positive; allow it to run in your antivirus settings.

Known Bugs

  • Binary post-25.10.2024 is incompatible with previous workspace versions. For older compatibility, use this binary version here.
  • Fixed: Vertical lines may not delete properly.
  • Fixed: Teaching points don’t update when images move.
  • Fixed: Duplicate images re-added without warning.

Usage Guide

Quick Start

  • Metadata Database (for MSI only): Go to File > Crawl Metadata and select your directory.
  • Add Images: Use File > Add Images, selecting whether it’s a reference image (for cm/pixel alignment).
  • Organize Images: Drag images and resize. Use Ctrl+Click to add alignment lines.
  • Calculate cm/pixel: Place vertical lines on ruler marks, right-click, set as "scale lines," and select Calc > cm/Px.
  • Sediment Start: Right-click a vertical line and select "Sediment Start."
  • Teaching Points: Add teaching points by Shift+Click. The distance from sediment start will auto-calculate.

Preparing for Analysis

  • MSI Analysis: Select Calc > Prep MSI, attach the metadata, and pair teaching points manually or automatically. Submit to calculate transformations.
  • XRF Analysis: Select Calc > Prep XRF. Pair teaching points and submit to calculate transformations. Specify XRF data path when asked to generate depth and mask data, which is saved in the same directory as the XRF data.
  • Note the format of Teaching Points pairs: TP Pair Format

Depth Profile

  • Go to Calc > Downcore Profile to generate depth profiles. Ensure MSI exports are named exactly after spectrum data (e.g., xxxx.d has xxxx.d.txt).
    • Spot method: three methods are available when averaging 2D data into 1D profiles.
      • all: all compounds listed in "Target cmpds" must be present in the spectrum, or the spectrum is ignored.
      • any: at least one compound listed in "Target cmpds" must be present in the spectrum, or the spectrum is ignored.
      • user input: based on the compound list (separated by ;) provided by the user, the spectrum is ignored if any of the listed compounds are not present.
    • Dynamic spot averaging: dynamically adjusting the spot size to ensure a minimum number of spectra are averaged instead of dropping them.
      • MSI res (um): the resolution of the MSI data in microns
      • Max extra rows: the maximum number of rows to add to the spot size to ensure the minimum number of spectra are averaged. If the number of spectra is still below the minimum after adding the maximum number of rows, all spectra within the horizon are ignored.

Useful Functions

  • Save/Load Canvas: Save workspace via File > Save Workspace (JSON file), reload with File > Load Workspace.
  • Teaching Point Coordinates: Use View > Update TP View.
  • Developer Tools: Access extra functions with Ctrl + P.

TODO

  • Implement a fallback prompt for unmatched names, asking for user input (spec_id or spec_file_name).

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

msialign-1.0.0.tar.gz (40.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

msialign-1.0.0-py3-none-any.whl (44.9 kB view details)

Uploaded Python 3

File details

Details for the file msialign-1.0.0.tar.gz.

File metadata

  • Download URL: msialign-1.0.0.tar.gz
  • Upload date:
  • Size: 40.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for msialign-1.0.0.tar.gz
Algorithm Hash digest
SHA256 f4aaa25b39d925e0a7e1ec921d1762638042e0675d2bc259463bf2a9f02a337e
MD5 f16c9cc02bf3fbe1311be566f23f6355
BLAKE2b-256 ad00d113fc8e7281766df4a5dbabe892ebb187a0ed24670ffbf8275e9babbf69

See more details on using hashes here.

File details

Details for the file msialign-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: msialign-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 44.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for msialign-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8ce00a304f6eb4aca6227f21c4d27b63813a48b45644e6d87ab4c0c88483c2d4
MD5 3d05df0a0dd6733c800cf05b1bc854b9
BLAKE2b-256 fc95a6471d42fb940f88501fe1ce588590c3fb13837b89fbaa62702eee337180

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page