Skip to content

BDehapiot/ETH-ScopeM_Krupke

Repository files navigation

Python Badge TensorFlow Badge CUDA Badge cuDNN Badge
Author Badge Date Badge License Badge

ETH-ScopeM_Krupke

Fluorescent dye intra-tissue diffusion analysis
This code is published here: https://doi.org/10.1016/j.jconrel.2025.113947
Published version: "v1.0-paper"

Index

Installation

Pease select your operating system

Windows

Step 1: Download this GitHub Repository

  • Click on the green <> Code button and download ZIP
  • Unzip the downloaded file to a desired location

Step 2: Install Miniforge (Minimal Conda installer)

  • Download and install Miniforge for your operating system
  • Run the downloaded .exe file
    • Select "Add Miniforge3 to PATH environment variable"

Step 3: Setup Conda

  • Open the newly installed Miniforge Prompt
  • Move to the downloaded GitHub repository
  • Run one of the following command:
# TensorFlow with GPU support
mamba env create -f environment_tf_gpu.yml
# TensorFlow with no GPU support 
mamba env create -f environment_tf_nogpu.yml
  • Activate Conda environment:
conda activate Krupke

Your prompt should now start with (Krupke) instead of (base)

MacOS

Step 1: Download this GitHub Repository

  • Click on the green <> Code button and download ZIP
  • Unzip the downloaded file to a desired location

Step 2: Install Miniforge (Minimal Conda installer)

  • Download and install Miniforge for your operating system
  • Open your terminal
  • Move to the directory containing the Miniforge installer
  • Run one of the following command:
# Intel-Series
bash Miniforge3-MacOSX-x86_64.sh
# M-Series
bash Miniforge3-MacOSX-arm64.sh

Step 3: Setup Conda

  • Re-open your terminal
  • Move to the downloaded GitHub repository
  • Run one of the following command:
# TensorFlow with GPU support
mamba env create -f environment_tf_gpu.yml
# TensorFlow with no GPU support 
mamba env create -f environment_tf_nogpu.yml
  • Activate Conda environment:
conda activate Krupke

Your prompt should now start with (Krupke) instead of (base)

Usage

process.py

Read .lif images from data_path folder, process and save outputs in a new folder named according to image name.

  • Paths
- img_name         # str, image name ("all" for batch processing)
- data_path        # str, path to folder containing image(s) to process
- model_mass_path  # str, path to DL segmentation model
  • Parameters
- df               # int, downscaling factor, should be kept at 30 (DL model)
  • Outputs
- image.tif        # uint16, downscaled image
- prediction.tif   # float32, DL segmentation prediction
- mask.tif         # uint8, tissue segmentation mask
- outline.tif      # uint8, tissue surface mask
- metadata.txt     # df, original and downscaled pixel size in µm
- metadata.pkl     # df, original and downscaled pixel size in µm

procedure

correct.py

Read all processed images from data_path and display outline for manual corrections in Napari. Erase the undesired surface and press enter to save the corrected outline_hc.

  • Paths
- data_path        # str, path to folder containing image(s) to process
  • Parameters
- erase_size       # int, size in pixel(s) of erasing tool
- paint_size       # int, size in pixel(s) of painting tool
  • Outputs
- outline_hc.tif   # uint8, corrected tissue surface mask

procedure

analyse.py

Read all processed images from data_path and compute Euclidean distance transform edt of outline_hc to measure fluorescence intensities according to the distance from the surface. If not 0, the baseline_pc paramater define the percentage of lowest values that will be considered to define a baseline to define a baseline which will be subtracted from the measured values.

  • Paths
- data_path        # str, path to folder containing image(s) to process
  • Parameters
- max_bin          # int, max bin distance in µm
- num_bins         # int, number of bins between 0 and max_bin
- baseline_pc      # float, percentage (0 to 100) of lowest values to be considered baseline
  • Outputs
- image_bsub.tif   # float32, baseline subtracted image
- edt.tif          # float32, Euclidean distance transform of outline_hc
- display.tif      # RGB, image and outline_hc overlay 
- results.csv      # intensities acc. to distance in µm
- results.png      # plot of intensities acc. to distance in µm
- metadata.txt     # add baseline
- metadata.pkl     # add baseline

procedure

Comments

About

Fluorescent dye intra-tissue diffusion analysis

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages