Angelou0516 commited on
Commit
06d880a
·
verified ·
1 Parent(s): 9366120

Upload README.md with huggingface_hub

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