PreprocessedInventory

Note

This page is a reference documentation. It only explains the class signature, and not how to use it. Please refer to the Habitat Guide and Python API guide (v2.0) for usage.

class PreprocessedInventory(root: Path, subjects: Tuple[str, ...], image_keys: Tuple[str, ...], mask_keys: Tuple[str, ...], example_image: str | None, example_mask: str | None)[source]

Bases: object

Filesystem inventory of a HABIT images/ + masks/ root.

This is a directory listing, not a loaded Cohort. Use it to show users what is on disk and what their own tree should look like before they call cohort_from_directory().

root

Absolute preprocessed root (contains images/ and masks/).

Type:

pathlib.Path

subjects

Sorted subject folder names under images/.

Type:

Tuple[str, …]

image_keys

Sorted union of modality folder names.

Type:

Tuple[str, …]

mask_keys

Sorted union of ROI folder names under masks/.

Type:

Tuple[str, …]

example_image

One relative image path, if any file was found.

Type:

str | None

example_mask

One relative mask path, if any file was found.

Type:

str | None

__str__() → str[source]

Return the English layout report printed by fetch_demo().

__init__(root: Path, subjects: Tuple[str, ...], image_keys: Tuple[str, ...], mask_keys: Tuple[str, ...], example_image: str | None, example_mask: str | None) → None