wsi-toolbox 0.1.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,119 @@
1
+ """
2
+ WSI-toolbox: Whole Slide Image analysis toolkit
3
+
4
+ A comprehensive toolkit for WSI processing, feature extraction, and clustering.
5
+
6
+ Basic Usage:
7
+ >>> import wsi_toolbox as wt
8
+ >>>
9
+ >>> # Convert WSI to HDF5
10
+ >>> wt.set_default_progress('tqdm')
11
+ >>> cmd = wt.Wsi2HDF5Command(patch_size=256)
12
+ >>> result = cmd('input.ndpi', 'output.h5')
13
+ >>>
14
+ >>> # Extract features
15
+ >>> wt.set_default_model('gigapath')
16
+ >>> wt.set_default_device('cuda')
17
+ >>> emb_cmd = wt.PatchEmbeddingCommand(batch_size=256)
18
+ >>> emb_result = emb_cmd('output.h5')
19
+ >>>
20
+ >>> # Clustering
21
+ >>> cluster_cmd = wt.ClusteringCommand(resolution=1.0, use_umap=True)
22
+ >>> cluster_result = cluster_cmd(['output.h5'])
23
+ >>>
24
+ >>> # Plot UMAP
25
+ >>> umap_embs = cluster_cmd.get_umap_embeddings()
26
+ >>> fig = wt.plot_umap(umap_embs, cluster_cmd.total_clusters)
27
+ >>> fig.savefig('umap.png')
28
+ """
29
+
30
+ # Version info
31
+ __version__ = '0.1.0'
32
+
33
+ # Commands
34
+ from .commands import (
35
+ # Configuration
36
+ set_default_progress,
37
+ set_default_model,
38
+ set_default_device,
39
+ set_verbose,
40
+
41
+ # Main commands
42
+ Wsi2HDF5Command,
43
+ PatchEmbeddingCommand,
44
+ ClusteringCommand,
45
+
46
+ # Preview commands
47
+ PreviewClustersCommand,
48
+ PreviewScoresCommand,
49
+ PreviewLatentPCACommand,
50
+ PreviewLatentClusterCommand,
51
+
52
+ # Export commands
53
+ DziExportCommand,
54
+ )
55
+
56
+ # Command result types
57
+ from .commands.wsi import Wsi2HDF5Result
58
+ from .commands.patch_embedding import PatchEmbeddingResult
59
+ from .commands.clustering import ClusteringResult
60
+
61
+ # WSI file classes
62
+ from .wsi_files import (
63
+ WSIFile,
64
+ OpenSlideFile,
65
+ TiffFile,
66
+ StandardImage,
67
+ create_wsi_file,
68
+ )
69
+
70
+ # Models
71
+ from .models import (
72
+ MODEL_LABELS,
73
+ create_model,
74
+ )
75
+
76
+ # Utility functions
77
+ from .utils import plot_umap
78
+ from .utils.analysis import leiden_cluster
79
+
80
+ __all__ = [
81
+ # Version
82
+ '__version__',
83
+
84
+ # Configuration functions
85
+ 'set_default_progress',
86
+ 'set_default_model',
87
+ 'set_default_device',
88
+ 'set_verbose',
89
+
90
+ # Commands
91
+ 'Wsi2HDF5Command',
92
+ 'PatchEmbeddingCommand',
93
+ 'ClusteringCommand',
94
+ 'PreviewClustersCommand',
95
+ 'PreviewScoresCommand',
96
+ 'PreviewLatentPCACommand',
97
+ 'PreviewLatentClusterCommand',
98
+ 'DziExportCommand',
99
+
100
+ # Result types
101
+ 'Wsi2HDF5Result',
102
+ 'PatchEmbeddingResult',
103
+ 'ClusteringResult',
104
+
105
+ # WSI files
106
+ 'WSIFile',
107
+ 'OpenSlideFile',
108
+ 'TiffFile',
109
+ 'StandardImage',
110
+ 'create_wsi_file',
111
+
112
+ # Models
113
+ 'MODEL_LABELS',
114
+ 'create_model',
115
+
116
+ # Utilities
117
+ 'plot_umap',
118
+ 'leiden_cluster',
119
+ ]