patchkori 0.1.0__tar.gz → 0.1.2__tar.gz

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.
Files changed (32) hide show
  1. patchkori-0.1.2/PKG-INFO +81 -0
  2. patchkori-0.1.2/README.md +59 -0
  3. patchkori-0.1.2/docs/index.md +39 -0
  4. {patchkori-0.1.0 → patchkori-0.1.2}/pyproject.toml +1 -1
  5. {patchkori-0.1.0 → patchkori-0.1.2}/src/patchkori/__init__.py +1 -1
  6. patchkori-0.1.0/PKG-INFO +0 -153
  7. patchkori-0.1.0/README.md +0 -131
  8. patchkori-0.1.0/docs/index.md +0 -40
  9. {patchkori-0.1.0 → patchkori-0.1.2}/.github/workflows/publish.yml +0 -0
  10. {patchkori-0.1.0 → patchkori-0.1.2}/.gitignore +0 -0
  11. {patchkori-0.1.0 → patchkori-0.1.2}/app.py +0 -0
  12. {patchkori-0.1.0 → patchkori-0.1.2}/assets/logo.svg +0 -0
  13. {patchkori-0.1.0 → patchkori-0.1.2}/assets/sample_data/sample_tonsil_pyramidal.ome.tif +0 -0
  14. {patchkori-0.1.0 → patchkori-0.1.2}/docs/adding-tools.md +0 -0
  15. {patchkori-0.1.0 → patchkori-0.1.2}/mkdocs.yml +0 -0
  16. {patchkori-0.1.0 → patchkori-0.1.2}/src/patchkori/cli.py +0 -0
  17. {patchkori-0.1.0 → patchkori-0.1.2}/src/patchkori/config.py +0 -0
  18. {patchkori-0.1.0 → patchkori-0.1.2}/src/patchkori/core/__init__.py +0 -0
  19. {patchkori-0.1.0 → patchkori-0.1.2}/src/patchkori/core/models.py +0 -0
  20. {patchkori-0.1.0 → patchkori-0.1.2}/src/patchkori/core/pyramidal_cropper/__init__.py +0 -0
  21. {patchkori-0.1.0 → patchkori-0.1.2}/src/patchkori/core/pyramidal_cropper/adapter.py +0 -0
  22. {patchkori-0.1.0 → patchkori-0.1.2}/src/patchkori/core/sample_generator.py +0 -0
  23. {patchkori-0.1.0 → patchkori-0.1.2}/src/patchkori/ui/__init__.py +0 -0
  24. {patchkori-0.1.0 → patchkori-0.1.2}/src/patchkori/ui/app.py +0 -0
  25. {patchkori-0.1.0 → patchkori-0.1.2}/src/patchkori/ui/icons.py +0 -0
  26. {patchkori-0.1.0 → patchkori-0.1.2}/src/patchkori/ui/registry.py +0 -0
  27. {patchkori-0.1.0 → patchkori-0.1.2}/src/patchkori/ui/theme.py +0 -0
  28. {patchkori-0.1.0 → patchkori-0.1.2}/src/patchkori/ui/tools/__init__.py +0 -0
  29. {patchkori-0.1.0 → patchkori-0.1.2}/src/patchkori/ui/tools/pyramidal_cropper.py +0 -0
  30. {patchkori-0.1.0 → patchkori-0.1.2}/tests/conftest.py +0 -0
  31. {patchkori-0.1.0 → patchkori-0.1.2}/tests/test_cropper_adapter.py +0 -0
  32. {patchkori-0.1.0 → patchkori-0.1.2}/tests/test_registry.py +0 -0
@@ -0,0 +1,81 @@
1
+ Metadata-Version: 2.5
2
+ Name: patchkori
3
+ Version: 0.1.2
4
+ Summary: Modular open-source bioinformatics platform for large-scale pyramidal biological imaging
5
+ Author: Jubayer
6
+ License: MIT
7
+ Keywords: bioinformatics,gradio,ome-tiff,pathology,qptiff,whole-slide-imaging,zarr
8
+ Requires-Python: >=3.10
9
+ Requires-Dist: gradio<6.0.0,>=5.0.0
10
+ Requires-Dist: imagecodecs>=2024.6.1
11
+ Requires-Dist: numpy>=1.26.0
12
+ Requires-Dist: pillow>=10.3.0
13
+ Requires-Dist: pydantic>=2.7.0
14
+ Requires-Dist: tifffile>=2024.5.22
15
+ Requires-Dist: typer>=0.12.0
16
+ Requires-Dist: zarr>=2.18.0
17
+ Provides-Extra: dev
18
+ Requires-Dist: mkdocs-material>=9.5.0; extra == 'dev'
19
+ Requires-Dist: pytest>=8.2.0; extra == 'dev'
20
+ Requires-Dist: ruff>=0.5.0; extra == 'dev'
21
+ Description-Content-Type: text/markdown
22
+
23
+ <div align="center">
24
+ <img src="data:image/svg+xml;base64,PH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ub for Biological Image Datasets</strong></p>
27
+ </div>
28
+
29
+ ---
30
+
31
+ ## 🔬 About PatchKori
32
+
33
+ **PatchKori** is a modular bioinformatics platform designed to process large-scale biological image datasets. A diverse suite of specialized patch kits will be integrated into the hub over time.
34
+
35
+ Currently, PatchKori features the **Pyramidal Cropper**:
36
+ - **Pyramidal Cropper:** Extracts patches and regions of interest (ROIs) from gigapixel pyramidal biological images (such as **OME-TIFF**, **QPTIFF**, and **Pyramidal TIFF**) out-of-core without loading massive planes into memory.
37
+
38
+ ---
39
+
40
+ ## 🚀 Quickstart
41
+
42
+ Install PatchKori directly from PyPI:
43
+
44
+ ```bash
45
+ pip install patchkori
46
+ ```
47
+
48
+ Launch the web interface locally:
49
+
50
+ ```bash
51
+ patchkori launch
52
+ ```
53
+
54
+ This opens the local web application at `http://127.0.0.1:7860`.
55
+
56
+ ---
57
+
58
+ ## 🖥️ Using the Pyramidal Cropper
59
+
60
+ 1. **Input Image:** Provide a local file path to your pyramidal image (or load the included sample dataset). You can also provide an optional `markerlist.txt` to automatically name your multiplex channels.
61
+ 2. **Select Region:** Draw an ROI directly on the thumbnail preview with the brush, choose the full slide, or enter coordinates manually.
62
+ 3. **Choose Level & Channels:** Pick the target pyramid resolution level and select the subset of channels you want.
63
+ 4. **Extract:** Choose between a single ROI or a sliding-window tile grid, and click **Run Out-of-Core Crop** to stream the tiles directly to your local folder.
64
+
65
+ ---
66
+
67
+ ## ⚡ Headless CLI
68
+
69
+ You can also run crops directly from the terminal without opening the browser:
70
+
71
+ ```bash
72
+ patchkori crop /path/to/image.qptiff --level 0 --x 100 --y 100 --width 512 --height 512 --output-dir ./crops
73
+ ```
74
+
75
+ ---
76
+
77
+ ## 📜 License & Contact
78
+
79
+ Open-source for research and development.
80
+
81
+ For collaborations, feature suggestions, or custom bioinformatics development, please contact the developer at [Jubayer's GitHub](https://github.com/jubayer98).
@@ -0,0 +1,59 @@
1
+ <div align="center">
2
+ <img src="data:image/svg+xml;base64,PHN2ZyB4b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ZWlnaHQ9IjE0IiByeD0iMyIgZmlsbD0idXJsKCNwa190aWxlX2FtYmVyKSIgLz4KCiAgPCEtLSBDZW50cmFsIE9wdGljYWwgUmV0aWNsZSAmIExlbnMgQWxpZ25tZW50IC0tPgogIDxjaXJjbGUgY3g9IjUwIiBjeT0iNTAiIHI9IjE0IiBzdHJva2U9IiNGRkZGRkYiIHN0cm9rZS13aWR0aD0iMiIgc3Ryb2tlLWRhc2hhcnJheT0iMyAzIiBvcGFjaXR5PSIwLjkiIC8+CiAgPGNpcmNsZSBjeD0iNTAiIGN5PSI1MCIgcj0iNC41IiBmaWxsPSIjRkZGRkZGIiAvPgogIDxjaXJjbGUgY3g9IjUwIiBjeT0iNTAiIHI9IjIiIGZpbGw9IiMwRjc2NkUiIC8+CgogIDwhLS0gUHJlY2lzaW9uIENvcm5lciBDcm9wIEd1aWRlcyAtLT4KICA8cGF0aCBkPSJNIDggMjIgTCA4IDggTCAyMiA4IiBzdHJva2U9IiMwMjg0QzciIHN0cm9rZS13aWR0aD0iMi41IiBzdHJva2UtbGluZWNhcD0icm91bmQiIC8+CiAgPHBhdGggZD0iTSA3OCA4IEwgOTIgOCBMIDkyIDIyIiBzdHJva2U9IiMxNEI4QTYiIHN0cm9rZS13aWR0aD0iMi41IiBzdHJva2UtbGluZWNhcD0icm91bmQiIC8+CiAgPHBhdGggZD0iTSA4IDc4IEwgOCA5MiBMIDIyIDkyIiBzdHJva2U9IiM2NDc0OEIiIHN0cm9rZS13aWR0aD0iMi41IiBzdHJva2UtbGluZWNhcD0icm91bmQiIC8+CiAgPHBhdGggZD0iTSA3OCA5MiBMIDkyIDkyIEwgOTIgNzgiIHN0cm9rZT0iI0Q5NzcwNiIgc3Ryb2tlLXdpZHRoPSIyLjUiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgLz4KPC9zdmc+Cg==" alt="PatchKori Logo" width="96" height="96" />
3
+ <h1>PatchKori</h1>
4
+ <p><strong>Bioinformatics Patch Kits Hub for Biological Image Datasets</strong></p>
5
+ </div>
6
+
7
+ ---
8
+
9
+ ## 🔬 About PatchKori
10
+
11
+ **PatchKori** is a modular bioinformatics platform designed to process large-scale biological image datasets. A diverse suite of specialized patch kits will be integrated into the hub over time.
12
+
13
+ Currently, PatchKori features the **Pyramidal Cropper**:
14
+ - **Pyramidal Cropper:** Extracts patches and regions of interest (ROIs) from gigapixel pyramidal biological images (such as **OME-TIFF**, **QPTIFF**, and **Pyramidal TIFF**) out-of-core without loading massive planes into memory.
15
+
16
+ ---
17
+
18
+ ## 🚀 Quickstart
19
+
20
+ Install PatchKori directly from PyPI:
21
+
22
+ ```bash
23
+ pip install patchkori
24
+ ```
25
+
26
+ Launch the web interface locally:
27
+
28
+ ```bash
29
+ patchkori launch
30
+ ```
31
+
32
+ This opens the local web application at `http://127.0.0.1:7860`.
33
+
34
+ ---
35
+
36
+ ## 🖥️ Using the Pyramidal Cropper
37
+
38
+ 1. **Input Image:** Provide a local file path to your pyramidal image (or load the included sample dataset). You can also provide an optional `markerlist.txt` to automatically name your multiplex channels.
39
+ 2. **Select Region:** Draw an ROI directly on the thumbnail preview with the brush, choose the full slide, or enter coordinates manually.
40
+ 3. **Choose Level & Channels:** Pick the target pyramid resolution level and select the subset of channels you want.
41
+ 4. **Extract:** Choose between a single ROI or a sliding-window tile grid, and click **Run Out-of-Core Crop** to stream the tiles directly to your local folder.
42
+
43
+ ---
44
+
45
+ ## ⚡ Headless CLI
46
+
47
+ You can also run crops directly from the terminal without opening the browser:
48
+
49
+ ```bash
50
+ patchkori crop /path/to/image.qptiff --level 0 --x 100 --y 100 --width 512 --height 512 --output-dir ./crops
51
+ ```
52
+
53
+ ---
54
+
55
+ ## 📜 License & Contact
56
+
57
+ Open-source for research and development.
58
+
59
+ For collaborations, feature suggestions, or custom bioinformatics development, please contact the developer at [Jubayer's GitHub](https://github.com/jubayer98).
@@ -0,0 +1,39 @@
1
+ # 🧬 PatchKori: Bioinformatics Patch Kits Hub
2
+
3
+ **PatchKori** is an open-source bioinformatics platform for biological image datasets. A diverse suite of specialized patch kits will be integrated into the hub over time.
4
+
5
+ Currently, PatchKori includes the **Pyramidal Cropper** for memory-safe, out-of-core extraction of patches from gigapixel biological images (**OME-TIFF**, **QPTIFF**, and **Pyramidal TIFF**).
6
+
7
+ ---
8
+
9
+ ## Quickstart
10
+
11
+ ```bash
12
+ pip install patchkori
13
+ patchkori launch
14
+ ```
15
+
16
+ ---
17
+
18
+ ## Pyramidal Cropper
19
+
20
+ - **Inspect:** Reads pyramid levels and channels in milliseconds without loading the full image into RAM.
21
+ - **ROI Selection:** Draw a crop box directly on the thumbnail preview, choose the full level, or fine-tune coordinates.
22
+ - **Channels:** Accepts optional `markerlist.txt` or falls back to OME metadata / channel indices.
23
+ - **Output:** Streams single ROIs or sliding-window tile grids directly to disk (`ome.tif`, `tif`, `png`, `zarr`).
24
+
25
+ ---
26
+
27
+ ## Headless CLI
28
+
29
+ Run crops from the terminal without opening the web interface:
30
+
31
+ ```bash
32
+ patchkori crop /path/to/image.qptiff --level 0 --x 100 --y 100 --width 512 --height 512 --output-dir ./crops
33
+ ```
34
+
35
+ ---
36
+
37
+ ## License & Contact
38
+
39
+ Open-source for research and development. Contact the developer for collaborations or further development.
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "patchkori"
7
- version = "0.1.0"
7
+ version = "0.1.2"
8
8
  description = "Modular open-source bioinformatics platform for large-scale pyramidal biological imaging"
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.10"
@@ -1,3 +1,3 @@
1
1
  """PatchKori: Modular open-source bioinformatics platform for large-scale pyramidal imaging."""
2
2
 
3
- __version__ = "0.1.0"
3
+ __version__ = "0.1.2"
patchkori-0.1.0/PKG-INFO DELETED
@@ -1,153 +0,0 @@
1
- Metadata-Version: 2.5
2
- Name: patchkori
3
- Version: 0.1.0
4
- Summary: Modular open-source bioinformatics platform for large-scale pyramidal biological imaging
5
- Author: Jubayer
6
- License: MIT
7
- Keywords: bioinformatics,gradio,ome-tiff,pathology,qptiff,whole-slide-imaging,zarr
8
- Requires-Python: >=3.10
9
- Requires-Dist: gradio<6.0.0,>=5.0.0
10
- Requires-Dist: imagecodecs>=2024.6.1
11
- Requires-Dist: numpy>=1.26.0
12
- Requires-Dist: pillow>=10.3.0
13
- Requires-Dist: pydantic>=2.7.0
14
- Requires-Dist: tifffile>=2024.5.22
15
- Requires-Dist: typer>=0.12.0
16
- Requires-Dist: zarr>=2.18.0
17
- Provides-Extra: dev
18
- Requires-Dist: mkdocs-material>=9.5.0; extra == 'dev'
19
- Requires-Dist: pytest>=8.2.0; extra == 'dev'
20
- Requires-Dist: ruff>=0.5.0; extra == 'dev'
21
- Description-Content-Type: text/markdown
22
-
23
- <div align="center">
24
- <img src="assets/logo.svg" alt="PatchKori Logo" width="96" height="96" />
25
- <h1>PatchKori</h1>
26
- <p><strong>Bioinformatics Patch Kits Hub for Gigapixel Biological Image Datasets</strong></p>
27
- <p><em>Out-of-core, memory-safe pyramidal tile extraction & analysis platform (OME-TIFF, QPTIFF, Pyramidal TIFF)</em></p>
28
- </div>
29
-
30
- ---
31
-
32
- ## 🔬 What is PatchKori?
33
-
34
- Whole-slide biological and multiplexed fluorescence images (**OME-TIFF, QPTIFF, Pyramidal TIFF, SVS, OME-Zarr**) frequently exceed **10 GB to 100+ GB per image**. Standard web tools and image viewers crash trying to load gigapixel planes into memory.
35
-
36
- **PatchKori** solves this with a **zero-copy, out-of-core streaming architecture**:
37
- - **Instant Header Inspection (<50ms):** Reads multi-resolution pyramid levels ($L_0 \dots L_N$) and channels without reading image pixels into RAM.
38
- - **Interactive Low-Res Preview Canvas:** Displays an eye-soothing, colorblind-safe thumbnail preview. Draw an ROI box with your cursor or enter exact coordinates.
39
- - **Direct-to-Disk Chunk Slicing:** Uses Zarr-backed `tifffile` tile streaming to extract only the compressed tiles you need directly to your local drive without memory spikes.
40
- - **Extensible Hub Architecture:** Easily drop in future bioinformatics tools (e.g. segmentation, stain normalization) as self-contained plugins.
41
-
42
- ---
43
-
44
- ## 🚀 Quickstart: How to Use PatchKori
45
-
46
- ### 1. Installation
47
-
48
- Clone and install PatchKori locally (Python 3.10+):
49
-
50
- ```bash
51
- git clone git@github.com:jubayer98/PatchKori.git
52
- cd PatchKori
53
- pip install -e ".[dev]"
54
- ```
55
-
56
- ### 2. Launch the Web Interface
57
-
58
- Start the local web application with one command:
59
-
60
- ```bash
61
- patchkori launch
62
- ```
63
-
64
- Your default browser will open automatically to **`http://127.0.0.1:7860`**.
65
-
66
- ---
67
-
68
- ## 🖥️ How to Use the Web Interface (Step-by-Step)
69
-
70
- ```
71
- ┌─────────────────────────────────┬─────────────────────────────────┬─────────────────────────────────┐
72
- │ 1. Configuration & Tiling │ 2. Interactive Canvas │ 3. Execution & Gallery │
73
- │ • Local File Path │ • [📐 Full Level ROI] │ • Output Directory │
74
- │ • Optional markerlist.txt │ • [✏️ Apply Hand-Drawn Box] │ • Format (ome.tif / png / zarr) │
75
- │ • [🧪 Load Sample Dataset] │ • Thumbnail Preview │ • [✂️ Run Out-of-Core Crop] │
76
- │ • Crop / Grid Tile Parameters │ • Pyramid Level Table (L0..LN) │ • Live Progress Feedback │
77
- │ • Target Level & Channels │ • Full Channel Name Badges │ • Instant Preview Gallery │
78
- └─────────────────────────────────┴─────────────────────────────────┴─────────────────────────────────┘
79
- ```
80
-
81
- 1. **Load Your Image:**
82
- - Enter your **Local File Path** (e.g. `/path/to/my_slide.qptiff` or `.ome.tif`).
83
- - *(Optional)* Provide a **`markerlist.txt`** file (one channel name per line) to automatically name multiplex channels. If omitted, channel names are read from OME-XML or fallback to index numbers `[0] Channel 0`, `[1] Channel 1`...
84
- - Click **🔍 Inspect Pyramid** (or click **🧪 Load Sample Dataset** to test with the built-in 4-level pyramidal image).
85
- 2. **Select Region of Interest (ROI):**
86
- - **Hand-Drawn Box:** Select the brush on the preview canvas, draw over your desired region, and click **✏️ Apply Hand-Drawn Box**.
87
- - **Full Slide:** Click **📐 Full Level ROI** to select the entire slide.
88
- - **Numeric Tuning:** Fine-tune `X`, `Y`, `Width`, and `Height` on the left.
89
- 3. **Choose Target Level & Channels:**
90
- - **Target Level:** Choose from $L_0$ (highest resolution, 1.0×) down to $L_N$ (lowest resolution).
91
- - **Channels Dropdown:** Pick any subset of markers (e.g. `[0] DAPI`, `[2] PanCK`). Leaving it empty extracts all channels.
92
- 4. **Choose Crop Mode:**
93
- - **Single Bounding-Box ROI:** Extracts a single cropped patch of the chosen region.
94
- - **Sliding-Window Tile Grid:** Slices the ROI into regular tiles (e.g. $256 \times 256$ or $512 \times 512$ with customizable overlap) for deep learning training datasets.
95
- 5. **Run Crop:**
96
- - Click **✂️ Run Out-of-Core Crop**.
97
- - Crops are written directly to your chosen local folder (`outputs/crops`) with instant visual previews in the gallery.
98
-
99
- ---
100
-
101
- ## ⚡ Headless CLI Usage (For HPC, Clusters & Pipelines)
102
-
103
- You can run PatchKori headless without opening the browser:
104
-
105
- ```bash
106
- # Slicing an ROI directly from the terminal
107
- patchkori crop /data/wsi/sample.qptiff \
108
- --level 0 \
109
- --x 1024 --y 2048 --width 512 --height 512 \
110
- --format ome.tif \
111
- --output-dir ./results
112
-
113
- # Sliding-window tiling for ML datasets
114
- patchkori crop /data/wsi/sample.qptiff \
115
- --level 1 \
116
- --x 0 --y 0 --width 4096 --height 4096 \
117
- --mode tile_grid --tile-size 512 --overlap 64 \
118
- --format png \
119
- --output-dir ./training_tiles
120
- ```
121
-
122
- ---
123
-
124
- ## 🔌 Adding Future Bioinformatics Tools
125
-
126
- Adding a 2nd or 3rd bioinformatics tool requires **zero modifications** to existing core code:
127
-
128
- 1. Add pure algorithmic logic to `src/patchkori/core/<my_tool>/`.
129
- 2. Create `src/patchkori/ui/tools/<my_tool>.py`:
130
-
131
- ```python
132
- import gradio as gr
133
- from patchkori.ui.registry import BaseBioTool, ToolRegistry
134
-
135
- @ToolRegistry.register
136
- class MyBioTool(BaseBioTool):
137
- tool_id = "my-tool"
138
- title = "My Bio Tool"
139
- icon = "🔬"
140
- description = "Self-contained bioinformatics tool plugin."
141
- order = 20
142
-
143
- def build_ui(self, is_demo_mode: bool = False) -> None:
144
- gr.Markdown("### Custom Tool Workspace")
145
- ```
146
-
147
- 3. Import it in `src/patchkori/ui/tools/__init__.py`. It automatically appears as a new tab in the Hub!
148
-
149
- ---
150
-
151
- ## 🛡️ License
152
-
153
- MIT License. Developed for open-source biological imaging and computational pathology research.
patchkori-0.1.0/README.md DELETED
@@ -1,131 +0,0 @@
1
- <div align="center">
2
- <img src="assets/logo.svg" alt="PatchKori Logo" width="96" height="96" />
3
- <h1>PatchKori</h1>
4
- <p><strong>Bioinformatics Patch Kits Hub for Gigapixel Biological Image Datasets</strong></p>
5
- <p><em>Out-of-core, memory-safe pyramidal tile extraction & analysis platform (OME-TIFF, QPTIFF, Pyramidal TIFF)</em></p>
6
- </div>
7
-
8
- ---
9
-
10
- ## 🔬 What is PatchKori?
11
-
12
- Whole-slide biological and multiplexed fluorescence images (**OME-TIFF, QPTIFF, Pyramidal TIFF, SVS, OME-Zarr**) frequently exceed **10 GB to 100+ GB per image**. Standard web tools and image viewers crash trying to load gigapixel planes into memory.
13
-
14
- **PatchKori** solves this with a **zero-copy, out-of-core streaming architecture**:
15
- - **Instant Header Inspection (<50ms):** Reads multi-resolution pyramid levels ($L_0 \dots L_N$) and channels without reading image pixels into RAM.
16
- - **Interactive Low-Res Preview Canvas:** Displays an eye-soothing, colorblind-safe thumbnail preview. Draw an ROI box with your cursor or enter exact coordinates.
17
- - **Direct-to-Disk Chunk Slicing:** Uses Zarr-backed `tifffile` tile streaming to extract only the compressed tiles you need directly to your local drive without memory spikes.
18
- - **Extensible Hub Architecture:** Easily drop in future bioinformatics tools (e.g. segmentation, stain normalization) as self-contained plugins.
19
-
20
- ---
21
-
22
- ## 🚀 Quickstart: How to Use PatchKori
23
-
24
- ### 1. Installation
25
-
26
- Clone and install PatchKori locally (Python 3.10+):
27
-
28
- ```bash
29
- git clone git@github.com:jubayer98/PatchKori.git
30
- cd PatchKori
31
- pip install -e ".[dev]"
32
- ```
33
-
34
- ### 2. Launch the Web Interface
35
-
36
- Start the local web application with one command:
37
-
38
- ```bash
39
- patchkori launch
40
- ```
41
-
42
- Your default browser will open automatically to **`http://127.0.0.1:7860`**.
43
-
44
- ---
45
-
46
- ## 🖥️ How to Use the Web Interface (Step-by-Step)
47
-
48
- ```
49
- ┌─────────────────────────────────┬─────────────────────────────────┬─────────────────────────────────┐
50
- │ 1. Configuration & Tiling │ 2. Interactive Canvas │ 3. Execution & Gallery │
51
- │ • Local File Path │ • [📐 Full Level ROI] │ • Output Directory │
52
- │ • Optional markerlist.txt │ • [✏️ Apply Hand-Drawn Box] │ • Format (ome.tif / png / zarr) │
53
- │ • [🧪 Load Sample Dataset] │ • Thumbnail Preview │ • [✂️ Run Out-of-Core Crop] │
54
- │ • Crop / Grid Tile Parameters │ • Pyramid Level Table (L0..LN) │ • Live Progress Feedback │
55
- │ • Target Level & Channels │ • Full Channel Name Badges │ • Instant Preview Gallery │
56
- └─────────────────────────────────┴─────────────────────────────────┴─────────────────────────────────┘
57
- ```
58
-
59
- 1. **Load Your Image:**
60
- - Enter your **Local File Path** (e.g. `/path/to/my_slide.qptiff` or `.ome.tif`).
61
- - *(Optional)* Provide a **`markerlist.txt`** file (one channel name per line) to automatically name multiplex channels. If omitted, channel names are read from OME-XML or fallback to index numbers `[0] Channel 0`, `[1] Channel 1`...
62
- - Click **🔍 Inspect Pyramid** (or click **🧪 Load Sample Dataset** to test with the built-in 4-level pyramidal image).
63
- 2. **Select Region of Interest (ROI):**
64
- - **Hand-Drawn Box:** Select the brush on the preview canvas, draw over your desired region, and click **✏️ Apply Hand-Drawn Box**.
65
- - **Full Slide:** Click **📐 Full Level ROI** to select the entire slide.
66
- - **Numeric Tuning:** Fine-tune `X`, `Y`, `Width`, and `Height` on the left.
67
- 3. **Choose Target Level & Channels:**
68
- - **Target Level:** Choose from $L_0$ (highest resolution, 1.0×) down to $L_N$ (lowest resolution).
69
- - **Channels Dropdown:** Pick any subset of markers (e.g. `[0] DAPI`, `[2] PanCK`). Leaving it empty extracts all channels.
70
- 4. **Choose Crop Mode:**
71
- - **Single Bounding-Box ROI:** Extracts a single cropped patch of the chosen region.
72
- - **Sliding-Window Tile Grid:** Slices the ROI into regular tiles (e.g. $256 \times 256$ or $512 \times 512$ with customizable overlap) for deep learning training datasets.
73
- 5. **Run Crop:**
74
- - Click **✂️ Run Out-of-Core Crop**.
75
- - Crops are written directly to your chosen local folder (`outputs/crops`) with instant visual previews in the gallery.
76
-
77
- ---
78
-
79
- ## ⚡ Headless CLI Usage (For HPC, Clusters & Pipelines)
80
-
81
- You can run PatchKori headless without opening the browser:
82
-
83
- ```bash
84
- # Slicing an ROI directly from the terminal
85
- patchkori crop /data/wsi/sample.qptiff \
86
- --level 0 \
87
- --x 1024 --y 2048 --width 512 --height 512 \
88
- --format ome.tif \
89
- --output-dir ./results
90
-
91
- # Sliding-window tiling for ML datasets
92
- patchkori crop /data/wsi/sample.qptiff \
93
- --level 1 \
94
- --x 0 --y 0 --width 4096 --height 4096 \
95
- --mode tile_grid --tile-size 512 --overlap 64 \
96
- --format png \
97
- --output-dir ./training_tiles
98
- ```
99
-
100
- ---
101
-
102
- ## 🔌 Adding Future Bioinformatics Tools
103
-
104
- Adding a 2nd or 3rd bioinformatics tool requires **zero modifications** to existing core code:
105
-
106
- 1. Add pure algorithmic logic to `src/patchkori/core/<my_tool>/`.
107
- 2. Create `src/patchkori/ui/tools/<my_tool>.py`:
108
-
109
- ```python
110
- import gradio as gr
111
- from patchkori.ui.registry import BaseBioTool, ToolRegistry
112
-
113
- @ToolRegistry.register
114
- class MyBioTool(BaseBioTool):
115
- tool_id = "my-tool"
116
- title = "My Bio Tool"
117
- icon = "🔬"
118
- description = "Self-contained bioinformatics tool plugin."
119
- order = 20
120
-
121
- def build_ui(self, is_demo_mode: bool = False) -> None:
122
- gr.Markdown("### Custom Tool Workspace")
123
- ```
124
-
125
- 3. Import it in `src/patchkori/ui/tools/__init__.py`. It automatically appears as a new tab in the Hub!
126
-
127
- ---
128
-
129
- ## 🛡️ License
130
-
131
- MIT License. Developed for open-source biological imaging and computational pathology research.
@@ -1,40 +0,0 @@
1
- # 🧬 PatchKori: Bioinformatics Patch Kits Hub
2
-
3
- **PatchKori** is an open-source, modular bioinformatics platform for out-of-core processing of gigapixel biological image datasets (**OME-TIFF, QPTIFF, Pyramidal TIFF**).
4
-
5
- ---
6
-
7
- ## Quickstart
8
-
9
- ```bash
10
- # 1. Install locally
11
- pip install -e ".[dev]"
12
-
13
- # 2. Launch the web interface
14
- patchkori launch
15
- ```
16
-
17
- ---
18
-
19
- ## Key Features
20
-
21
- 1. **Out-of-Core Pyramidal Cropper:**
22
- - Reads image headers in <50ms without loading gigapixel planes into RAM.
23
- - Interactive preview with hand-drawn brush box selection.
24
- - Slices tiles and single ROIs directly to local disk.
25
- 2. **Flexible Channel Mapping:**
26
- - Accepts a `markerlist.txt` file (one marker name per line).
27
- - Falls back to OME-XML tags or clean index numbers (`[0] Channel 0`, `[1] Channel 1`...).
28
- 3. **Dual Execution:**
29
- - **Local Workstation:** Direct path reading on 50 GB+ whole-slide files.
30
- - **Cloud Demo:** Sandboxed interactive testing with pre-loaded pyramidal datasets.
31
- 4. **Headless CLI & Scripting:**
32
- - `patchkori crop` command for Slurm, HPC, Snakemake, and Nextflow pipelines.
33
-
34
- ---
35
-
36
- ## Web Interface Overview
37
-
38
- - **Left Panel:** File path, optional markerlist, crop & tile grid parameters, target pyramid level, and multi-select channels.
39
- - **Center Panel:** Hand-drawn ROI canvas with **Full Level ROI** and **Apply Hand-Drawn Box** buttons, followed by the non-breaking Pyramid Levels overview table and dataset details.
40
- - **Right Panel:** Output format selection (`ome.tif`, `tif`, `png`, `zarr`), single-click crop execution with live progress bar, and instant preview gallery.
File without changes
File without changes
File without changes
File without changes
File without changes