Love totalSegmentator!-anyway to batch output multiple studies?

Operating system: windows 10
Slicer version: 5.2.1
Expected behavior:
Actual behavior:

Hello, Great work on the TotalSegmentator!
Cannot believe that TotalSegmentator can precisely identify so many organs at one time!

I have two questions on total segmentator:

  1. I would like to use T.S. for multiple studies, is there a command line that I can use to batch open a patient in the slicer database, have T.S. segment the organs, then save the ROIs as nifti file, or better yet, have the CT housenfield values saved?
    I am very eager to use T.S. on a very large database of patients. I have the patients all imported in 3d slicer database.

  2. There are a few organs that are not yet identified on T.S, such as thyroid, various muscles, etc. Is there a way to “train” the T.S. to identify these organs if I submit ROIs?

Thank you, and keep up the great work!


there is no official script yet but it should be easy to write in Python, because all necessary functions are disclosed in the TotalSegmentator extension logic.

TotalSegmentator is undergoing active development and you could post a request under “issues” in TotalSegmentator Github, where the original code is hosted. Our extension just wraps this code for ease of use in 3D Slicer.

You could even train the engine yourself according to its developer, but there is another option as @pieper pointed out: Train back MONAILabel with Totalsegmentator results and add missing structures there.

Maybe this python script (not a beauty, but working) can give you an idea how to involve an extension logic, scan directories for input files, and process them.