AnonymousUN's picture
Add full itrialspace framework, including code, slurm scripts, and configs
da53a66 verified
|
Raw History Blame Contribute Delete
3.08 kB

Data preparation

iTrialSpace ships code only. The source CT datasets and trained model weights are not redistributed (they carry their own licenses and are large). This guide describes the expected layout and how to obtain the data.

The repo bundles no data β€” point ITRIALSPACE_DATA_DIR at your real data root (set it once in .env; see configuration.md). Examples and data-dependent tests read from there and skip cleanly when it isn't present (e.g. in CI).

Unified data layout

Point ITRIALSPACE_DATA_DIR (in .env) at a directory with this structure:

$ITRIALSPACE_DATA_DIR/
β”œβ”€β”€ raw_ct/{DATASET}/            CT scans (NIfTI, RAS+)
β”œβ”€β”€ masks/{DATASET}/
β”‚   β”œβ”€β”€ nodule_seg/              Individual nodule masks
β”‚   β”œβ”€β”€ combined_seg/            Combined per-patient masks
β”‚   β”œβ”€β”€ organ_seg/               VISTA3D organ segs (raw, deprecated)
β”‚   └── refined_seg/             Refined organ + body segs (default)
β”œβ”€β”€ profiles/                    {DATASET}_nodule_profiles.csv  (53-column schema)
β”œβ”€β”€ meta/                        Original dataset metadata CSVs
β”œβ”€β”€ manifests/                   Generated cohort manifests
β”œβ”€β”€ inserted_masks/              Mask-insertion outputs
└── generated_cts/               NodMAISI synthesis outputs

ct_path values in the profile CSVs are relative to raw_ct/, e.g. DLCS24/DLCS_0001.nii.gz. Verify resolution with its config and the PathResolver.

The 7 supported datasets

Dataset Source Notes
DLCS24 Institutional Lung Cancer Screening Binary label, Lung-RADS, demographics
LUNA25 LUNA25 challenge Largest; multi-nodule screening
LUNA16 LUNA16 / LIDC-IDRI No malignancy label (anatomy only)
LUNGx SPIE-AAPM LUNGx Malignancy classification benchmark, ~49% malignant
LNDbv4 LNDb Multi-radiologist ratings (float β†’ threshold)
NSCLCR NSCLC-Radiomics (TCIA) 100% malignant, staging/survival
IMDCT Internal multi-modal diagnostic CT PET, spiculation, benign/cancer

NLST3D was permanently removed from the core pipeline for data-quality reasons and is guarded against at multiple layers.

Each public dataset must be obtained from its original source under its own license. Once downloaded, harmonize each into the 53-column CORE_COLS schema (see itrialspace.core.schema) as {DATASET}_nodule_profiles.csv and place CTs/masks per the layout above.

Adding a new dataset

  1. Produce {DATASET}_nodule_profiles.csv matching CORE_COLS (incl. the 12 reinsertion_* columns).
  2. Add an adapter in src/itrialspace/io/adapters/adapters.py.
  3. Register it in core/schema.py (DATASET_NAMES, DATASET_FLAGS), core/label.py, and configs/datasets.example.yaml + configs/paths.example.yaml.
  4. Add tests.