-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
22 changed files
with
451 additions
and
113 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -163,4 +163,5 @@ cython_debug/ | |
.idea/ | ||
.DS_Store | ||
|
||
work/ | ||
work/ | ||
.nextflow.log* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,7 @@ | ||
import pkg_resources | ||
"""Efficient and Scalable Whole Slide Image (WSI) processing library.""" | ||
__version__ = "0.1.0" | ||
|
||
from wsi_data import open_wsi | ||
import lazyslide.pp as pp | ||
import lazyslide.tl as tl | ||
import lazyslide.pl as pl | ||
|
||
version = __version__ = pkg_resources.get_distribution("lazyslide").version |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
from .plip import PLIP, PLIPVision | ||
from .conch import CONCH, CONCHVision | ||
from .gigapath import GigaPath, GigaPathSlideEncoder |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,3 +2,4 @@ | |
|
||
from .tissue import find_tissue, tissue_qc | ||
from .tiles import tiles, tiles_qc | ||
from .graph import tile_graph |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
from __future__ import annotations | ||
|
||
from pathlib import Path | ||
from typing import List | ||
|
||
from geopandas import GeoDataFrame | ||
|
||
from lazyslide._const import Key | ||
from wsi_data import WSIData | ||
|
||
|
||
def load_annotations( | ||
wsi: WSIData, | ||
annotations: str | Path | GeoDataFrame = None, | ||
join_with: str | List[str] = Key.tiles, | ||
key_added: str = "annotations", | ||
): | ||
"""Load the geojson file and add it to the WSI data""" | ||
import geopandas as gpd | ||
|
||
if isinstance(annotations, (str, Path)): | ||
geo_path = Path(annotations) | ||
anno_df = gpd.read_file(geo_path) | ||
elif isinstance(annotations, GeoDataFrame): | ||
anno_df = annotations | ||
else: | ||
raise ValueError(f"Invalid annotations: {annotations}") | ||
|
||
wsi.add_shapes(key_added, anno_df) | ||
|
||
# get tiles | ||
if isinstance(join_with, str): | ||
join_with = [join_with] | ||
|
||
for key in join_with: | ||
if key in wsi.sdata: | ||
tile_df = wsi.sdata[key] | ||
# join the annotations with the tiles | ||
gdf = gpd.sjoin(tile_df[["geometry"]], anno_df, how="left", op="intersects") | ||
wsi.update_shapes_data(key, gdf) | ||
return wsi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,5 @@ | ||
from .features import feature_extraction | ||
from .features import feature_extraction, encode_slide | ||
from .tissue_props import tissue_props | ||
from .utag import utag_feature | ||
from .domain import spatial_domain | ||
from .text_annotate import text_embedding |
Oops, something went wrong.