Skip to content

Commit

Permalink
quiet arg to func for postprocessing
Browse files Browse the repository at this point in the history
  • Loading branch information
fohofmann authored Feb 7, 2024
1 parent d69e898 commit c37f089
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions totalsegmentator/nnunet.py
Original file line number Diff line number Diff line change
Expand Up @@ -426,15 +426,15 @@ def nnUNet_predict_image(file_in: Union[str, Path, Nifti1Image], file_out, task_
# Postprocessing multilabel (run here on lower resolution)
if task_name == "body":
img_pred_pp = keep_largest_blob_multilabel(img_pred.get_fdata().astype(np.uint8),
class_map[task_name], ["body_trunc"], debug=False)
class_map[task_name], ["body_trunc"], debug=False, quiet=quiet)
img_pred = nib.Nifti1Image(img_pred_pp, img_pred.affine)

if task_name == "body":
vox_vol = np.prod(img_pred.header.get_zooms())
size_thr_mm3 = 50000 / vox_vol
img_pred_pp = remove_small_blobs_multilabel(img_pred.get_fdata().astype(np.uint8),
class_map[task_name], ["body_extremities"],
interval=[size_thr_mm3, 1e10], debug=False)
interval=[size_thr_mm3, 1e10], debug=False, quiet=quiet)
img_pred = nib.Nifti1Image(img_pred_pp, img_pred.affine)

if preview:
Expand Down

0 comments on commit c37f089

Please sign in to comment.