Store
store
#
IndexedDatasets
#
IndexedDatasets(path: pathlib.Path | str | None = None, force_download: bool = False)
Read-only accessor for the indexed_datasets directory.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
pathlib.Path | str | None
|
Path to the |
None
|
|
bool
|
If true, the indexed datasets will be downloaded even if they already exist. |
False
|
Source code in src/imgnet/collections/store.py
collections
property
#
Collection names derived from subdirectories of indexed_datasets/.
get_collection
#
get_collection(name: str) -> imgnet.collections.store.Collection
Return a cached Collection for the given name. Validates that the collection exists.
Source code in src/imgnet/collections/store.py
index
#
Return the full Parquet index for collection as a DataFrame (all partitions).
source_config
#
Return the validated source.json for collection.
Falls back to TCIASource() (DICOM/TCIA defaults) when no
source.json exists, keeping backwards compatibility with
collections that predate this file.
Source code in src/imgnet/collections/store.py
file_type
#
collection_size
#
description
#
supported_query_tags
#
Return supported query tags per modality for collection.
downloader
#
downloader(collection: str) -> imgnet.download.base.BaseDownloader
summary
#
Parsed collections_summary.json, or None if it doesn't exist.
Source code in src/imgnet/collections/store.py
Collection
#
Source code in src/imgnet/collections/store.py
parquet_root
property
#
Root directory of the Hive-partitioned Parquet dataset (.../<collection>/parquet).
index
property
#
Full index for this collection (all modalities / partitions). Expensive for large corpora.
source_config
cached
property
#
Return the validated source config. Falls back to TCIASource() when source.json is missing.
read_index_rows
#
read_index_rows(modalities: list[str] | None = None, *, sample_ids: collections.abc.Iterable[typing.Any] | None = None, columns: list[str] | None = None) -> pandas.DataFrame
Load index rows from Parquet, optionally restricting Hive partitions via modalities.
When modalities is not None, applies a dataset filter on Modality so
PyArrow can prune partition directories (e.g. Modality=CT). Rows should
include a Modality column (not only a Hive partition path) so filters bind
to the file schema across engines.
When sample_ids is set, adds a SampleID membership filter (combined with
modality filters using logical AND). Row groups may still be skipped via Parquet
statistics when available.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
list[str] | None
|
If set, only rows (and partitions) for these DICOM modalities are read. An empty list reads nothing and returns an empty DataFrame. |
None
|
|
collections.abc.Iterable[typing.Any] | None
|
If set, only rows whose |
None
|
|
list[str] | None
|
Optional column projection passed to the dataset scanner. |
None
|
Source code in src/imgnet/collections/store.py
build_summary_entry
#
Build the summary dict for this collection (Modalities, BodyPartsExamined, Images, Size, etc.).