Interesting to see that Jakob has implemented a “roi_subset” option in the latest version of the TotalSegmentator program, which allows for generating only the organs/structures that you would want to see or save.
I’ve asked him to implement this feature because because fast pre-segmentation saving took 1.5 minutes on my computer, because all structures were saved. He implemented it within a day!
We now just need to update the Slicer extension to use this new parameter. @rbumm it would be nice if you could give it a try. It could be implemented by changing the requiresPreSegmentation property in the tasks descriptions from a Boolean flag to a list of segment names that are required and pass that to the pre-segmentation.
--roi-subset can actually be set and has benefits during any TotalSegmentation and would not only be useful for tasks in which requirePreSegmentation is True. Should we better add it as another, independent self.tasks entry in the extension class logic?
The next question is how we would implement the selection of organs/structures in the TotalSegmentator extension UI. Maybe a ListWidget with MultiSelect?
I don’t think we need (and therefore we probably shouldn’t) add GUI for segment selection, because we know exactly what segments are needed from the pre-segmentation step; and for the full segmentation we don’t need segment selection (as it would complicate the GUI and in most cases it would slow down segment saving, because loading a few segments one-by-one takes longer than loading 100 segments all at once).
Let’s continue the discussion in the comment section of your pull request:
Thank you for your comments. I think implementing this in the GUI would be helpful because many users would just focus on 3-5 organs/structures of interest when using TS. Ideally, you would want to be able to save your selection of choice (f.e. liver only) for future use. It is very helpful to have the roi_subset option in the logic when I call the logic from Lung CT Segmenter, because it saves nearly a minute of saving time (I could just ask for lobes and airways).