This repository contains the code for a Cellpose-SAM & pyLMD project dedicated to automating cell boundary and reference point detection in microscopic images used for Laser Capture Microdissection (LMD).
The primary function of this repository is to identify the boundaries of target cells and detect precise reference points from laser engraved 'T' structures and is designed to enhance the reproducibility of the LMD workflow.
This project exclusively uses the Pixi package manager to guarantee a reliable and isolated Python environment. Install Instructions
-
Clone the repository:
git clone https://github.com/YourUsername/lmd-imageanalysis.git cd lmd-imageanalysis -
Initialize the Pixi Environment:
Pixi reads the required dependencies from the
pixi.tomlfile and creates a ready-to-use virtual environment.pixi install
The analysis pipeline is contained in the lmd_nb.py script. This file is a Jupyter Notebook utilizing the Jupytext percent format, which allows it to be edited easily in any text editor while preserving its executable notebook structure.
Before running the pipeline, you must configure the parameters and channel mapping within the lmd_nb.py script:
- Channel Configuration: The fluorescence channel assignments must be set to match your input image data.
- Default Setup: The notebook is currently defaulted to: Marker (Ch 0), Autofluorescence (Ch 1), and DAPI (Ch 2). Adjust these channel indices (0-indexed) at the beginning of
lmd_nb.pyas needed.
- Default Setup: The notebook is currently defaulted to: Marker (Ch 0), Autofluorescence (Ch 1), and DAPI (Ch 2). Adjust these channel indices (0-indexed) at the beginning of
- Parameter Adjustment: Parameters for specific processing steps can be adjusted directly before their corresponding notebook cells in
lmd_nb.py.
Once configured, execute the pipeline using the following command:
pixi run python lmd_nb.py