Skip to content

Commit

Permalink
remove time evals
Browse files Browse the repository at this point in the history
  • Loading branch information
wasserth committed Jul 19, 2024
1 parent a42a54f commit f8dac08
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions totalsegmentator/bin/totalseg_get_phase.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ def pi_time_to_phase(pi_time: float) -> str:
elif pi_time < 100:
return "portal_venous", 0.7
else:
return "delayed", 0.7
return "portal_venous", 0.3
# return "delayed", 0.7 # not enough good training data for this


def get_ct_contrast_phase(ct_img: nib.Nifti1Image, model_file: Path = None):
Expand All @@ -64,16 +65,16 @@ def get_ct_contrast_phase(ct_img: nib.Nifti1Image, model_file: Path = None):
seg_img, stats = totalsegmentator(ct_img, None, ml=True, fast=True, statistics=True,
roi_subset=None, statistics_exclude_masks_at_border=False,
quiet=True, stats_aggregation="median")
print(f"ts took: {time.time()-st:.2f}s")
# print(f"ts took: {time.time()-st:.2f}s")

if stats["brain"]["volume"] > 100:
print(f"Brain in image, therefore also running headneck model.")
# print(f"Brain in image, therefore also running headneck model.")
st = time.time()
seg_img_hn, stats_hn = totalsegmentator(ct_img, None, ml=True, fast=False, statistics=True,
task="headneck_bones_vessels",
roi_subset=None, statistics_exclude_masks_at_border=False,
quiet=True, stats_aggregation="median")
print(f"hn took: {time.time()-st:.2f}s")
# print(f"hn took: {time.time()-st:.2f}s")
else:
stats_hn = {organ: {"intensity": 0.0} for organ in organs_hn}

Expand Down

0 comments on commit f8dac08

Please sign in to comment.