1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
//! Fast whole slide image (WSI) tile extraction, with tissue detection and
//! stain normalization.
//!
//! Whole slide images are gigapixel-scale microscopy scans used in digital
//! pathology, stored as tiled, pyramidal (multi-resolution) TIFF files.
//! Slideforge currently reads the Aperio SVS format.
//!
//! [`Slide`](slide::Slide) opens a single WSI and extracts tiles at a
//! specific pyramid level or a target microns-per-pixel value, optionally
//! dropping background-only tiles (Otsu thresholding) and normalizing
//! stain color (Reinhard normalization) along the way. Extracted tiles can
//! be written out as loose JPEGs, a `.tfrecord` file for ML training
//! pipelines, and/or summarized in a PDF report.
//! [`Dataset`](dataset::Dataset) extends this across a whole directory of
//! slides at once.
//!
//! # Example
//!
//! ```no_run
//! use slideforge::slide::{Slide, SlideOutputs};
//! use slideforge::ExtractionOptions;
//!
//! # fn main() -> Result<(), Box<dyn std::error::Error>> {
//! let slide = Slide::open("slide.svs")?;
//!
//! let options = ExtractionOptions::parallel()
//! .with_target_mpp(0.5)
//! .with_min_tissue_fraction(0.1)
//! .with_stain_normalization();
//!
//! let outputs = SlideOutputs::default().with_tile_dir("tiles/");
//!
//! slide.extract(&options, &outputs, |tile| {
//! println!("kept tile ({}, {})", tile.tile_x(), tile.tile_y());
//! Ok(())
//! })?;
//! # Ok(())
//! # }
//! ```
pub use ;
pub use TissueMask;
pub use ;
pub use ;
pub use ExtractionReport;
pub use normalize_reinhard;