Skip to content

human-centered-ai-lab/WSIDOM

Repository files navigation

Whole Slide Image Description of Morphology

First, setup your environment:

pip install -r requirements.txt

Profile

Generate the profile json using the exported csv from Google Docs: Color coding can be updated in the csv files located in /profiles/gdoc_csv.

python create_profile_from_gdoc_csv.py

Javascript to visualize the profile: profile_v1.json

Examples

To run the provided examples, first download the example slide from the TCGA:

cd examples
./gdc-client download 978e66db-80be-4b80-9142-09577aa97241

Visualize the Annotations

# Organs
python visualize.py --annotation_path examples/source.geojson --svs_path examples/978e66db-80be-4b80-9142-09577aa97241/TCGA-BH-A1FE-01Z-00-DX1.8FB57ECF-350B-44E4-8612-63E8374D3C4B.svs  --profile_path profiles/tissue_types_v1.json --output_path output/source.png --output_resolution 16
# Tissue Types
python visualize.py --annotation_path examples/tissue_types.geojson --svs_path examples/978e66db-80be-4b80-9142-09577aa97241/TCGA-BH-A1FE-01Z-00-DX1.8FB57ECF-350B-44E4-8612-63E8374D3C4B.svs  --profile_path profiles/tissue_types_v1.json --output_path output/tissue_types.png --output_resolution 16
# Pathological Alterations
python visualize.py --annotation_path examples/pathological_alterations.geojson --svs_path examples/978e66db-80be-4b80-9142-09577aa97241/TCGA-BH-A1FE-01Z-00-DX1.8FB57ECF-350B-44E4-8612-63E8374D3C4B.svs --profile_path profiles/tissue_types_v1.json --output_path output/pathological_alterations.png --output_resolution 16

Generates the following images:

Export the Annotations as a .png

python export.py --layer_1_path examples/source.geojson --layer_2_path examples/tissue_types.geojson --layer_3_path examples/pathological_alterations.geojson --output_path output/annotation.png --output_resolution 16 --profile_path profiles/tissue_types_v1.json --svs_path examples/978e66db-80be-4b80-9142-09577aa97241/TCGA-BH-A1FE-01Z-00-DX1.8FB57ECF-350B-44E4-8612-63E8374D3C4B.svs

Saves the annotations in the three channels of a .png:

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •