- about(console=None) None ¶
Print a summary of the slideflow version and active backends.
>>> sf.about() ╭=======================╮ │ Slideflow │ │ Version: 2.1.0 │ │ Backend: tensorflow │ │ Slide Backend: cucim │ │ https://slideflow.dev │ ╰=======================╯
console (rich.console.Console, optional) – Active console, if one exists. Defaults to None.
- create_project(root: str, cfg: Dict | str | None = None, *, download: bool = False, md5: bool = False, **kwargs) Project ¶
Create a project at the existing folder from a given configuration.
Supports both manual project creation via keyword arguments, and setting up a project through a specified configuration. The configuration may be a dictionary or a path to a JSON file containing a dictionary. It must have the key ‘annotations’, which includes a path to an annotations file, and may optionally have the following arguments:
name: Name for the project and dataset.
rois: Path to .tar.gz file containing compressed ROIs.
slides: Path in which slides will be stored.
tiles: Path in which extracted tiles will be stored.
tfrecords: Path in which TFRecords will be stored.
import slideflow as sf P = sf.create_project( root='path', annotations='file.csv', slides='path', tfrecords='path' )
Annotations files are copied into the created project folder.
Alternatively, you can create a project using a prespecified configuration, of which there are three available:
When creating a project from a configuration, setting
download=Truewill download the annoations file and slides from The Cancer Genome Atlas (TCGA).
import slideflow as sf project = sf.create_project( root='path', cfg=sf.project.LungAdenoSquam, download=True )
- Keyword Arguments:
download (bool) – Download any missing slides from the Genomic Data Commons (GDC) automatically, using slide names stored in the annotations file.
md5 (bool) – Perform MD5 hash verification for all slides using the GDC (TCGA) MD5 manifest, which will be downloaded.
name (str) – Set the project name. This has higher priority than any supplied configuration, which will be ignored.
slides (str) – Set the destination folder for slides. This has higher priority than any supplied configuration, which will be ignored.
tiles (str) – Set the destination folder for tiles. This has higher priority than any supplied configuration, which will be ignored.
tfrecords (str) – Set the destination for TFRecords. This has higher priority than any supplied configuration, which will be ignored.
roi_dest (str) – Set the destination folder for ROIs.
dataset_config (str) – Path to dataset configuration JSON file for the project. Defaults to ‘./datasets.json’.
models_dir (str) – Path to directory in which to save models. Defaults to ‘./models’.
eval_dir (str) – Path to directory in which to save evaluations. Defaults to ‘./eval’.
- load_project(root: str, **kwargs) Project ¶
Load a project at the given root directory.
root (str) – Path to project.
Return the current logging level.