Skip to content

Latest commit

 

History

8 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SAMWOOD

Segmentation and Quantitative Analysis of Wood Anatomical Sections (Modern & Fossil) Using SAM2

SamWood is an open-source Python package designed to automate the segmentation and measurement of wood cells in transverse sections of both modern and fossil samples. It uses SAM2 (Segment Anything Model 2), a state-of-the-art Vision Transformer for zero-shot segmentation, and a dedicated algorithms to reconstruct cell files and extract anatomical traits along growth gradients.

image

Installation

Dependencies installation

We rely on some dependencies :

  • sam2 for the deep learning segmentation,
  • opencv-python and tifffile for image handling,
  • scipy and pandas for cell lines graph analysis,
  • matplotlib as an optional dependency for plots.

Please check sam2 documentation for sam2 installation instructions.

Samwood installation

To install, you can use the following command

pip install git+https//github.com/umr-amap/samwood.git

Segment cells on an image

To work, samwood must find the sam2 model config and corresponding weights. By default, the script will search for a ./sam2 path within this project but you can provide another path. You also need to provide an input path and output path. The script assumes your images are .tif files.

python src/segment_fossil.py -i path/to/your/tiff/images -o path/to/output/directory

Create connection graph and identify cell lines

python src/cell_line_extractor.py -i path/to/previous/output/directory

About

Image processing pipeline to segment cells and find cell files for wood anatomy analysis/

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages