Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/pr-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ jobs:
test -d tests
test -f tests/fixtures/input/test-wsi.tif
test -f tests/fixtures/input/test-mask.tif
test -f tests/fixtures/gt/test-wsi.tiles.npz
test -f tests/fixtures/gt/test-wsi.tiles.meta.json
test -f tests/fixtures/gt/test-wsi.coordinates.npz
test -f tests/fixtures/gt/test-wsi.coordinates.meta.json

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,8 @@ result = tile_slide(

artifacts = save_tiling_result(result, output_dir=Path("output"))

print(artifacts.tiles_npz_path) # output/coordinates/slide-1.tiles.npz ; more info in docs/artifacts.md
print(artifacts.tiles_meta_path) # output/coordinates/slide-1.tiles.meta.json ; more info in docs/artifacts.md
print(artifacts.coordinates_npz_path) # output/tiles/slide-1.coordinates.npz ; more info in docs/artifacts.md
print(artifacts.coordinates_meta_path) # output/tiles/slide-1.coordinates.meta.json ; more info in docs/artifacts.md

tiling_preview_path = write_tiling_preview(
result=result,
Expand Down Expand Up @@ -155,8 +155,8 @@ More CLI details: [docs/cli.md](docs/cli.md)

`hs2p` writes explicit named artifacts rather than anonymous coordinate dumps.

- Tiling writes `coordinates/{sample_id}.tiles.npz` and `coordinates/{sample_id}.tiles.meta.json`
- Sampling writes the same pair under `coordinates/<annotation>/`
- Tiling writes `tiles/{sample_id}.coordinates.npz` and `tiles/{sample_id}.coordinates.meta.json`
- Sampling writes the same pair under `tiles/<annotation>/`
- Batch runs also write `process_list.csv`
- Saved coordinate arrays use a deterministic column-major order: numeric `x` first, then numeric `y` within each shared `x`

Expand Down
2 changes: 1 addition & 1 deletion docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@
- [CLI guide](cli.md)
- Input CSV schema, batch commands, and current config layout
- [Artifact reference](artifacts.md)
- `.tiles.npz`, `.tiles.meta.json`, and `process_list.csv`
- `.coordinates.npz`, `.coordinates.meta.json`, and `process_list.csv`
- [Tissue mask generation](tissue-mask-generation.md)
- Standalone script for producing pyramidal tissue masks
6 changes: 3 additions & 3 deletions docs/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ The config dataclasses keep the main knobs explicit and fill secondary options f
- `TilingResult`
- In-memory tile coordinates plus read-level metadata for one slide
- `TilingArtifacts`
- Paths to the saved `.tiles.npz` and `.tiles.meta.json` outputs
- Paths to the saved `.coordinates.npz` and `.coordinates.meta.json` outputs
- Can also carry preview-image paths when batch QC is enabled in `tile_slides()`

For field-by-field details, see the dataclass docstrings in [hs2p/api.py](../hs2p/api.py).
Expand Down Expand Up @@ -185,8 +185,8 @@ You can round-trip a saved result later:
from hs2p import load_tiling_result

loaded = load_tiling_result(
tiles_npz_path=artifacts.tiles_npz_path,
tiles_meta_path=artifacts.tiles_meta_path,
coordinates_npz_path=artifacts.coordinates_npz_path,
coordinates_meta_path=artifacts.coordinates_meta_path,
)
```

Expand Down
16 changes: 8 additions & 8 deletions docs/artifacts.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ HS2P writes explicit named artifacts for both the Python API and the CLI.

## Coordinate artifact locations

- Tiling writes one pair per slide under `coordinates/`
- Sampling writes one pair per annotation under `coordinates/<annotation>/`
- Tiling writes one pair per slide under `tiles/`
- Sampling writes one pair per annotation under `tiles/<annotation>/`

Each successful output produces:

- `{sample_id}.tiles.npz`
- `{sample_id}.tiles.meta.json`
- `{sample_id}.coordinates.npz`
- `{sample_id}.coordinates.meta.json`

## `.tiles.npz`
## `.coordinates.npz`

- `tile_index`
- Contiguous tile ids from `0` to `num_tiles - 1`
Expand All @@ -25,7 +25,7 @@ Each successful output produces:
- `tissue_fraction`
- Optional per-tile tissue coverage measured during extraction

## `.tiles.meta.json`
## `.coordinates.meta.json`

- `sample_id`
- Sample identifier that produced the artifact and names the files
Expand Down Expand Up @@ -69,8 +69,8 @@ Tiling columns:
- `mask_path`
- `tiling_status`
- `num_tiles`
- `tiles_npz_path`
- `tiles_meta_path`
- `coordinates_npz_path`
- `coordinates_meta_path`
- `error`
- `traceback`

Expand Down
6 changes: 3 additions & 3 deletions docs/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ Detailed logs still go to `output_dir/logs/log.txt`, which is the best place to

## Current config areas

- `tiling.read_tiles_from`
- Optional directory containing precomputed `{sample_id}.tiles.npz` and `{sample_id}.tiles.meta.json`
- `tiling.read_coordinates_from`
- Optional directory containing precomputed `{sample_id}.coordinates.npz` and `{sample_id}.coordinates.meta.json`
- `tiling.params`
- Core tiling resolution, tile size, overlap, and tissue-threshold settings
- `tiling.seg_params`
Expand Down Expand Up @@ -124,6 +124,6 @@ When enabled, every candidate tile that passes the tissue mask check is read fro

- `resume: true` expects the current `process_list.csv` schema and current-format artifacts
- reused tiling artifacts are validated against `sample_id`, `config_hash`, `image_path`, and `mask_path`
- `tiling.read_tiles_from` is the supported way to reuse precomputed tiling outputs
- `tiling.read_coordinates_from` is the supported way to reuse precomputed tiling outputs

For the exact output files and field meanings, see [artifacts.md](artifacts.md).
Loading
Loading