File size: 3,078 Bytes
da53a66 | 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 63 | <!-- BLINDED COPY for double-blind peer review β author, institution, and repository-identifying information removed. Do not use for attribution. -->
# 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](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.
|