很高兴在雪易的CSDN遇见你
VTK技术爱好者 QQ:870202403 公众号:VTK忠粉
前言
本文分享开源软件TotalSegmentator,该开源项目针对CT/MRI数据类型,对主要的解剖学结构进行自动分割,并且被集成到MITK中。希望对各位小伙伴有所帮助!
感谢各位小伙伴的点赞+关注,小易会继续努力分享,一起进步!
你的点赞就是我的动力(^U^)ノ~YO
目录
前言
1. TotalSegmentator介绍
2. TotalSegmentator下载&安装
3. TotalSegmentator的使用
3.1 CT/MR数据分割
3.2 子任务
3.4 高级设置
3.3 CT分割类别
3.4 MR分割类别
结论:
1. TotalSegmentator介绍
TotalSegmentator由巴塞尔大学医院研究与分析部门创建,可以针对任何CT或MR数据进行主要解剖结构进行分割。它基于广泛的CT/MRI的训练数据(不同的扫描设备,不同的机构,不同的协议等),因此在大部分数据上都有很好的结果。
CT数据集:
Dataset with segmentations of 117 important anatomical structures in 1228 CT images (zenodo.org)
MR数据集:
Dataset with segmentations of 117 important anatomical structures in 1228 CT images (zenodo.org)
支持的CT分类如下:
支持的MR分类如下:
2. TotalSegmentator下载&安装
GitHub地址:GitHub - wasserth/TotalSegmentator: Tool for robust segmentation of >100 important anatomical structures in CT and MR images
TotalSegmentator安装依赖于Python & Pytorch
Pytorch的安装教程
TotalSegmentator安装
安装命令: pip install TotalSegmentator
安装命令: pip install TotalSegmentator==2.1.0
安装成功标志
TotalSegmentator使用了诸多我们熟悉的第三方库,如opencv, simple-itk, vtk 等。
3. TotalSegmentator的使用
3.1 CT/MR数据分割
TotalSegmentator -i ct.nii.gz -o segmentations
TotalSegmentator -i mri.nii.gz -o segmentations --task total_mr
注意:输入可以时Nifti数据格式,或文件夹或压缩文件,需要包含一个患者的全部DICOM切片。如果在CPU上进行分割,可以使用 --fast
或 --roi_subset
来提高效率。
3.2 子任务
分割时的选项
- total: 默认分割包括117个主类。用于CT数据。
- total_mr: 默认分割包括56个主类,用于MR数据
- lung_vessels: 肺血管,支气管
- body: 身体,躯干,四肢,皮肤
- cerebral_bleed: 颅内出血*
- hip_implant: 髋关节假体*
- coronary_arteries: 冠状动脉*
- pleural_pericard_effusion: 胸腔积液, 心包积液*
注意:带*的表示采用小的数据集进行训练的模型,可能分割效果没那么好。
使用方法:
TotalSegmentator -i ct.nii.gz -o segmentations -ta <task_name>
3.4 高级设置
--device
: Choosecpu
orgpu
orgpu:X (e.g., gpu:1 -> cuda:1)
--fast
: For faster runtime and less memory requirements use this option. It will run a lower resolution model (3mm instead of 1.5mm).--roi_subset
: Takes a space-separated list of class names (e.g.spleen colon brain
) and only predicts those classes. Saves a lot of runtime and memory. Might be less accurate especially for small classes (e.g. prostate).--preview
: This will generate a 3D rendering of all classes, giving you a quick overview if the segmentation worked and where it failed (seepreview.png
in output directory).--ml
: This will save one nifti file containing all labels instead of one file for each class. Saves runtime during saving of nifti files. (see here for index to class name mapping).--statistics
: This will generate a filestatistics.json
with volume (in mm³) and mean intensity of each class.--radiomics
: This will generate a filestatistics_radiomics.json
with the radiomics features of each class. You have to install pyradiomics to use this (pip install pyradiomics
).
3.3 CT分割类别
Index | TotalSegmentator name | TA2 name |
---|---|---|
1 | spleen | |
2 | kidney_right | |
3 | kidney_left | |
4 | gallbladder | |
5 | liver | |
6 | stomach | |
7 | pancreas | |
8 | adrenal_gland_right | suprarenal gland |
9 | adrenal_gland_left | suprarenal gland |
10 | lung_upper_lobe_left | superior lobe of left lung |
11 | lung_lower_lobe_left | inferior lobe of left lung |
12 | lung_upper_lobe_right | superior lobe of right lung |
13 | lung_middle_lobe_right | middle lobe of right lung |
14 | lung_lower_lobe_right | inferior lobe of right lung |
15 | esophagus | |
16 | trachea | |
17 | thyroid_gland | |
18 | small_bowel | small intestine |
19 | duodenum | |
20 | colon | |
21 | urinary_bladder | |
22 | prostate | |
23 | kidney_cyst_left | |
24 | kidney_cyst_right | |
25 | sacrum | |
26 | vertebrae_S1 | |
27 | vertebrae_L5 | |
28 | vertebrae_L4 | |
29 | vertebrae_L3 | |
30 | vertebrae_L2 | |
31 | vertebrae_L1 | |
32 | vertebrae_T12 | |
33 | vertebrae_T11 | |
34 | vertebrae_T10 | |
35 | vertebrae_T9 | |
36 | vertebrae_T8 | |
37 | vertebrae_T7 | |
38 | vertebrae_T6 | |
39 | vertebrae_T5 | |
40 | vertebrae_T4 | |
41 | vertebrae_T3 | |
42 | vertebrae_T2 | |
43 | vertebrae_T1 | |
44 | vertebrae_C7 | |
45 | vertebrae_C6 | |
46 | vertebrae_C5 | |
47 | vertebrae_C4 | |
48 | vertebrae_C3 | |
49 | vertebrae_C2 | |
50 | vertebrae_C1 | |
51 | heart | |
52 | aorta | |
53 | pulmonary_vein | |
54 | brachiocephalic_trunk | |
55 | subclavian_artery_right | |
56 | subclavian_artery_left | |
57 | common_carotid_artery_right | |
58 | common_carotid_artery_left | |
59 | brachiocephalic_vein_left | |
60 | brachiocephalic_vein_right | |
61 | atrial_appendage_left | |
62 | superior_vena_cava | |
63 | inferior_vena_cava | |
64 | portal_vein_and_splenic_vein | hepatic portal vein |
65 | iliac_artery_left | common iliac artery |
66 | iliac_artery_right | common iliac artery |
67 | iliac_vena_left | common iliac vein |
68 | iliac_vena_right | common iliac vein |
69 | humerus_left | |
70 | humerus_right | |
71 | scapula_left | |
72 | scapula_right | |
73 | clavicula_left | clavicle |
74 | clavicula_right | clavicle |
75 | femur_left | |
76 | femur_right | |
77 | hip_left | |
78 | hip_right | |
79 | spinal_cord | |
80 | gluteus_maximus_left | gluteus maximus muscle |
81 | gluteus_maximus_right | gluteus maximus muscle |
82 | gluteus_medius_left | gluteus medius muscle |
83 | gluteus_medius_right | gluteus medius muscle |
84 | gluteus_minimus_left | gluteus minimus muscle |
85 | gluteus_minimus_right | gluteus minimus muscle |
86 | autochthon_left | |
87 | autochthon_right | |
88 | iliopsoas_left | iliopsoas muscle |
89 | iliopsoas_right | iliopsoas muscle |
90 | brain | |
91 | skull | |
92 | rib_left_1 | |
93 | rib_left_2 | |
94 | rib_left_3 | |
95 | rib_left_4 | |
96 | rib_left_5 | |
97 | rib_left_6 | |
98 | rib_left_7 | |
99 | rib_left_8 | |
100 | rib_left_9 | |
101 | rib_left_10 | |
102 | rib_left_11 | |
103 | rib_left_12 | |
104 | rib_right_1 | |
105 | rib_right_2 | |
106 | rib_right_3 | |
107 | rib_right_4 | |
108 | rib_right_5 | |
109 | rib_right_6 | |
110 | rib_right_7 | |
111 | rib_right_8 | |
112 | rib_right_9 | |
113 | rib_right_10 | |
114 | rib_right_11 | |
115 | rib_right_12 | |
116 | sternum | |
117 | costal_cartilages |
3.4 MR分割类别
Index | TotalSegmentator name | TA2 name |
---|---|---|
1 | spleen | |
2 | kidney_right | |
3 | kidney_left | |
4 | gallbladder | |
5 | liver | |
6 | stomach | |
7 | pancreas | |
8 | adrenal_gland_right | suprarenal gland |
9 | adrenal_gland_left | suprarenal gland |
10 | lung_left | |
11 | lung_right | |
12 | esophagus | |
13 | small_bowel | small intestine |
14 | duodenum | |
15 | colon | |
16 | urinary_bladder | |
17 | prostate | |
18 | sacrum | |
19 | vertebrae | |
20 | intervertebral_discs | |
21 | spinal_cord | |
22 | heart | |
23 | aorta | |
24 | inferior_vena_cava | |
25 | portal_vein_and_splenic_vein | hepatic portal vein |
26 | iliac_artery_left | common iliac artery |
27 | iliac_artery_right | common iliac artery |
28 | iliac_vena_left | common iliac vein |
29 | iliac_vena_right | common iliac vein |
30 | humerus_left | |
31 | humerus_right | |
32 | fibula | |
33 | tibia | |
34 | femur_left | |
35 | femur_right | |
36 | hip_left | |
37 | hip_right | |
38 | gluteus_maximus_left | gluteus maximus muscle |
39 | gluteus_maximus_right | gluteus maximus muscle |
40 | gluteus_medius_left | gluteus medius muscle |
41 | gluteus_medius_right | gluteus medius muscle |
42 | gluteus_minimus_left | gluteus minimus muscle |
43 | gluteus_minimus_right | gluteus minimus muscle |
44 | autochthon_left | |
45 | autochthon_right | |
46 | iliopsoas_left | iliopsoas muscle |
47 | iliopsoas_right | iliopsoas muscle |
48 | quadriceps_femoris_left | |
49 | quadriceps_femoris_right | |
50 | thigh_medial_compartment_left | |
51 | thigh_medial_compartment_right | |
52 | thigh_posterior_compartment_left | |
53 | thigh_posterior_compartment_right | |
54 | sartorius_left | |
55 | sartorius_right | |
56 | brain |
结论:
感谢各位小伙伴的点赞+关注,小易会继续努力分享,一起进步!