wasserth / TotalSegmentator

Tool for robust segmentation of >100 important anatomical structures in CT and MR images
Apache License 2.0
1.51k stars 250 forks source link

Are there any examples on how to use the --roi_subset <list of classes> and totalseg_combine_masks . #343

Closed hari3100 closed 3 months ago

hari3100 commented 3 months ago

As Im trying to use this model to do individual organ segmentation, for eg. for lungs , liver, spleen, kidneys, etc. Im using the model from monai , im able to run the code and everything runs fine , but I get a single nii.gz containing all the classes segmentation in it .

I followed a youtube video to do my work: https://youtu.be/NA8_Yi_q7X4?si=7P2cbwUvHbT_Hirs

I can't seem to find a way how can I only obtain the segmentation Im interested in

Below is the screenshot of one of my scans , as you can see the model did a great job at segmenting all the organs , but I want it to only segment lungs , or liver or something else . I understand maybe as of now we can directly change the number of classes the model will predict but can we atleast stop those unwanted predicted results from being saved in the final output.nii.gz file ?

Screenshot 2024-08-01 162333

Any help will be greatly appreciated.

wasserth commented 3 months ago

If you use the monai model, then please report this issue in the monai forum. I am not familiar with the monai model. If you use TotalSegmentator then per default you get one file per structure instead of one file containing all structures. If you want one file you can use the option --multilabel.

hari3100 commented 3 months ago

Yes, will do that, the TotalSegmentator is at the moment facing issues due to the nnUNet not working properly , will try the --multilabel then, Thank you for your help!!