Skip to content

Commit

Permalink
update tests for v2
Browse files Browse the repository at this point in the history
  • Loading branch information
wasserth committed Aug 29, 2023
1 parent 2515ad4 commit d2907f6
Show file tree
Hide file tree
Showing 356 changed files with 318 additions and 14,647 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ store/
unittest_prediction
unittest_prediction_fast
unittest_prediction_roi_subset
unittest_prediction_fast.nii.gz

*.tfstate
*.tfstate.backup
Expand Down
5 changes: 1 addition & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,8 @@ runtime.
![Alt text](resources/imgs/overview_subclasses.png)

We added some more models to TotalSegmentator beyond the default one. This allows segmentation of even
more classes in more detailed subparts of the image. First you have to run TotalSegmentator with the
normal settings to get the normal masks. These masks are required to crop the image to a subregion on
which the detailed model will run.
more classes in more detailed subparts of the image.
```
TotalSegmentator -i ct.nii.gz -o segmentations --fast
TotalSegmentator -i ct.nii.gz -o segmentations -ta lung_vessels
```
Overview of available subtasks and the classes which they contain.
Expand Down
48 changes: 27 additions & 21 deletions tests.sh
Original file line number Diff line number Diff line change
@@ -1,35 +1,41 @@
set -e

echo "License key: $1"
# To run these tests simply do
# ./tests.sh <license_key>

# # Test organ predictions
# TotalSegmentator -i tests/reference_files/example_ct.nii.gz -o tests/unittest_prediction --test 1
# pytest -v tests/test_end_to_end.py::test_end_to_end::test_prediction_liver
# pytest -v tests/test_end_to_end.py::test_end_to_end::test_prediction_vertebrae

# # Test multilabel prediction
# TotalSegmentator -i tests/reference_files/example_ct.nii.gz -o tests/unittest_prediction.nii.gz --ml --test 1
# pytest -v tests/test_end_to_end.py::test_end_to_end::test_prediction_multilabel
# Test multilabel prediction
TotalSegmentator -i tests/reference_files/example_ct_sm.nii.gz -o tests/unittest_prediction.nii.gz -bs --ml
pytest -v tests/test_end_to_end.py::test_end_to_end::test_prediction_multilabel

# Test organ prediction - roi subset
# 20 cpu
# example_ct_sm.nii.gz: 20s, 3.1GB
# example_ct.nii.gz: 22s, 3.1GB
# 2 cpus:
# example_ct_sm.nii.gz: 34s, 3.0GB
# example_ct.nii.gz: 36s, 3.0GB
TotalSegmentator -i tests/reference_files/example_ct_sm.nii.gz -o tests/unittest_prediction_roi_subset -rs liver brain -d cpu
pytest -v tests/test_end_to_end.py::test_end_to_end::test_prediction_liver_roi_subset

# Test organ predictions - fast
# 2 cpus: (w/o statistics)
# Test organ predictions - fast - statistics
# 2 cpus: (statistics <1s)
# example_ct_sm.nii.gz: 13s, 4.1GB
# example_ct.nii.gz: 16s, 4.1GB
# TotalSegmentator -i tests/reference_files/example_ct_sm.nii.gz -o tests/unittest_prediction_fast --fast --statistics -d cpu
# pytest -v tests/test_end_to_end.py::test_end_to_end::test_prediction_liver_fast
# pytest -v tests/test_end_to_end.py::test_end_to_end::test_prediction_vertebrae_fast
# pytest -v tests/test_end_to_end.py::test_end_to_end::test_statistics

# # Test vessel predictions
# TotalSegmentator -i tests/reference_files/example_ct.nii.gz -o tests/unittest_prediction -ta lung_vessels --test 3 -d cpu
# pytest -v tests/test_end_to_end.py::test_end_to_end::test_lung_vessels
TotalSegmentator -i tests/reference_files/example_ct_sm.nii.gz -o tests/unittest_prediction_fast --fast --statistics -d cpu
pytest -v tests/test_end_to_end.py::test_end_to_end::test_prediction_fast
pytest -v tests/test_end_to_end.py::test_end_to_end::test_statistics
# pytest -v tests/test_end_to_end.py::test_end_to_end::test_preview

# Test organ predictions - fast - multilabel
TotalSegmentator -i tests/reference_files/example_ct_sm.nii.gz -o tests/unittest_prediction_fast.nii.gz --fast --ml -d cpu
pytest -v tests/test_end_to_end.py::test_end_to_end::test_prediction_multilabel_fast

# Test organ predictions - fast - multilabel - body_seg
TotalSegmentator -i tests/reference_files/example_ct_sm.nii.gz -o tests/unittest_prediction_fast_body_seg.nii.gz --fast --ml -bs -d cpu
pytest -v tests/test_end_to_end.py::test_end_to_end::test_prediction_multilabel_fast_body_seg

# Test vessel predictions
TotalSegmentator -i tests/reference_files/example_ct_sm.nii.gz -o tests/unittest_prediction -ta lung_vessels -d cpu # ~1min
pytest -v tests/test_end_to_end.py::test_end_to_end::test_lung_vessels

# Test tissue types (with license) + body_seg
TotalSegmentator -i tests/reference_files/example_ct_sm.nii.gz -o tests/unittest_prediction -ta tissue_types -d cpu -l $1
pytest -v tests/test_end_to_end.py::test_end_to_end::test_tissue_types
Binary file modified tests/reference_files/example_seg.nii.gz
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed tests/reference_files/example_seg/aorta.nii.gz
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed tests/reference_files/example_seg/brain.nii.gz
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed tests/reference_files/example_seg/colon.nii.gz
Binary file not shown.
Binary file removed tests/reference_files/example_seg/duodenum.nii.gz
Binary file not shown.
Binary file removed tests/reference_files/example_seg/esophagus.nii.gz
Binary file not shown.
Binary file removed tests/reference_files/example_seg/face.nii.gz
Binary file not shown.
Binary file removed tests/reference_files/example_seg/femur_left.nii.gz
Binary file not shown.
Binary file removed tests/reference_files/example_seg/femur_right.nii.gz
Binary file not shown.
Binary file removed tests/reference_files/example_seg/gallbladder.nii.gz
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed tests/reference_files/example_seg/hip_left.nii.gz
Binary file not shown.
Binary file removed tests/reference_files/example_seg/hip_right.nii.gz
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed tests/reference_files/example_seg/kidney_left.nii.gz
Binary file not shown.
Binary file not shown.
Binary file removed tests/reference_files/example_seg/liver.nii.gz
Binary file not shown.
Binary file removed tests/reference_files/example_seg/lung.nii.gz
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed tests/reference_files/example_seg/pancreas.nii.gz
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed tests/reference_files/example_seg/rib_left_1.nii.gz
Binary file not shown.
Binary file removed tests/reference_files/example_seg/rib_left_10.nii.gz
Binary file not shown.
Binary file removed tests/reference_files/example_seg/rib_left_11.nii.gz
Binary file not shown.
Binary file removed tests/reference_files/example_seg/rib_left_12.nii.gz
Binary file not shown.
Binary file removed tests/reference_files/example_seg/rib_left_2.nii.gz
Binary file not shown.
Binary file removed tests/reference_files/example_seg/rib_left_3.nii.gz
Binary file not shown.
Binary file removed tests/reference_files/example_seg/rib_left_4.nii.gz
Binary file not shown.
Binary file removed tests/reference_files/example_seg/rib_left_5.nii.gz
Binary file not shown.
Binary file removed tests/reference_files/example_seg/rib_left_6.nii.gz
Binary file not shown.
Binary file removed tests/reference_files/example_seg/rib_left_7.nii.gz
Binary file not shown.
Binary file removed tests/reference_files/example_seg/rib_left_8.nii.gz
Binary file not shown.
Binary file removed tests/reference_files/example_seg/rib_left_9.nii.gz
Binary file not shown.
Binary file removed tests/reference_files/example_seg/rib_right_1.nii.gz
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed tests/reference_files/example_seg/rib_right_2.nii.gz
Binary file not shown.
Binary file removed tests/reference_files/example_seg/rib_right_3.nii.gz
Binary file not shown.
Binary file removed tests/reference_files/example_seg/rib_right_4.nii.gz
Binary file not shown.
Binary file removed tests/reference_files/example_seg/rib_right_5.nii.gz
Binary file not shown.
Binary file removed tests/reference_files/example_seg/rib_right_6.nii.gz
Binary file not shown.
Binary file removed tests/reference_files/example_seg/rib_right_7.nii.gz
Binary file not shown.
Binary file removed tests/reference_files/example_seg/rib_right_8.nii.gz
Binary file not shown.
Binary file removed tests/reference_files/example_seg/rib_right_9.nii.gz
Binary file not shown.
Binary file removed tests/reference_files/example_seg/sacrum.nii.gz
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed tests/reference_files/example_seg/small_bowel.nii.gz
Binary file not shown.
Binary file removed tests/reference_files/example_seg/spleen.nii.gz
Binary file not shown.
Binary file removed tests/reference_files/example_seg/stomach.nii.gz
Binary file not shown.
Binary file removed tests/reference_files/example_seg/trachea.nii.gz
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified tests/reference_files/example_seg_fast.nii.gz
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified tests/reference_files/example_seg_fast/aorta.nii.gz
Binary file not shown.
Binary file not shown.
Binary file modified tests/reference_files/example_seg_fast/autochthon_left.nii.gz
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified tests/reference_files/example_seg_fast/brain.nii.gz
Binary file not shown.
Binary file modified tests/reference_files/example_seg_fast/clavicula_left.nii.gz
Binary file not shown.
Binary file modified tests/reference_files/example_seg_fast/clavicula_right.nii.gz
Binary file not shown.
Binary file modified tests/reference_files/example_seg_fast/colon.nii.gz
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified tests/reference_files/example_seg_fast/duodenum.nii.gz
Binary file not shown.
Binary file modified tests/reference_files/example_seg_fast/esophagus.nii.gz
Binary file not shown.
Binary file removed tests/reference_files/example_seg_fast/face.nii.gz
Binary file not shown.
Binary file modified tests/reference_files/example_seg_fast/femur_left.nii.gz
Binary file not shown.
Binary file modified tests/reference_files/example_seg_fast/femur_right.nii.gz
Binary file not shown.
Binary file modified tests/reference_files/example_seg_fast/gallbladder.nii.gz
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified tests/reference_files/example_seg_fast/hip_left.nii.gz
Binary file not shown.
Binary file modified tests/reference_files/example_seg_fast/hip_right.nii.gz
Binary file not shown.
Binary file modified tests/reference_files/example_seg_fast/humerus_left.nii.gz
Binary file not shown.
Binary file modified tests/reference_files/example_seg_fast/humerus_right.nii.gz
Binary file not shown.
Binary file modified tests/reference_files/example_seg_fast/iliac_artery_left.nii.gz
Binary file not shown.
Binary file not shown.
Binary file modified tests/reference_files/example_seg_fast/iliac_vena_left.nii.gz
Binary file not shown.
Binary file modified tests/reference_files/example_seg_fast/iliac_vena_right.nii.gz
Binary file not shown.
Binary file modified tests/reference_files/example_seg_fast/iliopsoas_left.nii.gz
Binary file not shown.
Binary file modified tests/reference_files/example_seg_fast/iliopsoas_right.nii.gz
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified tests/reference_files/example_seg_fast/kidney_left.nii.gz
Binary file not shown.
Binary file modified tests/reference_files/example_seg_fast/kidney_right.nii.gz
Binary file not shown.
Binary file modified tests/reference_files/example_seg_fast/liver.nii.gz
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified tests/reference_files/example_seg_fast/pancreas.nii.gz
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified tests/reference_files/example_seg_fast/rib_left_1.nii.gz
Binary file not shown.
Binary file modified tests/reference_files/example_seg_fast/rib_left_10.nii.gz
Binary file not shown.
Binary file modified tests/reference_files/example_seg_fast/rib_left_11.nii.gz
Binary file not shown.
Binary file modified tests/reference_files/example_seg_fast/rib_left_12.nii.gz
Binary file not shown.
Binary file modified tests/reference_files/example_seg_fast/rib_left_2.nii.gz
Binary file not shown.
Binary file modified tests/reference_files/example_seg_fast/rib_left_3.nii.gz
Binary file not shown.
Binary file modified tests/reference_files/example_seg_fast/rib_left_4.nii.gz
Binary file not shown.
Binary file modified tests/reference_files/example_seg_fast/rib_left_5.nii.gz
Binary file not shown.
Binary file modified tests/reference_files/example_seg_fast/rib_left_6.nii.gz
Binary file not shown.
Binary file modified tests/reference_files/example_seg_fast/rib_left_7.nii.gz
Binary file not shown.
Binary file modified tests/reference_files/example_seg_fast/rib_left_8.nii.gz
Binary file not shown.
Binary file modified tests/reference_files/example_seg_fast/rib_left_9.nii.gz
Binary file not shown.
Binary file modified tests/reference_files/example_seg_fast/rib_right_1.nii.gz
Binary file not shown.
Binary file modified tests/reference_files/example_seg_fast/rib_right_10.nii.gz
Binary file not shown.
Binary file modified tests/reference_files/example_seg_fast/rib_right_11.nii.gz
Binary file not shown.
Binary file modified tests/reference_files/example_seg_fast/rib_right_12.nii.gz
Binary file not shown.
Binary file modified tests/reference_files/example_seg_fast/rib_right_2.nii.gz
Binary file not shown.
Binary file modified tests/reference_files/example_seg_fast/rib_right_3.nii.gz
Binary file not shown.
Binary file modified tests/reference_files/example_seg_fast/rib_right_4.nii.gz
Binary file not shown.
Binary file modified tests/reference_files/example_seg_fast/rib_right_5.nii.gz
Binary file not shown.
Binary file modified tests/reference_files/example_seg_fast/rib_right_6.nii.gz
Binary file not shown.
Binary file modified tests/reference_files/example_seg_fast/rib_right_7.nii.gz
Binary file not shown.
Binary file modified tests/reference_files/example_seg_fast/rib_right_8.nii.gz
Binary file not shown.
Binary file modified tests/reference_files/example_seg_fast/rib_right_9.nii.gz
Binary file not shown.
Binary file modified tests/reference_files/example_seg_fast/sacrum.nii.gz
Binary file not shown.
Binary file modified tests/reference_files/example_seg_fast/scapula_left.nii.gz
Binary file not shown.
Binary file modified tests/reference_files/example_seg_fast/scapula_right.nii.gz
Binary file not shown.
Binary file not shown.
Binary file modified tests/reference_files/example_seg_fast/small_bowel.nii.gz
Binary file not shown.
Binary file not shown.
Binary file modified tests/reference_files/example_seg_fast/spleen.nii.gz
Binary file not shown.
Loading

0 comments on commit d2907f6

Please sign in to comment.