Skip to content

Gleghorn-Lab/LymphNodeReconstruction

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Lymph Node Reconstruction

A MATLAB-based toolkit for processing, aligning, and analyzing lymph node tissue sections from multi-stack microscopy images. This repository provides tools for image alignment, segmentation, and morphological analysis of lymph node structures including lobules and vasculature.

Overview

This project facilitates the reconstruction and analysis of lymph node tissue by:

  • Aligning multiple image stacks of lymph node sections
  • Segmenting tissue structures using advanced thresholding techniques
  • Detecting and analyzing lobules and vasculature networks

Requirements

  • MATLAB (R2016b or later recommended)
  • Image Processing Toolbox (required for image registration and morphological operations)
  • Computer Vision Toolbox (required for imregtform and related functions)

Files

Core Scripts

Align_LymphNode_MultiStacks.m

Main alignment script for registering multiple stacks of lymph node sections. This script:

  • Loads and processes two image stacks simultaneously
  • Allows interactive selection of reference images from each stack
  • Performs rigid image registration using multimodal and monomodal optimization
  • Applies transformations to align entire stacks based on reference sections
  • Saves aligned images with standardized naming conventions

Usage:

  1. Run the script in MATLAB
  2. Select all images for the first stack when prompted
  3. Enter the section number for the reference (fixed) image
  4. Select all images for the second stack when prompted
  5. Enter the section number for the moving image
  6. Trace regions of interest in both reference images for alignment
  7. Review aligned results and save outputs

Key Features:

  • Interactive region-of-interest selection via freehand tracing
  • Automatic scaling and transformation application to full-resolution images
  • Visual comparison of aligned images before saving

hysteresis3d.m

A utility function for performing trinarisation and hysteresis thresholding on 2D and 3D images. This function is inspired by Peter Kovesi's 2D hysteresis implementation and extends it to 3D using MATLAB's imfill function.

Function Signature:

[tri, hys] = hysteresis3d(img, t1, t2, conn)

Parameters:

  • img - Input image (assumed non-negative)
  • t1 - Lower threshold value (fraction between 0-1, e.g., 0.1)
  • t2 - Upper threshold value (fraction between 0-1, e.g., 0.9)
  • conn - Connectivity (4 or 8 for 2D; 6, 18, or 26 for 3D)

Returns:

  • tri - Trinarisation image (values: 0, 1, or 2)
  • hys - Hysteresis image (logical mask)

Example:

[tri, hys] = hysteresis3d(img, 0.25, 0.8, 26);

Reference:
For an example of hysteresis used in kidney region segmentation, see: QSM of Kidney, NMR Biomed, 2013 Dec;26(12):1853-63
Supplemental material: http://www.civm.duhs.duke.edu/lx201204/

lobule.m

Script for detecting and segmenting lobules in lymph node tissue sections. This script:

  • Processes multi-channel images (purple, red, merged channels)
  • Uses hysteresis thresholding for initial segmentation
  • Applies morphological operations (dilation, erosion) to refine boundaries
  • Identifies and visualizes lobule boundaries

Note: This script contains hardcoded file paths and may need modification for your specific image files.

vasC.m

Script for vasculature detection and segmentation in lymph node tissue. This script:

  • Processes multi-channel fluorescence images
  • Segments vasculature using hysteresis thresholding
  • Filters connected components by area
  • Applies morphological smoothing operations
  • Overlays detected vasculature boundaries on original images

Note: This script contains hardcoded file paths and may need modification for your specific image files.

Usage Workflow

Typical Analysis Pipeline

  1. Image Alignment (Align_LymphNode_MultiStacks.m)

    • Align multiple image stacks to create a coherent 3D reconstruction
    • Ensure proper spatial registration between sections
  2. Structure Segmentation

    • Use lobule.m for lobule detection
    • Use vasC.m for vasculature detection
    • Both scripts utilize hysteresis3d.m for robust thresholding
  3. Analysis

    • Process aligned and segmented images for quantitative analysis
    • Extract morphological features from detected structures

Notes

  • File Paths: Some scripts (lobule.m, vasC.m) contain hardcoded file paths that should be modified to match your data structure
  • Image Formats: Scripts are designed to work with TIFF images, but can be adapted for other formats
  • Memory Considerations: The alignment script loads entire image stacks into memory; ensure sufficient RAM for large datasets
  • Interactive Elements: The alignment script requires user interaction for file selection and region tracing

Citation

If you use hysteresis3d.m in your research, please cite:

  • Xie, L. (2012). Hysteresis3d: 3D hysteresis thresholding for image segmentation.
    Related work: QSM of Kidney, NMR Biomed, 2013 Dec;26(12):1853-63

License

Coming soon.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages