Skip to content

Commit

Permalink
add sinuses
Browse files Browse the repository at this point in the history
  • Loading branch information
wasserth committed Feb 10, 2025
1 parent 34b9cfb commit 69d9abc
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 5 deletions.
2 changes: 1 addition & 1 deletion resources/prepare_weights_for_release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ print(get_full_task_name_v2($dataset_id))
echo "Processing $task_name..."

# Copy dataset folder
# cp -r "$nnUNet_results/$task_name" .
cp -r "$nnUNet_results/$task_name" .

# Get the only folder inside task_name
trainer_folder=$(ls "$task_name" | head -n 1)
Expand Down
2 changes: 1 addition & 1 deletion totalsegmentator/bin/TotalSegmentator.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def main():
"head_glands_cavities", "head_muscles", "headneck_bones_vessels", "headneck_muscles",
"brain_structures", "liver_vessels", "oculomotor_muscles",
"thigh_shoulder_muscles", "thigh_shoulder_muscles_mr", "lung_nodules", "kidney_cysts",
"breasts", "ventricle_parts"],
"breasts", "ventricle_parts", "aortic_sinuses"],
help="Select which model to use. This determines what is predicted.",
default="total")

Expand Down
6 changes: 4 additions & 2 deletions totalsegmentator/bin/totalseg_download_weights.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ def main():
"head_glands_cavities", "head_muscles", "headneck_bones_vessels",
"headneck_muscles", "liver_vessels", "brain_structures",
"lung_nodules", "kidney_cysts", "breasts", "ventricle_parts",
"thigh_shoulder_muscles", "thigh_shoulder_muscles_mr",
"thigh_shoulder_muscles", "thigh_shoulder_muscles_mr",
# "aortic_sinuses",
"all"],
help="Task for which to download the weights", default="total")

Expand Down Expand Up @@ -70,7 +71,8 @@ def main():
"brain_structures": [409],
"thigh_shoulder_muscles": [857],
"thigh_shoulder_muscles_mr": [857],
"coronary_arteries": [507]
"coronary_arteries": [507],
# "aortic_sinuses": [920]
}

setup_totalseg()
Expand Down
2 changes: 2 additions & 0 deletions totalsegmentator/libs.py
Original file line number Diff line number Diff line change
Expand Up @@ -327,6 +327,8 @@ def download_pretrained_weights(task_id):
weights_path = config_dir / "Dataset857_TotalSegMRI_thigh_shoulder_1088subj"
elif task_id == 507:
weights_path = config_dir / "Dataset507_coronary_arteries_cm_nativ_400subj"
elif task_id == 920:
weights_path = config_dir / "Dataset920_aortic_sinuses_cm_nativ_400subj"

else:
raise ValueError(f"For task_id {task_id} no download path was found.")
Expand Down
9 changes: 8 additions & 1 deletion totalsegmentator/map_to_binary.py
Original file line number Diff line number Diff line change
Expand Up @@ -599,6 +599,12 @@
11: "third_ventricle",
12: "fourth_ventricle"
},
"aortic_sinuses": {
1: "left_ventricular_outflow_tract",
2: "right_coronary_cusp",
3: "left_coronary_cusp",
4: "non_coronary_cusp"
},
"test": {
1: "carpal"
}
Expand All @@ -618,7 +624,8 @@
"brain_structures": 409,
"thigh_shoulder_muscles": 857,
"thigh_shoulder_muscles_mr": 857,
"coronary_arteries": 507
"coronary_arteries": 507,
"aortic_sinuses": 920
}


Expand Down
3 changes: 3 additions & 0 deletions totalsegmentator/preview.py
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,9 @@
"ventricle_occipital_horn_right", "ventricle_body_right", "ventricle_temporal_horn_right",
"ventricle_trigone_right", "third_ventricle", "fourth_ventricle"]
],
"aortic_sinuses": [
["left_ventricular_outflow_tract", "right_coronary_cusp", "left_coronary_cusp", "non_coronary_cusp"]
],
"test": [
["ulna"]
]
Expand Down
10 changes: 10 additions & 0 deletions totalsegmentator/python_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -482,6 +482,16 @@ def totalsegmentator(input: Union[str, Path, Nifti1Image], output: Union[str, Pa
folds = [0]
if fast: raise ValueError("task coronary_arteries does not work with option --fast")
show_license_info()
elif task == "aortic_sinuses":
task_id = 920
resample = [0.7, 0.7, 0.7]
trainer = "nnUNetTrainer_DASegOrd0_NoMirroring"
crop = ["heart"]
crop_addon = [0, 0, 0]
model = "3d_fullres_high"
folds = [0]
if fast: raise ValueError("task aortic_sinuses does not work with option --fast")
show_license_info()

elif task == "test":
task_id = [517]
Expand Down

0 comments on commit 69d9abc

Please sign in to comment.