Angelou0516 commited on
Commit
3dafedf
·
verified ·
1 Parent(s): 440bdde

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
+ - CTPelvic1K
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
+ # CTPelvic1K Dataset
20
+
21
+ ## Dataset Description
22
+
23
+ The CTPelvic1K dataset for pelvic bone segmentation from CT scans. This dataset contains CT scans with dense segmentation annotations.
24
+
25
+ ### Dataset Details
26
+
27
+ - **Modality**: CT
28
+ - **Target**: sacrum, left hip, right hip, 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": "CTPelvic1K",
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/ctpelvic1k")
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/ctpelvic1k",
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{ctpelvic1k,
94
+ title={CTPelvic1K: A Large-Scale Dataset for Pelvic Bone Segmentation},
95
+ year={2023}
96
+ }
97
+ ```
98
+
99
+ ## License
100
+
101
+ CC-BY-4.0
102
+
103
+ ## Dataset Homepage
104
+
105
+ https://zenodo.org/record/4588403