gregoryschwingmdphd commited on
Commit
a38e57c
·
verified ·
1 Parent(s): 0be3643

Add files using upload-large-folder tool

Browse files
LICENSE ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Creative Commons Attribution 4.0 International (CC BY 4.0)
2
+
3
+ You are free to:
4
+ - Share — copy and redistribute the material in any medium or format
5
+ - Adapt — remix, transform, and build upon the material for any purpose,
6
+ even commercially.
7
+
8
+ Under the following terms:
9
+ - Attribution — You must give appropriate credit, provide a link to the
10
+ license, and indicate if changes were made.
11
+
12
+ Full text: https://creativecommons.org/licenses/by/4.0/legalcode
README.md ADDED
@@ -0,0 +1,138 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: cc-by-4.0
3
+ task_categories:
4
+ - image-segmentation
5
+ language:
6
+ - en
7
+ size_categories:
8
+ - n<1K
9
+ tags:
10
+ - medical-imaging
11
+ - spine
12
+ - ct
13
+ - segmentation
14
+ - vertebra
15
+ - lstv
16
+ - tltv
17
+ - verse
18
+ pretty_name: "VerSeFusion: Re-fused VerSe 2019+2020 with VERIDAH corrections"
19
+ ---
20
+
21
+ # VerSeFusion-Sample
22
+
23
+ A re-fused, PIR-canonical version of the VerSe 2019 and VerSe 2020 vertebra
24
+ segmentation challenges, with VERIDAH (Möller 2026) label corrections applied
25
+ for thoracolumbar transitional vertebrae.
26
+
27
+ ## Dataset stats
28
+
29
+ - **Total scans:** 10
30
+ - **Total patients:** 10
31
+ - **Splits:** training=1, validation=4, test=5
32
+ - **Source:** VerSe 2019 + VerSe 2020 (combined) with VERIDAH corrections
33
+ - **Canonical orientation:** PIR (axis 0 = P, axis 1 = I, axis 2 = R)
34
+ - **VERIDAH-corrected subjects:** 0
35
+
36
+ ## Orientation
37
+
38
+ Every scan in this dataset has been reoriented to a single canonical frame:
39
+
40
+ - **axis 0** increases toward **P** (posterior — i.e., anterior → posterior)
41
+ - **axis 1** increases toward **I** (inferior — i.e., superior → inferior; this is the spine axis)
42
+ - **axis 2** increases toward **R** (right — i.e., left → right)
43
+
44
+ This is verified end-to-end: see `orientation_audit.json` for the
45
+ per-subject report. Rendering conventions in `previews/`:
46
+
47
+ - **Coronal:** head at top, patient's right at viewer's right
48
+ - **Axial:** anterior at top, patient's right at viewer's right
49
+ - **Sagittal:** head at top, anterior at left
50
+
51
+ ## Structure
52
+
53
+ ```
54
+ gregoryschwingmdphd/VerseFusion-Sample/
55
+ ├── README.md
56
+ ├── LICENSE
57
+ ├── splits.csv # series_id → split (training/validation/test)
58
+ ├── orientation_audit.json # per-subject orientation verification
59
+ ├── scans/
60
+ │ └── <series_id>/
61
+ │ ├── ct.nii.gz # CT volume, HU values, PIR-oriented
62
+ │ ├── mask.nii.gz # vertebra labels (uint8), PIR-oriented
63
+ │ └── meta.json # per-scan provenance
64
+ ├── corrections/
65
+ │ └── veridah_manifest.json # which subjects had labels corrected
66
+ └── previews/ # optional QC renders
67
+ └── <series_id>.png
68
+ ```
69
+
70
+ ## Label schema
71
+
72
+ | Label | Anatomy | | Label | Anatomy |
73
+ |-------|---------|-|-------|---------|
74
+ | 1–7 | C1–C7 | | 20 | L1 |
75
+ | 8 | T1 | | 21 | L2 |
76
+ | 9 | T2 | | 22 | L3 |
77
+ | 10 | T3 | | 23 | L4 |
78
+ | 11 | T4 | | 24 | L5 |
79
+ | 12 | T5 | | 25 | L6 (supernumerary lumbar) |
80
+ | 13 | T6 | | 26 | sacrum (variably annotated) |
81
+ | 14 | T7 | | 27 | coccyx |
82
+ | 15 | T8 | | 28 | T13 (supernumerary thoracic) |
83
+ | 16 | T9 | | | |
84
+ | 17 | T10 | | | |
85
+ | 18 | T11 | | | |
86
+ | 19 | T12 | | | |
87
+
88
+ ## Loading example
89
+
90
+ ```python
91
+ import nibabel as nib
92
+
93
+ ct = nib.load("scans/verse001/ct.nii.gz")
94
+ msk = nib.load("scans/verse001/mask.nii.gz")
95
+
96
+ # Both are guaranteed to be PIR-oriented:
97
+ assert nib.aff2axcodes(ct.affine) == ('P', 'I', 'R')
98
+ assert nib.aff2axcodes(msk.affine) == ('P', 'I', 'R')
99
+ ```
100
+
101
+ ## Citation
102
+
103
+ If you use this dataset, please cite the original VerSe challenges and the
104
+ VERIDAH corrections paper:
105
+
106
+ ```bibtex
107
+ @article{sekuboyina2021verse,
108
+ title={VerSe: A vertebrae labelling and segmentation benchmark for multi-detector CT images},
109
+ author={Sekuboyina, A. and others},
110
+ journal={Medical Image Analysis},
111
+ year={2021}
112
+ }
113
+
114
+ @article{loffler2020verse2020,
115
+ title={A vertebral segmentation dataset with fracture grading},
116
+ author={Löffler, M.T. and others},
117
+ journal={Radiology: Artificial Intelligence},
118
+ year={2020}
119
+ }
120
+
121
+ @article{moller2026veridah,
122
+ title={VERIDAH: Vertebral identification and transitional anomaly detection},
123
+ author={Möller, H. and others},
124
+ year={2026}
125
+ }
126
+ ```
127
+
128
+ ## Acknowledgments
129
+
130
+ VerSe challenge data: Technical University Munich. VERIDAH corrections:
131
+ H. Möller et al. (2026).
132
+
133
+
134
+ ## Note: this is a sample
135
+
136
+ This is a 10-scan sample from the full dataset, chosen as the most-completely-labeled scans (highest unique-vertebra-label count, with VERIDAH-corrected subjects prioritized to showcase the thoracolumbar transitional-vertebra corrections).
137
+
138
+ For the full VerSeFusion dataset, see: https://huggingface.co/datasets/gregoryschwingmdphd/VerseFusion
corrections/veridah_manifest.json ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "version": "0.6.0",
3
+ "csv_source": "/wsu/home/go/go24/go2432/VerSeFusion/configs/veridah_corrections.csv",
4
+ "n_scans": 374,
5
+ "n_corrected": 0,
6
+ "n_passthrough": 360,
7
+ "by_correction_type": {
8
+ "t13_shift": 12,
9
+ "label_override": 2
10
+ },
11
+ "corrections": [],
12
+ "subset_filtered": true
13
+ }
dataset_interface.py ADDED
@@ -0,0 +1,757 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """
2
+ dataset_interface.py — Runtime interface for the VerSeFusion HF dataset.
3
+
4
+ Two classes:
5
+ VerSeFusion dict-style dataset wrapping an HF export directory.
6
+ No torch dependency. Use this for
7
+ benchmarking / visualization / cohort analysis.
8
+ VerSeFusionDataset PyTorch Dataset adapter on top of VerSeFusion.
9
+
10
+ Expected layout (produced by stages 10a+10b+11 of the pipeline):
11
+ <root>/
12
+ scans/<series_id>/ct.nii.gz
13
+ scans/<series_id>/mask.nii.gz
14
+ manifest.json schema_version: 1
15
+ manifest.csv same data, flat tabular form
16
+ manifest_summary.json cross-tabs by split × lstv_class
17
+ splits_5fold.json schema_version: 1, patient-level
18
+ CV folds with test held out
19
+ corrections/veridah_manifest.json
20
+ orientation_audit.json
21
+ LICENSE
22
+ README.md
23
+
24
+ Quickstart (analysis / viz — no torch needed):
25
+ >>> from dataset_interface import VerSeFusion
26
+ >>> ds = VerSeFusion("data/hf_staging")
27
+ >>> print(ds.stats())
28
+ >>> t13_cases = ds.filter(lstv_class="t13_supernumerary")
29
+
30
+ Quickstart (HF Hub — lazy NIfTI fetch on first access):
31
+ >>> ds = VerSeFusion.from_hub("gregoryschwingmdphd/VerseFusion")
32
+ >>> ct_arr, affine = ds.cases[0].load_ct() # downloads on first call
33
+
34
+ Quickstart (training):
35
+ >>> from dataset_interface import VerSeFusionDataset
36
+ >>> ds_tr = VerSeFusionDataset("data/hf_staging", split=("fold", 0, "train"))
37
+ >>> ds_va = VerSeFusionDataset("data/hf_staging", split=("fold", 0, "val"))
38
+ >>> ds_te = VerSeFusionDataset("data/hf_staging", split="test")
39
+
40
+ PATIENT-LEVEL SPLITS
41
+ ====================
42
+ Both the test holdout and the 5-fold CV are stratified at the patient
43
+ level. Paired patients (where a single patient has multiple scans) keep
44
+ all their scans in the same fold to prevent leakage.
45
+
46
+ LSTV CLASSES
47
+ ============
48
+ The dataset is stratified on a 4-way `lstv_class` derived from the LSTV
49
+ audit flags during manifest construction:
50
+ t13_supernumerary has_T13 = True (~18 cases)
51
+ lumbarization has_L6 = True (~44 cases)
52
+ truncated lacks_T12_TLJ_in_FOV (~6 cases)
53
+ normal otherwise (~290 cases)
54
+
55
+ The per-patient class is the WORST-CASE across that patient's scans
56
+ (t13 > lumb > trunc > normal). See verse_pipeline/splits_builder.py.
57
+ """
58
+
59
+ from __future__ import annotations
60
+
61
+ import json
62
+ import os
63
+ from dataclasses import dataclass, field
64
+ from pathlib import Path
65
+ from typing import Any, Dict, List, Optional, Sequence, Tuple
66
+
67
+
68
+ # VerSeFusion mask label scheme (28-class):
69
+ # 0 background
70
+ # 1-7 C1-C7
71
+ # 8-19 T1-T12
72
+ # 20-25 L1-L6
73
+ # 26 sacrum
74
+ # 27 coccyx
75
+ # 28 T13 (supernumerary, after VERIDAH t13_shift)
76
+ LABEL_NAMES = (
77
+ "background",
78
+ "C1", "C2", "C3", "C4", "C5", "C6", "C7",
79
+ "T1", "T2", "T3", "T4", "T5", "T6", "T7", "T8", "T9", "T10", "T11", "T12",
80
+ "L1", "L2", "L3", "L4", "L5", "L6",
81
+ "sacrum", "coccyx",
82
+ "T13",
83
+ )
84
+ NUM_CLASSES = len(LABEL_NAMES)
85
+
86
+
87
+ # ============================================================================
88
+ # Case record
89
+ # ============================================================================
90
+
91
+ @dataclass
92
+ class Case:
93
+ """One scan (CT + mask) with metadata.
94
+
95
+ For HF-backed datasets, ct_path / mask_path may not exist on disk yet —
96
+ files are fetched lazily on first call to load_ct() / load_mask() via
97
+ the back-reference to the parent dataset. For local roots the
98
+ back-reference is None and load_* just opens the file directly.
99
+ """
100
+ series_id: str
101
+ patient_id: Optional[str]
102
+ ct_path: Path
103
+ mask_path: Path
104
+ split: str = "unknown" # training/validation/test
105
+ source_dataset: Optional[str] = None
106
+ source_format: Optional[str] = None
107
+
108
+ # geometry
109
+ shape: Optional[Tuple[int, int, int]] = None
110
+ spacing_mm: Optional[Tuple[float, float, float]] = None
111
+
112
+ # demographics (often missing)
113
+ age: Optional[float] = None
114
+ sex: Optional[str] = None
115
+ patient_pos: Optional[str] = None
116
+
117
+ # corrections
118
+ veridah_applied: bool = False
119
+ veridah_action: Optional[str] = None
120
+ veridah_kind: Optional[str] = None
121
+
122
+ # LSTV
123
+ n_labels: int = 0
124
+ labels_present: List[int] = field(default_factory=list)
125
+ has_T13: bool = False
126
+ has_L6: bool = False
127
+ lacks_T12_TLJ_in_FOV: bool = False
128
+ lstv_class: str = "normal"
129
+
130
+ # Manifest-relative paths (used by lazy fetch)
131
+ ct_file_rel: str = ""
132
+ mask_file_rel: str = ""
133
+
134
+ # Back-ref to parent VerSeFusion instance for HF lazy fetch.
135
+ # Marked compare=False so equality / repr stay sane.
136
+ _parent: object = field(default=None, repr=False, compare=False)
137
+
138
+ def exists(self) -> bool:
139
+ """True iff both files are present on disk RIGHT NOW. Returns
140
+ False for HF-backed cases that haven't been fetched yet."""
141
+ return self.ct_path.exists() and self.mask_path.exists()
142
+
143
+ def has_label(self, label: int) -> bool:
144
+ return int(label) in self.labels_present
145
+
146
+ def _ensure_local(self) -> None:
147
+ """Download from HF if needed. No-op for local datasets."""
148
+ if self._parent is None:
149
+ return
150
+ fetcher = getattr(self._parent, "_hf_fetch", None)
151
+ if fetcher is None:
152
+ return
153
+ if not self.ct_path.exists():
154
+ new_ct = fetcher(self.ct_file_rel)
155
+ if new_ct is not None:
156
+ self.ct_path = Path(new_ct)
157
+ if not self.mask_path.exists():
158
+ new_msk = fetcher(self.mask_file_rel)
159
+ if new_msk is not None:
160
+ self.mask_path = Path(new_msk)
161
+
162
+ def load_ct(self):
163
+ """Returns (ct_array float32 in PIR, affine 4x4)."""
164
+ import nibabel as nib
165
+ import numpy as np
166
+ self._ensure_local()
167
+ img = nib.load(str(self.ct_path))
168
+ return np.asarray(img.dataobj, dtype=np.float32), img.affine
169
+
170
+ def load_mask(self):
171
+ """Returns (mask_array int16 in PIR, affine 4x4)."""
172
+ import nibabel as nib
173
+ import numpy as np
174
+ self._ensure_local()
175
+ img = nib.load(str(self.mask_path))
176
+ return np.asarray(img.dataobj, dtype=np.int16), img.affine
177
+
178
+ # Backwards-compat alias for code expecting CTSpinoPelvic1K's load_label
179
+ def load_label(self):
180
+ return self.load_mask()
181
+
182
+
183
+ # ============================================================================
184
+ # coercion / path resolution helpers (mirror CTSpinoPelvic1K conventions)
185
+ # ============================================================================
186
+
187
+ def _coerce_optional_str(v) -> Optional[str]:
188
+ if v is None:
189
+ return None
190
+ try:
191
+ import pandas as _pd
192
+ if _pd.isna(v):
193
+ return None
194
+ except Exception:
195
+ pass
196
+ s = str(v)
197
+ return s if s and s.lower() != "nan" else None
198
+
199
+
200
+ def _coerce_optional_float(v) -> Optional[float]:
201
+ if v is None or v == "":
202
+ return None
203
+ try:
204
+ import pandas as _pd
205
+ if _pd.isna(v):
206
+ return None
207
+ except Exception:
208
+ pass
209
+ try:
210
+ f = float(v)
211
+ except (TypeError, ValueError):
212
+ return None
213
+ return None if f != f else f
214
+
215
+
216
+ def _coerce_optional_int(v) -> Optional[int]:
217
+ f = _coerce_optional_float(v)
218
+ return int(f) if f is not None else None
219
+
220
+
221
+ def _coerce_bool(v) -> bool:
222
+ if isinstance(v, bool):
223
+ return v
224
+ if v is None:
225
+ return False
226
+ if isinstance(v, str):
227
+ return v.strip().lower() in ("true", "1", "yes")
228
+ try:
229
+ return bool(int(v))
230
+ except (TypeError, ValueError):
231
+ return bool(v)
232
+
233
+
234
+ def _coerce_labels_list(v) -> List[int]:
235
+ """labels_present may be a JSON string (from CSV) or already a list."""
236
+ if v is None or v == "":
237
+ return []
238
+ if isinstance(v, list):
239
+ return [int(x) for x in v]
240
+ if isinstance(v, str):
241
+ try:
242
+ parsed = json.loads(v)
243
+ if isinstance(parsed, list):
244
+ return [int(x) for x in parsed]
245
+ except (TypeError, ValueError, json.JSONDecodeError):
246
+ pass
247
+ return []
248
+
249
+
250
+ def _resolve_file(root: Path, rel: str) -> Path:
251
+ """Resolve a manifest-declared relative path against the root.
252
+
253
+ Always tries `root/rel` first. For HF-backed datasets where the file
254
+ hasn't been fetched yet, the result won't exist — that's fine, the
255
+ lazy-fetch path in Case._ensure_local() handles it.
256
+ """
257
+ if not rel:
258
+ return root
259
+ return root / rel
260
+
261
+
262
+ # ============================================================================
263
+ # main dataset class (no torch dep)
264
+ # ============================================================================
265
+
266
+ class VerSeFusion:
267
+ """Directory-backed dataset with rich per-scan metadata.
268
+
269
+ For HF-backed instances (via from_hub), only metadata files are
270
+ downloaded eagerly (manifest, splits, README — kilobytes). CT and
271
+ mask NIfTIs are fetched lazily on first call to Case.load_ct() /
272
+ load_mask() via _hf_fetch(), and cached for future calls under the
273
+ huggingface_hub cache.
274
+ """
275
+
276
+ # Splits schema recorded after _resolve_splits so callers can introspect
277
+ splits_schema_version: Optional[int] = None
278
+ splits_scheme: Optional[str] = None
279
+
280
+ # HF lazy-fetch state. None for purely local datasets.
281
+ _hf_repo_id: Optional[str] = None
282
+ _hf_token: Optional[str] = None
283
+ _hf_cache_dir: Optional[str] = None
284
+
285
+ def __init__(self, root):
286
+ self.root = Path(os.path.expanduser(str(root)))
287
+ if not self.root.exists():
288
+ raise FileNotFoundError(f"Dataset root not found: {self.root}")
289
+ self._load()
290
+
291
+ # ── HF lazy-fetch ────────────────────────────────────────────────────
292
+ def _hf_fetch(self, rel_path: str) -> Optional[str]:
293
+ """Ensure the file at rel_path exists locally. Returns local path
294
+ as a string, or None if this dataset isn't HF-backed.
295
+
296
+ Race-safe across processes (huggingface_hub uses file locks).
297
+ Network errors propagate.
298
+ """
299
+ if not self._hf_repo_id or not rel_path:
300
+ return None
301
+ try:
302
+ from huggingface_hub import hf_hub_download
303
+ except ImportError as e:
304
+ raise RuntimeError(
305
+ "huggingface_hub not installed. pip install huggingface_hub"
306
+ ) from e
307
+ return hf_hub_download(
308
+ repo_id = self._hf_repo_id,
309
+ repo_type = "dataset",
310
+ filename = rel_path,
311
+ token = self._hf_token,
312
+ cache_dir = self._hf_cache_dir,
313
+ )
314
+
315
+ # ── splits resolution ────────────────────────────────────────────────
316
+ def _resolve_splits(self) -> Tuple[Dict[str, str], Optional[Dict]]:
317
+ """Read splits_5fold.json. Returns (series_id_to_split, cv_doc).
318
+
319
+ series_id_to_split maps to "test" or "trainval". cv_doc is the
320
+ full splits document for fold() lookups, or None if missing.
321
+
322
+ Falls back to the manifest's native `split` column for the
323
+ "split" attribute when splits_5fold.json is absent — but in
324
+ that case fold() will raise.
325
+ """
326
+ series_to_split: Dict[str, str] = {}
327
+ cv_doc: Optional[Dict] = None
328
+
329
+ splits_path = self.root / "splits_5fold.json"
330
+ if splits_path.exists():
331
+ try:
332
+ doc = json.loads(splits_path.read_text())
333
+ self.splits_schema_version = int(doc.get("schema_version", 0) or 0)
334
+ self.splits_scheme = doc.get("strata_scheme")
335
+ for sid in doc.get("test_series_ids", []) or []:
336
+ series_to_split[str(sid)] = "test"
337
+ if "folds" in doc:
338
+ cv_doc = doc
339
+ return series_to_split, cv_doc
340
+ except (OSError, ValueError, TypeError) as e:
341
+ import warnings as _w
342
+ _w.warn(
343
+ f"Could not read {splits_path}: {e}. fold() will fail.",
344
+ stacklevel=3,
345
+ )
346
+ return series_to_split, cv_doc
347
+
348
+ def _load_manifest_records(self) -> List[Dict[str, Any]]:
349
+ """Read manifest.json (preferred) or manifest.csv as records."""
350
+ json_path = self.root / "manifest.json"
351
+ if json_path.exists():
352
+ doc = json.loads(json_path.read_text())
353
+ if isinstance(doc, dict):
354
+ return list(doc.get("subjects", []))
355
+ if isinstance(doc, list):
356
+ return list(doc)
357
+ csv_path = self.root / "manifest.csv"
358
+ if csv_path.exists():
359
+ import pandas as pd
360
+ return pd.read_csv(csv_path).to_dict(orient="records")
361
+ raise FileNotFoundError(
362
+ f"No manifest found under {self.root}. Looked for "
363
+ f"manifest.json and manifest.csv. Did you run "
364
+ f"`make manifest-slurm`?"
365
+ )
366
+
367
+ def _load(self) -> None:
368
+ records = self._load_manifest_records()
369
+ series_to_split, self.cv = self._resolve_splits()
370
+
371
+ self.cases: List[Case] = []
372
+ for r in records:
373
+ sid = str(r.get("series_id", ""))
374
+ if not sid:
375
+ continue
376
+
377
+ ct_rel = r.get("ct_relative_path") or f"scans/{sid}/ct.nii.gz"
378
+ msk_rel = r.get("mask_relative_path") or f"scans/{sid}/mask.nii.gz"
379
+
380
+ # Determine split: splits_5fold.json wins; else manifest's native
381
+ # split column. Native splits are training/validation/test
382
+ # (per VerSe). splits_5fold.json collapses non-test to
383
+ # "trainval" so fold() can do the rest.
384
+ split = series_to_split.get(sid) or _coerce_optional_str(r.get("split")) or "unknown"
385
+
386
+ shape = (
387
+ _coerce_optional_int(r.get("shape_p")),
388
+ _coerce_optional_int(r.get("shape_i")),
389
+ _coerce_optional_int(r.get("shape_r")),
390
+ )
391
+ spacing = (
392
+ _coerce_optional_float(r.get("spacing_p_mm")),
393
+ _coerce_optional_float(r.get("spacing_i_mm")),
394
+ _coerce_optional_float(r.get("spacing_r_mm")),
395
+ )
396
+
397
+ self.cases.append(Case(
398
+ series_id = sid,
399
+ patient_id = _coerce_optional_str(r.get("patient_id")),
400
+ ct_path = _resolve_file(self.root, ct_rel),
401
+ mask_path = _resolve_file(self.root, msk_rel),
402
+ split = split,
403
+ source_dataset = _coerce_optional_str(r.get("source_dataset")),
404
+ source_format = _coerce_optional_str(r.get("source_format")),
405
+ shape = shape if all(v is not None for v in shape) else None,
406
+ spacing_mm = spacing if all(v is not None for v in spacing) else None,
407
+ age = _coerce_optional_float(r.get("age")),
408
+ sex = _coerce_optional_str(r.get("sex")),
409
+ patient_pos = _coerce_optional_str(r.get("patient_pos")),
410
+ veridah_applied = _coerce_bool(r.get("veridah_applied", False)),
411
+ veridah_action = _coerce_optional_str(r.get("veridah_action")),
412
+ veridah_kind = _coerce_optional_str(r.get("veridah_kind")),
413
+ n_labels = _coerce_optional_int(r.get("n_labels")) or 0,
414
+ labels_present = _coerce_labels_list(r.get("labels_present")),
415
+ has_T13 = _coerce_bool(r.get("has_T13", False)),
416
+ has_L6 = _coerce_bool(r.get("has_L6", False)),
417
+ lacks_T12_TLJ_in_FOV = _coerce_bool(r.get("lacks_T12_TLJ_in_FOV", False)),
418
+ lstv_class = _coerce_optional_str(r.get("lstv_class")) or "normal",
419
+ ct_file_rel = ct_rel,
420
+ mask_file_rel = msk_rel,
421
+ _parent = self,
422
+ ))
423
+
424
+ self._by_series: Dict[str, Case] = {c.series_id: c for c in self.cases}
425
+
426
+ # ── construction from the Hub ────────────────────────────────────────
427
+ @classmethod
428
+ def from_hub(cls,
429
+ repo_id: str,
430
+ token: Optional[str] = None,
431
+ cache_dir: Optional[str] = None) -> "VerSeFusion":
432
+ """Construct a dataset backed by a HuggingFace dataset repo.
433
+
434
+ Eagerly downloads only metadata files (manifest, splits, README,
435
+ small auxiliary JSONs). NIfTIs are fetched lazily on first
436
+ Case.load_ct() / load_mask() call.
437
+ """
438
+ try:
439
+ from huggingface_hub import snapshot_download
440
+ except ImportError as e:
441
+ raise RuntimeError(
442
+ "huggingface_hub not installed. pip install huggingface_hub"
443
+ ) from e
444
+ local_dir = snapshot_download(
445
+ repo_id = repo_id,
446
+ repo_type = "dataset",
447
+ token = token,
448
+ cache_dir = str(Path(os.path.expanduser(cache_dir))) if cache_dir else None,
449
+ allow_patterns = [
450
+ "manifest.json",
451
+ "manifest.csv",
452
+ "manifest_summary.json",
453
+ "splits_5fold.json",
454
+ "splits.csv",
455
+ "corrections/**",
456
+ "orientation_audit.json",
457
+ "sample_selection.json",
458
+ "README.md",
459
+ "LICENSE",
460
+ "LICENSE.txt",
461
+ "dataset_interface.py",
462
+ ],
463
+ )
464
+ inst = cls(local_dir)
465
+ inst._hf_repo_id = repo_id
466
+ inst._hf_token = token
467
+ inst._hf_cache_dir = (
468
+ str(Path(os.path.expanduser(cache_dir))) if cache_dir else None
469
+ )
470
+ return inst
471
+
472
+ # ── filtering ────────────────────────────────────────────────────────
473
+ def filter(self,
474
+ split: Optional[str | Sequence[str]] = None,
475
+ lstv_class: Optional[str | Sequence[str]] = None,
476
+ source_dataset: Optional[str | Sequence[str]] = None,
477
+ veridah_applied: Optional[bool] = None,
478
+ has_label: Optional[int] = None,
479
+ present_only: bool = False) -> List[Case]:
480
+ """Filter cases by metadata attributes.
481
+
482
+ Each filter accepts a single value or a list of values to match
483
+ against. `present_only=True` means present-on-disk RIGHT NOW —
484
+ for HF-backed datasets that haven't fetched the data yet this
485
+ will return an empty list.
486
+ """
487
+ def _as_list(x):
488
+ if x is None: return None
489
+ return [x] if isinstance(x, str) else list(x)
490
+
491
+ sp = _as_list(split)
492
+ lc = _as_list(lstv_class)
493
+ sd = _as_list(source_dataset)
494
+
495
+ out = list(self.cases)
496
+ if sp: out = [c for c in out if c.split in sp]
497
+ if lc: out = [c for c in out if c.lstv_class in lc]
498
+ if sd: out = [c for c in out if c.source_dataset in sd]
499
+ if veridah_applied is not None:
500
+ out = [c for c in out if bool(c.veridah_applied) == bool(veridah_applied)]
501
+ if has_label is not None:
502
+ out = [c for c in out if c.has_label(int(has_label))]
503
+ if present_only:
504
+ out = [c for c in out if c.exists()]
505
+ return out
506
+
507
+ # ── split accessors ──────────────────────────────────────────────────
508
+ def test_set(self) -> List[Case]:
509
+ """Fixed test holdout (patient-level), per splits_5fold.json or
510
+ the manifest's native `split` column."""
511
+ return [c for c in self.cases if c.split == "test"]
512
+
513
+ def trainval(self) -> List[Case]:
514
+ """Train+val pool — everything not in the test holdout.
515
+
516
+ Native VerSe splits are training/validation; the splits_5fold.json
517
+ path collapses both into "trainval". We accept all three labels
518
+ here so the same code works whichever splits source is in play.
519
+ """
520
+ keep = {"training", "validation", "trainval"}
521
+ return [c for c in self.cases if c.split in keep]
522
+
523
+ def fold(self, i: int) -> Tuple[List[Case], List[Case]]:
524
+ """Return (train_cases, val_cases) for fold i.
525
+
526
+ Lookup is by series_id against splits_5fold.json fold[i].
527
+ Raises RuntimeError if no CV folds are available.
528
+ """
529
+ if self.cv is None:
530
+ raise RuntimeError(
531
+ f"No 5-fold CV found at {self.root}/splits_5fold.json. "
532
+ f"Run `python -m verse_pipeline.splits_builder` "
533
+ f"or `make splits-slurm` to produce one."
534
+ )
535
+ folds = self.cv.get("folds", [])
536
+ if not 0 <= i < len(folds):
537
+ raise IndexError(f"fold {i} out of range [0, {len(folds)})")
538
+ train_set = set(folds[i].get("train_series_ids", []))
539
+ val_set = set(folds[i].get("val_series_ids", []))
540
+ train = [c for c in self.cases if c.series_id in train_set]
541
+ val = [c for c in self.cases if c.series_id in val_set]
542
+ return train, val
543
+
544
+ @property
545
+ def n_folds(self) -> int:
546
+ if not self.cv:
547
+ return 0
548
+ return len(self.cv.get("folds", []))
549
+
550
+ def splits(self) -> Tuple[List[Case], List[Case], List[Case]]:
551
+ """Backward-compatible 3-tuple (train, val, test) — train is the
552
+ full train+val pool, val is empty. Use fold(i) for real splits."""
553
+ return self.trainval(), [], self.test_set()
554
+
555
+ # ── lookup ───────────────────────────────────────────────────────────
556
+ def get(self, series_id: str) -> Optional[Case]:
557
+ return self._by_series.get(str(series_id))
558
+
559
+ def __len__(self) -> int:
560
+ return len(self.cases)
561
+
562
+ def __iter__(self):
563
+ return iter(self.cases)
564
+
565
+ # ── stats ────────────────────────────────────────────────────────────
566
+ def stats(self) -> str:
567
+ from collections import Counter
568
+ sp = Counter(c.split for c in self.cases)
569
+ lst = Counter(c.lstv_class for c in self.cases)
570
+ sd = Counter(c.source_dataset or "?" for c in self.cases)
571
+ fmt = Counter(c.source_format or "?" for c in self.cases)
572
+ n_present = sum(1 for c in self.cases if c.exists())
573
+ n_t13 = sum(1 for c in self.cases if c.has_T13)
574
+ n_l6 = sum(1 for c in self.cases if c.has_L6)
575
+ n_trunc = sum(1 for c in self.cases if c.lacks_T12_TLJ_in_FOV)
576
+ n_ver = sum(1 for c in self.cases if c.veridah_applied)
577
+ n_pats = len({c.patient_id for c in self.cases if c.patient_id})
578
+
579
+ lines = [
580
+ "VerSeFusion",
581
+ f" root: {self.root}",
582
+ f" scans: {len(self.cases)} (present on disk: {n_present})",
583
+ f" unique patients: {n_pats}",
584
+ f" splits: {dict(sp)}",
585
+ f" lstv_class: {dict(lst)}",
586
+ f" source_dataset: {dict(sd)}",
587
+ f" source_format: {dict(fmt)}",
588
+ f" flags: has_T13={n_t13} has_L6={n_l6} truncated={n_trunc}",
589
+ f" veridah_applied: {n_ver}",
590
+ f" cv folds: {self.n_folds}",
591
+ ]
592
+ if self.splits_schema_version:
593
+ lines.append(f" splits source: schema_v{self.splits_schema_version} "
594
+ f"scheme={self.splits_scheme or '-'}")
595
+ else:
596
+ lines.append(" splits source: (manifest native splits; no CV)")
597
+ if self._hf_repo_id:
598
+ lines.append(
599
+ f" hf-backed: {self._hf_repo_id} "
600
+ f"(NIfTIs fetched lazily; cache_dir={self._hf_cache_dir or 'default'})"
601
+ )
602
+ return "\n".join(lines)
603
+
604
+ def __repr__(self) -> str:
605
+ return f"VerSeFusion(root={self.root!s}, n_scans={len(self)}, n_folds={self.n_folds})"
606
+
607
+
608
+ # ============================================================================
609
+ # PyTorch Dataset adapter
610
+ # ============================================================================
611
+
612
+ try:
613
+ import torch
614
+ from torch.utils.data import Dataset
615
+ _HAS_TORCH = True
616
+ except ImportError:
617
+ _HAS_TORCH = False
618
+ Dataset = object # type: ignore
619
+
620
+
621
+ class VerSeFusionDataset(Dataset):
622
+ """PyTorch Dataset yielding per-case tensors from NIfTI files.
623
+
624
+ Split selection:
625
+ split="trainval" — whole train+val pool
626
+ split="test" — fixed test holdout
627
+ split=("fold", 0, "train") — fold 0 train side of 5-fold CV
628
+ split=("fold", 0, "val") — fold 0 val side
629
+ split="all" — every scan
630
+
631
+ HF-backed roots fetch NIfTIs lazily on first __getitem__. With
632
+ num_workers>0, multiple workers may race to fetch the same case —
633
+ huggingface_hub uses file locks to make this safe.
634
+ """
635
+
636
+ def __init__(self,
637
+ root,
638
+ split=("fold", 0, "train"),
639
+ lstv_class: Optional[str | Sequence[str]] = None,
640
+ transform=None,
641
+ cache_dir: Optional[str] = None):
642
+ if not _HAS_TORCH:
643
+ raise RuntimeError("torch is required for VerSeFusionDataset")
644
+
645
+ # Auto-detect HF vs local
646
+ root_path = Path(os.path.expanduser(str(root)))
647
+ if root_path.exists() and (root_path / "manifest.json").exists():
648
+ self._ds = VerSeFusion(root_path)
649
+ else:
650
+ self._ds = VerSeFusion.from_hub(repo_id=str(root), cache_dir=cache_dir)
651
+
652
+ self.split = split
653
+ self.transform = transform
654
+
655
+ if isinstance(split, tuple) and len(split) == 3 and split[0] == "fold":
656
+ _, fold_i, side = split
657
+ tr, va = self._ds.fold(int(fold_i))
658
+ cases = tr if side == "train" else va
659
+ elif split == "test":
660
+ cases = self._ds.test_set()
661
+ elif split == "trainval":
662
+ cases = self._ds.trainval()
663
+ elif split == "all":
664
+ cases = list(self._ds.cases)
665
+ else:
666
+ raise ValueError(f"Unknown split spec: {split!r}")
667
+
668
+ # Optional further filter
669
+ if lstv_class is not None:
670
+ lc = [lstv_class] if isinstance(lstv_class, str) else list(lstv_class)
671
+ cases = [c for c in cases if c.lstv_class in lc]
672
+
673
+ # For HF-backed: don't filter on present_only (files arrive lazily)
674
+ if self._ds._hf_repo_id:
675
+ self.cases: List[Case] = list(cases)
676
+ else:
677
+ self.cases = [c for c in cases if c.exists()]
678
+
679
+ def __len__(self) -> int:
680
+ return len(self.cases)
681
+
682
+ def __getitem__(self, idx: int) -> dict:
683
+ c = self.cases[idx]
684
+ ct_np, affine = c.load_ct()
685
+ msk_np, _ = c.load_mask()
686
+ return self._collate(c, ct_np, msk_np, affine)
687
+
688
+ def _collate(self, c: Case, ct_np, msk_np, affine) -> dict:
689
+ ct = torch.from_numpy(ct_np.astype("float32")).unsqueeze(0) # (1, P, I, R)
690
+ mask = torch.from_numpy(msk_np.astype("int64")) # (P, I, R)
691
+ item = {
692
+ "ct": ct,
693
+ "mask": mask,
694
+ "affine": torch.from_numpy(affine.astype("float32")),
695
+ "series_id": c.series_id,
696
+ "patient_id": c.patient_id or "",
697
+ "split": c.split,
698
+ "meta": {
699
+ "source_dataset": c.source_dataset,
700
+ "source_format": c.source_format,
701
+ "spacing_mm": c.spacing_mm,
702
+ "shape": c.shape,
703
+ "age": c.age,
704
+ "sex": c.sex,
705
+ "veridah_applied": c.veridah_applied,
706
+ "veridah_action": c.veridah_action,
707
+ "lstv_class": c.lstv_class,
708
+ "has_T13": c.has_T13,
709
+ "has_L6": c.has_L6,
710
+ "lacks_T12_TLJ_in_FOV": c.lacks_T12_TLJ_in_FOV,
711
+ "n_labels": c.n_labels,
712
+ "labels_present": list(c.labels_present),
713
+ },
714
+ }
715
+ if self.transform is not None:
716
+ item = self.transform(item)
717
+ return item
718
+
719
+
720
+ # ============================================================================
721
+ # CLI smoke test
722
+ # ============================================================================
723
+
724
+ if __name__ == "__main__":
725
+ import argparse
726
+ ap = argparse.ArgumentParser(description="Smoke test: load + print stats.")
727
+ ap.add_argument("--root", required=True,
728
+ help="Local dataset dir OR HF repo_id (e.g. user/repo)")
729
+ ap.add_argument("--cache_dir", default=None)
730
+ args = ap.parse_args()
731
+
732
+ root_path = Path(os.path.expanduser(args.root))
733
+ if root_path.exists():
734
+ ds = VerSeFusion(root_path)
735
+ else:
736
+ ds = VerSeFusion.from_hub(args.root, cache_dir=args.cache_dir)
737
+ print(ds.stats())
738
+
739
+ print(f"\ntest / trainval: {len(ds.test_set())} / {len(ds.trainval())}")
740
+ if ds.n_folds > 0:
741
+ tr, va = ds.fold(0)
742
+ print(f"fold 0 train/val: {len(tr)} / {len(va)}")
743
+
744
+ sample = ds.trainval() or list(ds.cases)
745
+ if sample:
746
+ c = sample[0]
747
+ print(f"\nfirst case:")
748
+ print(f" series_id: {c.series_id}")
749
+ print(f" patient_id: {c.patient_id}")
750
+ print(f" split: {c.split}")
751
+ print(f" lstv_class: {c.lstv_class}")
752
+ print(f" ct_path: {c.ct_path} (exists={c.ct_path.exists()})")
753
+ print(f" mask_path: {c.mask_path} (exists={c.mask_path.exists()})")
754
+ print(f" spacing_mm: {c.spacing_mm}")
755
+ print(f" shape: {c.shape}")
756
+ print(f" veridah: applied={c.veridah_applied} action={c.veridah_action}")
757
+ print(f" n_labels: {c.n_labels}")
manifest.csv ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ series_id,patient_id,split,source_dataset,source_format,shape_p,shape_i,shape_r,spacing_p_mm,spacing_i_mm,spacing_r_mm,age,sex,patient_pos,veridah_applied,veridah_action,veridah_kind,n_labels,labels_present,has_T13,has_L6,lacks_T12_TLJ_in_FOV,lstv_class,lstv_class_audit,tltv_class_audit,ct_relative_path,mask_relative_path
2
+ verse108,verse108,test,verse20,miccai,459,733,494,1.0,1.0,1.0,52.0,F,1 of 1,False,,,24,"[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24]",False,False,False,normal,lsj_fov_truncated,normal_thoracolumbar,scans/verse108/ct.nii.gz,scans/verse108/mask.nii.gz
3
+ verse236,verse236,test,verse20,miccai,369,787,369,1.0,1.0,1.0,88.0,M,1 of 1,False,,,24,"[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24]",False,False,False,normal,lsj_fov_truncated,normal_thoracolumbar,scans/verse236/ct.nii.gz,scans/verse236/mask.nii.gz
4
+ verse547,verse547,validation,verse20,miccai,512,900,512,0.923828125,0.899993896484375,0.923828125,24.0,F,1 of 1,False,,,25,"[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 28]",True,False,False,t13_supernumerary,lsj_fov_truncated,t13_supernumerary,scans/verse547/ct.nii.gz,scans/verse547/mask.nii.gz
5
+ verse585,verse585,validation,verse20,miccai,512,1258,164,0.68359375,0.683624804019928,2.0,35.0,M,1 of 1,False,,,25,"[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]",False,True,False,lumbarization,lumbarization,normal_thoracolumbar,scans/verse585/ct.nii.gz,scans/verse585/mask.nii.gz
6
+ verse602,verse602,test,verse20,miccai,512,2023,512,0.9765625,0.9000005722045898,0.9765625,65.0,M,1 of 1,False,,,25,"[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 28]",True,False,False,t13_supernumerary,lsj_fov_truncated,t13_supernumerary,scans/verse602/ct.nii.gz,scans/verse602/mask.nii.gz
7
+ verse631,verse631,training,verse20,miccai,512,1190,158,0.685546875,0.6857143044471741,2.0,64.0,M,1 of 1,False,,,25,"[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 28]",True,False,False,t13_supernumerary,lsj_fov_truncated,t13_supernumerary,scans/verse631/ct.nii.gz,scans/verse631/mask.nii.gz
8
+ verse644,verse644,validation,verse20,miccai,512,2048,76,0.4023437370719854,0.4023437385580621,2.9997239631125714,29.0,F,1 of 1,False,,,24,"[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24]",False,False,False,normal,lsj_fov_truncated,normal_thoracolumbar,scans/verse644/ct.nii.gz,scans/verse644/mask.nii.gz
9
+ verse649,verse649,test,verse20,miccai,512,1346,162,0.55859375,0.5586923956871033,2.0,48.0,M,1 of 1,False,,,24,"[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24]",False,False,False,normal,lsj_fov_truncated,normal_thoracolumbar,scans/verse649/ct.nii.gz,scans/verse649/mask.nii.gz
10
+ verse758,verse758,test,verse20,miccai,512,780,512,1.3671879768371582,1.25,1.3671879768371582,37.0,F,1 of 1,False,,,24,"[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24]",False,False,False,normal,lsj_fov_truncated,normal_thoracolumbar,scans/verse758/ct.nii.gz,scans/verse758/mask.nii.gz
11
+ verse759,verse759,validation,verse20,miccai,512,512,168,1.6748050451278689,1.6748050451278689,2.5,83.0,M,1 of 1,False,,,24,"[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24]",False,False,False,normal,lsj_fov_truncated,normal_thoracolumbar,scans/verse759/ct.nii.gz,scans/verse759/mask.nii.gz
manifest.json ADDED
@@ -0,0 +1,552 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "schema_version": 1,
3
+ "dataset_name": "VerSeFusion",
4
+ "n_subjects": 10,
5
+ "subjects": [
6
+ {
7
+ "series_id": "verse108",
8
+ "patient_id": "verse108",
9
+ "split": "test",
10
+ "source_dataset": "verse20",
11
+ "source_format": "miccai",
12
+ "shape_p": 459,
13
+ "shape_i": 733,
14
+ "shape_r": 494,
15
+ "spacing_p_mm": 1.0,
16
+ "spacing_i_mm": 1.0,
17
+ "spacing_r_mm": 1.0,
18
+ "age": 52.0,
19
+ "sex": "F",
20
+ "patient_pos": "1 of 1",
21
+ "veridah_applied": false,
22
+ "veridah_action": null,
23
+ "veridah_kind": null,
24
+ "n_labels": 24,
25
+ "labels_present": [
26
+ 1,
27
+ 2,
28
+ 3,
29
+ 4,
30
+ 5,
31
+ 6,
32
+ 7,
33
+ 8,
34
+ 9,
35
+ 10,
36
+ 11,
37
+ 12,
38
+ 13,
39
+ 14,
40
+ 15,
41
+ 16,
42
+ 17,
43
+ 18,
44
+ 19,
45
+ 20,
46
+ 21,
47
+ 22,
48
+ 23,
49
+ 24
50
+ ],
51
+ "has_T13": false,
52
+ "has_L6": false,
53
+ "lacks_T12_TLJ_in_FOV": false,
54
+ "lstv_class": "normal",
55
+ "lstv_class_audit": "lsj_fov_truncated",
56
+ "tltv_class_audit": "normal_thoracolumbar",
57
+ "ct_relative_path": "scans/verse108/ct.nii.gz",
58
+ "mask_relative_path": "scans/verse108/mask.nii.gz"
59
+ },
60
+ {
61
+ "series_id": "verse236",
62
+ "patient_id": "verse236",
63
+ "split": "test",
64
+ "source_dataset": "verse20",
65
+ "source_format": "miccai",
66
+ "shape_p": 369,
67
+ "shape_i": 787,
68
+ "shape_r": 369,
69
+ "spacing_p_mm": 1.0,
70
+ "spacing_i_mm": 1.0,
71
+ "spacing_r_mm": 1.0,
72
+ "age": 88.0,
73
+ "sex": "M",
74
+ "patient_pos": "1 of 1",
75
+ "veridah_applied": false,
76
+ "veridah_action": null,
77
+ "veridah_kind": null,
78
+ "n_labels": 24,
79
+ "labels_present": [
80
+ 1,
81
+ 2,
82
+ 3,
83
+ 4,
84
+ 5,
85
+ 6,
86
+ 7,
87
+ 8,
88
+ 9,
89
+ 10,
90
+ 11,
91
+ 12,
92
+ 13,
93
+ 14,
94
+ 15,
95
+ 16,
96
+ 17,
97
+ 18,
98
+ 19,
99
+ 20,
100
+ 21,
101
+ 22,
102
+ 23,
103
+ 24
104
+ ],
105
+ "has_T13": false,
106
+ "has_L6": false,
107
+ "lacks_T12_TLJ_in_FOV": false,
108
+ "lstv_class": "normal",
109
+ "lstv_class_audit": "lsj_fov_truncated",
110
+ "tltv_class_audit": "normal_thoracolumbar",
111
+ "ct_relative_path": "scans/verse236/ct.nii.gz",
112
+ "mask_relative_path": "scans/verse236/mask.nii.gz"
113
+ },
114
+ {
115
+ "series_id": "verse547",
116
+ "patient_id": "verse547",
117
+ "split": "validation",
118
+ "source_dataset": "verse20",
119
+ "source_format": "miccai",
120
+ "shape_p": 512,
121
+ "shape_i": 900,
122
+ "shape_r": 512,
123
+ "spacing_p_mm": 0.923828125,
124
+ "spacing_i_mm": 0.899993896484375,
125
+ "spacing_r_mm": 0.923828125,
126
+ "age": 24.0,
127
+ "sex": "F",
128
+ "patient_pos": "1 of 1",
129
+ "veridah_applied": false,
130
+ "veridah_action": null,
131
+ "veridah_kind": null,
132
+ "n_labels": 25,
133
+ "labels_present": [
134
+ 1,
135
+ 2,
136
+ 3,
137
+ 4,
138
+ 5,
139
+ 6,
140
+ 7,
141
+ 8,
142
+ 9,
143
+ 10,
144
+ 11,
145
+ 12,
146
+ 13,
147
+ 14,
148
+ 15,
149
+ 16,
150
+ 17,
151
+ 18,
152
+ 19,
153
+ 20,
154
+ 21,
155
+ 22,
156
+ 23,
157
+ 24,
158
+ 28
159
+ ],
160
+ "has_T13": true,
161
+ "has_L6": false,
162
+ "lacks_T12_TLJ_in_FOV": false,
163
+ "lstv_class": "t13_supernumerary",
164
+ "lstv_class_audit": "lsj_fov_truncated",
165
+ "tltv_class_audit": "t13_supernumerary",
166
+ "ct_relative_path": "scans/verse547/ct.nii.gz",
167
+ "mask_relative_path": "scans/verse547/mask.nii.gz"
168
+ },
169
+ {
170
+ "series_id": "verse585",
171
+ "patient_id": "verse585",
172
+ "split": "validation",
173
+ "source_dataset": "verse20",
174
+ "source_format": "miccai",
175
+ "shape_p": 512,
176
+ "shape_i": 1258,
177
+ "shape_r": 164,
178
+ "spacing_p_mm": 0.68359375,
179
+ "spacing_i_mm": 0.683624804019928,
180
+ "spacing_r_mm": 2.0,
181
+ "age": 35.0,
182
+ "sex": "M",
183
+ "patient_pos": "1 of 1",
184
+ "veridah_applied": false,
185
+ "veridah_action": null,
186
+ "veridah_kind": null,
187
+ "n_labels": 25,
188
+ "labels_present": [
189
+ 1,
190
+ 2,
191
+ 3,
192
+ 4,
193
+ 5,
194
+ 6,
195
+ 7,
196
+ 8,
197
+ 9,
198
+ 10,
199
+ 11,
200
+ 12,
201
+ 13,
202
+ 14,
203
+ 15,
204
+ 16,
205
+ 17,
206
+ 18,
207
+ 19,
208
+ 20,
209
+ 21,
210
+ 22,
211
+ 23,
212
+ 24,
213
+ 25
214
+ ],
215
+ "has_T13": false,
216
+ "has_L6": true,
217
+ "lacks_T12_TLJ_in_FOV": false,
218
+ "lstv_class": "lumbarization",
219
+ "lstv_class_audit": "lumbarization",
220
+ "tltv_class_audit": "normal_thoracolumbar",
221
+ "ct_relative_path": "scans/verse585/ct.nii.gz",
222
+ "mask_relative_path": "scans/verse585/mask.nii.gz"
223
+ },
224
+ {
225
+ "series_id": "verse602",
226
+ "patient_id": "verse602",
227
+ "split": "test",
228
+ "source_dataset": "verse20",
229
+ "source_format": "miccai",
230
+ "shape_p": 512,
231
+ "shape_i": 2023,
232
+ "shape_r": 512,
233
+ "spacing_p_mm": 0.9765625,
234
+ "spacing_i_mm": 0.9000005722045898,
235
+ "spacing_r_mm": 0.9765625,
236
+ "age": 65.0,
237
+ "sex": "M",
238
+ "patient_pos": "1 of 1",
239
+ "veridah_applied": false,
240
+ "veridah_action": null,
241
+ "veridah_kind": null,
242
+ "n_labels": 25,
243
+ "labels_present": [
244
+ 1,
245
+ 2,
246
+ 3,
247
+ 4,
248
+ 5,
249
+ 6,
250
+ 7,
251
+ 8,
252
+ 9,
253
+ 10,
254
+ 11,
255
+ 12,
256
+ 13,
257
+ 14,
258
+ 15,
259
+ 16,
260
+ 17,
261
+ 18,
262
+ 19,
263
+ 20,
264
+ 21,
265
+ 22,
266
+ 23,
267
+ 24,
268
+ 28
269
+ ],
270
+ "has_T13": true,
271
+ "has_L6": false,
272
+ "lacks_T12_TLJ_in_FOV": false,
273
+ "lstv_class": "t13_supernumerary",
274
+ "lstv_class_audit": "lsj_fov_truncated",
275
+ "tltv_class_audit": "t13_supernumerary",
276
+ "ct_relative_path": "scans/verse602/ct.nii.gz",
277
+ "mask_relative_path": "scans/verse602/mask.nii.gz"
278
+ },
279
+ {
280
+ "series_id": "verse631",
281
+ "patient_id": "verse631",
282
+ "split": "training",
283
+ "source_dataset": "verse20",
284
+ "source_format": "miccai",
285
+ "shape_p": 512,
286
+ "shape_i": 1190,
287
+ "shape_r": 158,
288
+ "spacing_p_mm": 0.685546875,
289
+ "spacing_i_mm": 0.6857143044471741,
290
+ "spacing_r_mm": 2.0,
291
+ "age": 64.0,
292
+ "sex": "M",
293
+ "patient_pos": "1 of 1",
294
+ "veridah_applied": false,
295
+ "veridah_action": null,
296
+ "veridah_kind": null,
297
+ "n_labels": 25,
298
+ "labels_present": [
299
+ 1,
300
+ 2,
301
+ 3,
302
+ 4,
303
+ 5,
304
+ 6,
305
+ 7,
306
+ 8,
307
+ 9,
308
+ 10,
309
+ 11,
310
+ 12,
311
+ 13,
312
+ 14,
313
+ 15,
314
+ 16,
315
+ 17,
316
+ 18,
317
+ 19,
318
+ 20,
319
+ 21,
320
+ 22,
321
+ 23,
322
+ 24,
323
+ 28
324
+ ],
325
+ "has_T13": true,
326
+ "has_L6": false,
327
+ "lacks_T12_TLJ_in_FOV": false,
328
+ "lstv_class": "t13_supernumerary",
329
+ "lstv_class_audit": "lsj_fov_truncated",
330
+ "tltv_class_audit": "t13_supernumerary",
331
+ "ct_relative_path": "scans/verse631/ct.nii.gz",
332
+ "mask_relative_path": "scans/verse631/mask.nii.gz"
333
+ },
334
+ {
335
+ "series_id": "verse644",
336
+ "patient_id": "verse644",
337
+ "split": "validation",
338
+ "source_dataset": "verse20",
339
+ "source_format": "miccai",
340
+ "shape_p": 512,
341
+ "shape_i": 2048,
342
+ "shape_r": 76,
343
+ "spacing_p_mm": 0.4023437370719854,
344
+ "spacing_i_mm": 0.40234373855806216,
345
+ "spacing_r_mm": 2.9997239631125714,
346
+ "age": 29.0,
347
+ "sex": "F",
348
+ "patient_pos": "1 of 1",
349
+ "veridah_applied": false,
350
+ "veridah_action": null,
351
+ "veridah_kind": null,
352
+ "n_labels": 24,
353
+ "labels_present": [
354
+ 1,
355
+ 2,
356
+ 3,
357
+ 4,
358
+ 5,
359
+ 6,
360
+ 7,
361
+ 8,
362
+ 9,
363
+ 10,
364
+ 11,
365
+ 12,
366
+ 13,
367
+ 14,
368
+ 15,
369
+ 16,
370
+ 17,
371
+ 18,
372
+ 19,
373
+ 20,
374
+ 21,
375
+ 22,
376
+ 23,
377
+ 24
378
+ ],
379
+ "has_T13": false,
380
+ "has_L6": false,
381
+ "lacks_T12_TLJ_in_FOV": false,
382
+ "lstv_class": "normal",
383
+ "lstv_class_audit": "lsj_fov_truncated",
384
+ "tltv_class_audit": "normal_thoracolumbar",
385
+ "ct_relative_path": "scans/verse644/ct.nii.gz",
386
+ "mask_relative_path": "scans/verse644/mask.nii.gz"
387
+ },
388
+ {
389
+ "series_id": "verse649",
390
+ "patient_id": "verse649",
391
+ "split": "test",
392
+ "source_dataset": "verse20",
393
+ "source_format": "miccai",
394
+ "shape_p": 512,
395
+ "shape_i": 1346,
396
+ "shape_r": 162,
397
+ "spacing_p_mm": 0.55859375,
398
+ "spacing_i_mm": 0.5586923956871033,
399
+ "spacing_r_mm": 2.0,
400
+ "age": 48.0,
401
+ "sex": "M",
402
+ "patient_pos": "1 of 1",
403
+ "veridah_applied": false,
404
+ "veridah_action": null,
405
+ "veridah_kind": null,
406
+ "n_labels": 24,
407
+ "labels_present": [
408
+ 1,
409
+ 2,
410
+ 3,
411
+ 4,
412
+ 5,
413
+ 6,
414
+ 7,
415
+ 8,
416
+ 9,
417
+ 10,
418
+ 11,
419
+ 12,
420
+ 13,
421
+ 14,
422
+ 15,
423
+ 16,
424
+ 17,
425
+ 18,
426
+ 19,
427
+ 20,
428
+ 21,
429
+ 22,
430
+ 23,
431
+ 24
432
+ ],
433
+ "has_T13": false,
434
+ "has_L6": false,
435
+ "lacks_T12_TLJ_in_FOV": false,
436
+ "lstv_class": "normal",
437
+ "lstv_class_audit": "lsj_fov_truncated",
438
+ "tltv_class_audit": "normal_thoracolumbar",
439
+ "ct_relative_path": "scans/verse649/ct.nii.gz",
440
+ "mask_relative_path": "scans/verse649/mask.nii.gz"
441
+ },
442
+ {
443
+ "series_id": "verse758",
444
+ "patient_id": "verse758",
445
+ "split": "test",
446
+ "source_dataset": "verse20",
447
+ "source_format": "miccai",
448
+ "shape_p": 512,
449
+ "shape_i": 780,
450
+ "shape_r": 512,
451
+ "spacing_p_mm": 1.3671879768371582,
452
+ "spacing_i_mm": 1.25,
453
+ "spacing_r_mm": 1.3671879768371582,
454
+ "age": 37.0,
455
+ "sex": "F",
456
+ "patient_pos": "1 of 1",
457
+ "veridah_applied": false,
458
+ "veridah_action": null,
459
+ "veridah_kind": null,
460
+ "n_labels": 24,
461
+ "labels_present": [
462
+ 1,
463
+ 2,
464
+ 3,
465
+ 4,
466
+ 5,
467
+ 6,
468
+ 7,
469
+ 8,
470
+ 9,
471
+ 10,
472
+ 11,
473
+ 12,
474
+ 13,
475
+ 14,
476
+ 15,
477
+ 16,
478
+ 17,
479
+ 18,
480
+ 19,
481
+ 20,
482
+ 21,
483
+ 22,
484
+ 23,
485
+ 24
486
+ ],
487
+ "has_T13": false,
488
+ "has_L6": false,
489
+ "lacks_T12_TLJ_in_FOV": false,
490
+ "lstv_class": "normal",
491
+ "lstv_class_audit": "lsj_fov_truncated",
492
+ "tltv_class_audit": "normal_thoracolumbar",
493
+ "ct_relative_path": "scans/verse758/ct.nii.gz",
494
+ "mask_relative_path": "scans/verse758/mask.nii.gz"
495
+ },
496
+ {
497
+ "series_id": "verse759",
498
+ "patient_id": "verse759",
499
+ "split": "validation",
500
+ "source_dataset": "verse20",
501
+ "source_format": "miccai",
502
+ "shape_p": 512,
503
+ "shape_i": 512,
504
+ "shape_r": 168,
505
+ "spacing_p_mm": 1.6748050451278687,
506
+ "spacing_i_mm": 1.6748050451278687,
507
+ "spacing_r_mm": 2.5,
508
+ "age": 83.0,
509
+ "sex": "M",
510
+ "patient_pos": "1 of 1",
511
+ "veridah_applied": false,
512
+ "veridah_action": null,
513
+ "veridah_kind": null,
514
+ "n_labels": 24,
515
+ "labels_present": [
516
+ 1,
517
+ 2,
518
+ 3,
519
+ 4,
520
+ 5,
521
+ 6,
522
+ 7,
523
+ 8,
524
+ 9,
525
+ 10,
526
+ 11,
527
+ 12,
528
+ 13,
529
+ 14,
530
+ 15,
531
+ 16,
532
+ 17,
533
+ 18,
534
+ 19,
535
+ 20,
536
+ 21,
537
+ 22,
538
+ 23,
539
+ 24
540
+ ],
541
+ "has_T13": false,
542
+ "has_L6": false,
543
+ "lacks_T12_TLJ_in_FOV": false,
544
+ "lstv_class": "normal",
545
+ "lstv_class_audit": "lsj_fov_truncated",
546
+ "tltv_class_audit": "normal_thoracolumbar",
547
+ "ct_relative_path": "scans/verse759/ct.nii.gz",
548
+ "mask_relative_path": "scans/verse759/mask.nii.gz"
549
+ }
550
+ ],
551
+ "subset_filtered": true
552
+ }
sample_selection.json ADDED
@@ -0,0 +1,90 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "criteria": "top-N by unique vertebra-label count, veridah-corrected tiebreak",
3
+ "source": "manifest.csv",
4
+ "n_requested": 10,
5
+ "n_selected": 10,
6
+ "selected_ids": [
7
+ "verse547",
8
+ "verse585",
9
+ "verse602",
10
+ "verse631",
11
+ "verse108",
12
+ "verse236",
13
+ "verse644",
14
+ "verse649",
15
+ "verse758",
16
+ "verse759"
17
+ ],
18
+ "all_scores": [
19
+ {
20
+ "series_id": "verse547",
21
+ "n_labels": 25,
22
+ "veridah_applied": false,
23
+ "lstv_class": "t13_supernumerary",
24
+ "source_tag": "manifest"
25
+ },
26
+ {
27
+ "series_id": "verse585",
28
+ "n_labels": 25,
29
+ "veridah_applied": false,
30
+ "lstv_class": "lumbarization",
31
+ "source_tag": "manifest"
32
+ },
33
+ {
34
+ "series_id": "verse602",
35
+ "n_labels": 25,
36
+ "veridah_applied": false,
37
+ "lstv_class": "t13_supernumerary",
38
+ "source_tag": "manifest"
39
+ },
40
+ {
41
+ "series_id": "verse631",
42
+ "n_labels": 25,
43
+ "veridah_applied": false,
44
+ "lstv_class": "t13_supernumerary",
45
+ "source_tag": "manifest"
46
+ },
47
+ {
48
+ "series_id": "verse108",
49
+ "n_labels": 24,
50
+ "veridah_applied": false,
51
+ "lstv_class": "normal",
52
+ "source_tag": "manifest"
53
+ },
54
+ {
55
+ "series_id": "verse236",
56
+ "n_labels": 24,
57
+ "veridah_applied": false,
58
+ "lstv_class": "normal",
59
+ "source_tag": "manifest"
60
+ },
61
+ {
62
+ "series_id": "verse644",
63
+ "n_labels": 24,
64
+ "veridah_applied": false,
65
+ "lstv_class": "normal",
66
+ "source_tag": "manifest"
67
+ },
68
+ {
69
+ "series_id": "verse649",
70
+ "n_labels": 24,
71
+ "veridah_applied": false,
72
+ "lstv_class": "normal",
73
+ "source_tag": "manifest"
74
+ },
75
+ {
76
+ "series_id": "verse758",
77
+ "n_labels": 24,
78
+ "veridah_applied": false,
79
+ "lstv_class": "normal",
80
+ "source_tag": "manifest"
81
+ },
82
+ {
83
+ "series_id": "verse759",
84
+ "n_labels": 24,
85
+ "veridah_applied": false,
86
+ "lstv_class": "normal",
87
+ "source_tag": "manifest"
88
+ }
89
+ ]
90
+ }
scans/verse108/ct.nii.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a8882c99993d224198c1ff6e12619bde1f1246e44e24b79b0c32f27585bbdebf
3
+ size 482821100
scans/verse108/mask.nii.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:050d698d69f8726ddf14e581a7aa37b48fc29d3037447ad867b0c0cd4d751a27
3
+ size 6149902
scans/verse108/meta.json ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "series_id": "verse108",
3
+ "source_tag": "canonical",
4
+ "files": {
5
+ "ct": "ct.nii.gz",
6
+ "mask": "mask.nii.gz"
7
+ },
8
+ "orientation_axcodes": [
9
+ "P",
10
+ "I",
11
+ "R"
12
+ ],
13
+ "spacing_mm": [
14
+ 1.0,
15
+ 1.0,
16
+ 1.0
17
+ ],
18
+ "shape": [
19
+ 459,
20
+ 733,
21
+ 494
22
+ ],
23
+ "split": "test",
24
+ "patient_id": "verse108",
25
+ "source_format": "miccai"
26
+ }
scans/verse236/ct.nii.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f6d58b4428bd2d0fb9477b946b4b1e9de4c2afa10dd8772882626e0139eb8122
3
+ size 383094427
scans/verse236/mask.nii.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:cd580799ca908a04f566b894e8e8d326eac44a502a00a9bf0b996e21dd0ecf5f
3
+ size 4175482
scans/verse236/meta.json ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "series_id": "verse236",
3
+ "source_tag": "canonical",
4
+ "files": {
5
+ "ct": "ct.nii.gz",
6
+ "mask": "mask.nii.gz"
7
+ },
8
+ "orientation_axcodes": [
9
+ "P",
10
+ "I",
11
+ "R"
12
+ ],
13
+ "spacing_mm": [
14
+ 1.0,
15
+ 1.0,
16
+ 1.0
17
+ ],
18
+ "shape": [
19
+ 369,
20
+ 787,
21
+ 369
22
+ ],
23
+ "split": "test",
24
+ "patient_id": "verse236",
25
+ "source_format": "miccai"
26
+ }
scans/verse547/ct.nii.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:21e09470e29e01d05aeb200102d2657a0babca14a0ab0cf44b461d0a0b4ec833
3
+ size 394188825
scans/verse547/mask.nii.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:fd4d8718a4683e91fa74504dbb7284a169752decf21afb6adf0141224bd59a6d
3
+ size 8630196
scans/verse547/meta.json ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "series_id": "verse547",
3
+ "source_tag": "canonical",
4
+ "files": {
5
+ "ct": "ct.nii.gz",
6
+ "mask": "mask.nii.gz"
7
+ },
8
+ "orientation_axcodes": [
9
+ "P",
10
+ "I",
11
+ "R"
12
+ ],
13
+ "spacing_mm": [
14
+ 0.923828125,
15
+ 0.899993896484375,
16
+ 0.923828125
17
+ ],
18
+ "shape": [
19
+ 512,
20
+ 900,
21
+ 512
22
+ ],
23
+ "split": "validation",
24
+ "patient_id": "verse547",
25
+ "source_format": "miccai"
26
+ }
scans/verse585/ct.nii.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:68e08707453cada93e0b9a95e0cae8a3373e01db9ca93cda0577252df5c4ae80
3
+ size 210544816
scans/verse585/mask.nii.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:2374502ccf154ef540e40f75f3e1bce69062c5c570c788c2d5d0685b18cfa118
3
+ size 4003475
scans/verse585/meta.json ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "series_id": "verse585",
3
+ "source_tag": "canonical",
4
+ "files": {
5
+ "ct": "ct.nii.gz",
6
+ "mask": "mask.nii.gz"
7
+ },
8
+ "orientation_axcodes": [
9
+ "P",
10
+ "I",
11
+ "R"
12
+ ],
13
+ "spacing_mm": [
14
+ 0.68359375,
15
+ 0.683624804019928,
16
+ 2.0
17
+ ],
18
+ "shape": [
19
+ 512,
20
+ 1258,
21
+ 164
22
+ ],
23
+ "split": "validation",
24
+ "patient_id": "verse585",
25
+ "source_format": "miccai"
26
+ }
scans/verse602/ct.nii.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c4cd20975f4074298b67c4ded90823206064785f4aaada444433d09419b391c2
3
+ size 759015608
scans/verse602/mask.nii.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:bf85a200f8eb5eceeaf5f52c1431e1655e1797547ed5fcc6b7b9c73f65c38e62
3
+ size 19040194
scans/verse602/meta.json ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "series_id": "verse602",
3
+ "source_tag": "canonical",
4
+ "files": {
5
+ "ct": "ct.nii.gz",
6
+ "mask": "mask.nii.gz"
7
+ },
8
+ "orientation_axcodes": [
9
+ "P",
10
+ "I",
11
+ "R"
12
+ ],
13
+ "spacing_mm": [
14
+ 0.9765625,
15
+ 0.9000005722045898,
16
+ 0.9765625
17
+ ],
18
+ "shape": [
19
+ 512,
20
+ 2023,
21
+ 512
22
+ ],
23
+ "split": "test",
24
+ "patient_id": "verse602",
25
+ "source_format": "miccai"
26
+ }
scans/verse631/ct.nii.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a69b7bf1c1c0f4ba91cf7e9d6601ab0f68b8de207e8d678941b7a9aff5ba92be
3
+ size 203189638
scans/verse631/mask.nii.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:367229270c4794bf789b0f2d9cf64484dec157916b8f08e92f11fa4b1e53da15
3
+ size 3731529
scans/verse631/meta.json ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "series_id": "verse631",
3
+ "source_tag": "canonical",
4
+ "files": {
5
+ "ct": "ct.nii.gz",
6
+ "mask": "mask.nii.gz"
7
+ },
8
+ "orientation_axcodes": [
9
+ "P",
10
+ "I",
11
+ "R"
12
+ ],
13
+ "spacing_mm": [
14
+ 0.685546875,
15
+ 0.6857143044471741,
16
+ 2.0
17
+ ],
18
+ "shape": [
19
+ 512,
20
+ 1190,
21
+ 158
22
+ ],
23
+ "split": "training",
24
+ "patient_id": "verse631",
25
+ "source_format": "miccai"
26
+ }
scans/verse644/ct.nii.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:71a70a2ffb460af65a54a2beb533f7bd358f0623a516557f4c29bfec68ab003a
3
+ size 176860007
scans/verse644/mask.nii.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b1f0490f8bacf1454fe2cb343cc420215ffaf6fc7b632be92cc81925e98b0494
3
+ size 3040579
scans/verse644/meta.json ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "series_id": "verse644",
3
+ "source_tag": "canonical",
4
+ "files": {
5
+ "ct": "ct.nii.gz",
6
+ "mask": "mask.nii.gz"
7
+ },
8
+ "orientation_axcodes": [
9
+ "P",
10
+ "I",
11
+ "R"
12
+ ],
13
+ "spacing_mm": [
14
+ 0.4023437370719854,
15
+ 0.40234373855806216,
16
+ 2.9997239631125714
17
+ ],
18
+ "shape": [
19
+ 512,
20
+ 2048,
21
+ 76
22
+ ],
23
+ "split": "validation",
24
+ "patient_id": "verse644",
25
+ "source_format": "miccai"
26
+ }
scans/verse649/ct.nii.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a8c3667eef7e890c4f456a2ccfb6a35811702d69599f734a60787d18e0417151
3
+ size 226060173
scans/verse649/mask.nii.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:2bf78336e68d82bfc26d2cbeb219fda74f71525e4c0fd9ae388018a207164d4d
3
+ size 4298197
scans/verse649/meta.json ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "series_id": "verse649",
3
+ "source_tag": "canonical",
4
+ "files": {
5
+ "ct": "ct.nii.gz",
6
+ "mask": "mask.nii.gz"
7
+ },
8
+ "orientation_axcodes": [
9
+ "P",
10
+ "I",
11
+ "R"
12
+ ],
13
+ "spacing_mm": [
14
+ 0.55859375,
15
+ 0.5586923956871033,
16
+ 2.0
17
+ ],
18
+ "shape": [
19
+ 512,
20
+ 1346,
21
+ 162
22
+ ],
23
+ "split": "test",
24
+ "patient_id": "verse649",
25
+ "source_format": "miccai"
26
+ }
scans/verse758/ct.nii.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:03db55533e07164c68b20f6147100946480205f34529587ac006a3371f0f50a9
3
+ size 267847263
scans/verse758/mask.nii.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:6ba93eca4870d516f83ac5aa7a39ba8c95b97fa8f71ddd85c4b001181271f94c
3
+ size 7313194
scans/verse758/meta.json ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "series_id": "verse758",
3
+ "source_tag": "canonical",
4
+ "files": {
5
+ "ct": "ct.nii.gz",
6
+ "mask": "mask.nii.gz"
7
+ },
8
+ "orientation_axcodes": [
9
+ "P",
10
+ "I",
11
+ "R"
12
+ ],
13
+ "spacing_mm": [
14
+ 1.3671879768371582,
15
+ 1.25,
16
+ 1.3671879768371582
17
+ ],
18
+ "shape": [
19
+ 512,
20
+ 780,
21
+ 512
22
+ ],
23
+ "split": "test",
24
+ "patient_id": "verse758",
25
+ "source_format": "miccai"
26
+ }
scans/verse759/ct.nii.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:4c3672b0113370e785817a6a2dd07cf31361b5aded516a2a54b36a02747f47a7
3
+ size 44808136
scans/verse759/mask.nii.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:3a58fbe75a1746315a8f582e5cc9547695e33408f8228ab72a98d40e6c6a81d7
3
+ size 1626719
scans/verse759/meta.json ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "series_id": "verse759",
3
+ "source_tag": "canonical",
4
+ "files": {
5
+ "ct": "ct.nii.gz",
6
+ "mask": "mask.nii.gz"
7
+ },
8
+ "orientation_axcodes": [
9
+ "P",
10
+ "I",
11
+ "R"
12
+ ],
13
+ "spacing_mm": [
14
+ 1.6748050451278687,
15
+ 1.6748050451278687,
16
+ 2.5
17
+ ],
18
+ "shape": [
19
+ 512,
20
+ 512,
21
+ 168
22
+ ],
23
+ "split": "validation",
24
+ "patient_id": "verse759",
25
+ "source_format": "miccai"
26
+ }
splits.csv ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ series_id,split
2
+ verse108,test
3
+ verse236,test
4
+ verse547,validation
5
+ verse585,validation
6
+ verse602,test
7
+ verse631,training
8
+ verse644,validation
9
+ verse649,test
10
+ verse758,test
11
+ verse759,validation
splits_5fold.json ADDED
The diff for this file is too large to render. See raw diff