12 #ifndef MITKTOTALSEGMENTATORTOOL_H
13 #define MITKTOTALSEGMENTATORTOOL_H
40 itkFactorylessNewMacro(
Self);
43 const char *GetName()
const override;
44 const char **GetXPM()
const override;
46 void Activated()
override;
48 itkSetMacro(MitkTempDir, std::string);
49 itkGetConstMacro(MitkTempDir, std::string);
51 itkSetMacro(SubTask, std::string);
52 itkGetConstMacro(SubTask, std::string);
54 itkSetMacro(PythonPath, std::string);
55 itkGetConstMacro(PythonPath, std::string);
57 itkSetMacro(GpuId,
int);
58 itkGetConstMacro(GpuId,
int);
60 itkSetMacro(Fast,
bool);
61 itkGetConstMacro(Fast,
bool);
62 itkBooleanMacro(Fast);
69 static void onPythonProcessEvent(itk::Object *,
const itk::EventObject &e,
void *);
90 void UpdatePrepare()
override;
98 void run_totalsegmentator(
ProcessExecutor*,
const std::string&,
const std::string&,
bool,
bool,
int,
const std::string&);
111 void ParseLabelMapTotalDefault();
118 std::string GetLabelMapPath();
131 std::string m_MitkTempDir;
132 std::string m_PythonPath;
133 std::string m_SubTask =
"total";
135 std::map<mitk::Label::PixelType, std::string> m_LabelMapTotal;
136 std::map<mitk::Label::PixelType, std::string> m_LabelMapTotalMR;
138 const std::string TEMPLATE_FILENAME =
"XXXXXX_000_0000.nii.gz";
139 const std::string DEFAULT_TOTAL_TASK =
"total";
140 const std::string DEFAULT_TOTAL_TASK_MRI =
"total_mr";
141 const std::unordered_map<std::string, std::vector<std::string>> SUBTASKS_MAP =
143 {
"body", {
"body.nii.gz",
"body_trunc.nii.gz",
"body_extremities.nii.gz",
"skin.nii.gz"}},
144 {
"hip_implant", {
"hip_implant.nii.gz"}},
145 {
"cerebral_bleed", {
"intracerebral_hemorrhage.nii.gz"}},
146 {
"coronary_arteries", {
"coronary_arteries.nii.gz"}},
147 {
"lung_vessels", {
"lung_vessels.nii.gz",
"lung_trachea_bronchia.nii.gz"}},
148 {
"pleural_pericard_effusion", {
"pleural_effusion.nii.gz",
"pericardial_effusion.nii.gz"}},
149 {
"head_glands_cavities", {
"eye_left.nii.gz",
"eye_right.nii.gz",
"eye_lens_left.nii.gz",
"eye_lens_right.nii.gz",
"optic_nerve_left.nii.gz",
"optic_nerve_right.nii.gz",
"parotid_gland_left.nii.gz",
"parotid_gland_right.nii.gz",
"submandibular_gland_right.nii.gz",
"submandibular_gland_left.nii.gz",
"nasopharynx.nii.gz",
"oropharynx.nii.gz",
"hypopharynx.nii.gz",
"nasal_cavity_right.nii.gz",
"nasal_cavity_left.nii.gz",
"auditory_canal_right.nii.gz",
"auditory_canal_left.nii.gz",
"soft_palate.nii.gz",
"hard_palate.nii.gz" }},
150 {
"head_muscles", {
"masseter_right.nii.gz",
"masseter_left.nii.gz",
"temporalis_right.nii.gz",
"temporalis_left.nii.gz",
"lateral_pterygoid_right.nii.gz",
"lateral_pterygoid_left.nii.gz",
"medial_pterygoid_right.nii.gz",
"medial_pterygoid_left.nii.gz",
"tongue.nii.gz",
"digastric_right.nii.gz",
"digastric_left.nii.gz"}},
151 {
"headneck_bones_vessels", {
"larynx_air.nii.gz" ,
"thyroid_cartilage.nii.gz" ,
"hyoid.nii.gz" ,
"cricoid_cartilage.nii.gz",
"zygomatic_arch_right.nii.gz",
"zygomatic_arch_left.nii.gz",
"styloid_process_right.nii.gz",
"styloid_process_left.nii.gz",
"internal_carotid_artery_right.nii.gz",
"internal_carotid_artery_left.nii.gz",
"internal_jugular_vein_right.nii.gz",
"internal_jugular_vein_left.nii.gz"}},
152 {
"headneck_muscles", {
"sternocleidomastoid_right.nii.gz",
"sternocleidomastoid_left.nii.gz",
"superior_pharyngeal_constrictor.nii.gz",
"middle_pharyngeal_constrictor.nii.gz",
"inferior_pharyngeal_constrictor.nii.gz",
"trapezius_right.nii.gz",
"trapezius_left.nii.gz",
"platysma_right.nii.gz",
"platysma_left.nii.gz",
"levator_scapulae_right.nii.gz",
"levator_scapulae_left.nii.gz",
"anterior_scalene_right.nii.gz",
"anterior_scalene_left.nii.gz",
"middle_scalene_right.nii.gz",
"middle_scalene_left.nii.gz",
"posterior_scalene_right.nii.gz",
"posterior_scalene_left.nii.gz",
"sterno_thyroid_right.nii.gz",
"sterno_thyroid_left.nii.gz",
"thyrohyoid_right.nii.gz",
"thyrohyoid_left.nii.gz",
"prevertebral_right.nii.gz",
"prevertebral_left.nii.gz"}},
153 {
"liver_vessels", {
"liver_vessels.nii.gz" ,
"liver_tumor.nii.gz"}}