Utility functions for generating, saving, and converting annotation files
Project description
fusion-tools
Some utilities, accession, and visualization tools for data derived from FUSION (Functional Unit State Identification in WSIs).
Installation
$ pip install fusion-tools
Usage
fusion-tools
is intended to bring some of the functionality found in FUSION to developers working with whole slide images (WSIs) stored locally.
One such example would be the LocalTileServer and SlideMap class:
from fusion_tools import Visualization
from fusion_tools.tileserver import LocalTileServer
from fusion_tools.components import SlideMap
import threading
path_to_slide = '/path/to/wsi.svs'
tile_server_port = '8050'
tile_server = LocalTileServer(
local_image_path = path_to_slide
)
new_thread = threading.Thread(target = tile_server.start, name = 'tile-server', args = [tile_server_port])
new_thread.daemon = True
new_thread.start()
vis_session = Visualization(
components = [
[
SlideMap(
tile_server = tile_server,
annotations = None
)
]
]
)
vis_session.start()
The Visualization
class lets users construct custom layouts of different tools by passing a list containing rows, columns, and tabs. (e.g. [ [column in row 1], [ [ tab 1 in column 2 in row 1, tab 2 in column 2 in row 1] ], [ [ column 1 in row 2 ] ] ] )
import threading
from fusion_tools import Visualization
from fusion_tools.tileserver import LocalTileServer
from fusion_tools.components import SlideMap, OverlayOptions, PropertyViewer
from fusion_tools.utils.shapes import load_aperio
path_to_slide = '/path/to/wsi.svs'
path_to_annotations = '/path/to/aperio_annotations.xml'
annotations = load_aperio(path_to_annotations)
tile_server_port = '8050'
tile_server = LocalTileServer(
local_image_path = path_to_slide
)
# Starting LocalTileServer
new_thread = threading.Thread(target = tile_server.start, name = 'local_tile_server', args = [tile_server_port])
new_thread.daemon = True
new_thread.start()
vis_session = Visualization(
components = [
[
SlideMap(
tile_server = tile_server,
annotations = annotations
),
[
OverlayOptions(
geojson_anns = annotations
),
PropertyViewer(
geojson_list = annotations
)
]
]
]
)
vis_session.start()
Contributing
please
License
fusion-tools
was created by Samuel Border. It is licensed under the terms of the Apache 2.0 License
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for fusion_tools-0.0.5-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 446293bb42efc6c1ecaced9af4d96356e298c271918b06c21432614747e910c2 |
|
MD5 | 794ccba961e4b2df67220fce45d864f1 |
|
BLAKE2b-256 | 9acb8b9d961bdab379fbc8ecff633e58711d059c3097d05252987433e42094a9 |