Angelou0516 commited on
Commit
c2f3086
·
verified ·
1 Parent(s): 8e83812

Upload README.md with huggingface_hub

Browse files
Files changed (1) hide show
  1. README.md +105 -0
README.md ADDED
@@ -0,0 +1,105 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: cc-by-4.0
3
+ task_categories:
4
+ - image-segmentation
5
+ tags:
6
+ - medical
7
+ - CT
8
+ - segmentation
9
+ - VerSe
10
+ size_categories:
11
+ - n<1K
12
+ configs:
13
+ - config_name: default
14
+ data_files:
15
+ - split: train
16
+ path: train.jsonl
17
+ ---
18
+
19
+ # VerSe (Vertebrae Segmentation) Dataset
20
+
21
+ ## Dataset Description
22
+
23
+ The VerSe (Vertebrae Segmentation) dataset for vertebrae segmentation from CT scans. This dataset contains CT scans with dense segmentation annotations.
24
+
25
+ ### Dataset Details
26
+
27
+ - **Modality**: CT
28
+ - **Target**: cervical, thoracic, and lumbar vertebrae
29
+ - **Format**: NIfTI (.nii.gz)
30
+
31
+ ### Dataset Structure
32
+
33
+ Each sample in the JSONL file contains:
34
+ ```json
35
+ {
36
+ "image": "path/to/image.nii.gz",
37
+ "mask": "path/to/mask.nii.gz",
38
+ "label": ["organ1", "organ2", ...],
39
+ "modality": "CT",
40
+ "dataset": "VerSe",
41
+ "official_split": "train",
42
+ "patient_id": "patient_id"
43
+ }
44
+ ```
45
+
46
+ ## Usage
47
+
48
+ ### Load Metadata
49
+
50
+ ```python
51
+ from datasets import load_dataset
52
+
53
+ # Load the dataset
54
+ ds = load_dataset("Angelou0516/verse")
55
+
56
+ # Access a sample
57
+ sample = ds['train'][0]
58
+ print(f"Patient ID: {sample['patient_id']}")
59
+ print(f"Image: {sample['image']}")
60
+ print(f"Mask: {sample['mask']}")
61
+ print(f"Labels: {sample['label']}")
62
+ ```
63
+
64
+ ### Load Images
65
+
66
+ ```python
67
+ from huggingface_hub import snapshot_download
68
+ import nibabel as nib
69
+ import os
70
+
71
+ # Download the full dataset
72
+ local_path = snapshot_download(
73
+ repo_id="Angelou0516/verse",
74
+ repo_type="dataset"
75
+ )
76
+
77
+ # Load a sample
78
+ sample = ds['train'][0]
79
+ image = nib.load(os.path.join(local_path, sample['image']))
80
+ mask = nib.load(os.path.join(local_path, sample['mask']))
81
+
82
+ # Get numpy arrays
83
+ image_data = image.get_fdata()
84
+ mask_data = mask.get_fdata()
85
+
86
+ print(f"Image shape: {image_data.shape}")
87
+ print(f"Mask shape: {mask_data.shape}")
88
+ ```
89
+
90
+ ## Citation
91
+
92
+ ```bibtex
93
+ @article{verse,
94
+ title={VerSe: A Vertebrae Labelling and Segmentation Benchmark},
95
+ year={2023}
96
+ }
97
+ ```
98
+
99
+ ## License
100
+
101
+ CC-BY-4.0
102
+
103
+ ## Dataset Homepage
104
+
105
+ https://github.com/anjany/verse