Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to use nnUNet weights other then TotalSegmentator weights? #5

Open
amitjc opened this issue May 19, 2024 · 3 comments
Open

How to use nnUNet weights other then TotalSegmentator weights? #5

amitjc opened this issue May 19, 2024 · 3 comments
Labels
question Further information is requested

Comments

@amitjc
Copy link

amitjc commented May 19, 2024

Dear Experts,

Congratulations and sincere thanks for releasing this extension.

I request inputs to run nnUNet models, available at https://zenodo.org/records/3734294, other than the TotalSegmentator nnUNet model. I seek the inputs in order to segment liver, liver tumor and hepatic vessels. These have a different folder structure and model weight extension, compared to the ones recommended for using the extension.

Look forward to hearing from you soon.

Best Regards,
Amit.

@Thibault-Pelletier
Copy link
Collaborator

Hi @amitjc,

If you want to run nnUNet V2 models, you can have a look at the Slicer NNUNet extension. This extension allows to load a volume, select a model to use for segmentation and run the segmentation.

It was tested with the DentalSegmentator and TotalSegmentator weights and should work for any nnUNet V2 model.

Best,
Thibault

@amitjc
Copy link
Author

amitjc commented May 30, 2024

@Thibault-Pelletier, thank you for your prompt response.

nnUNet v2 uses a slightly different folder structure, <weight_name> and json file; eg., fold_0 to fold_5, no dataset.json and weights under each fold with model_final_checkpoint.model instead of checkpoint_final.pth

Can these weights be leveraged with Slicer nnUNet extension?

Best Regards,
Amit.

@Thibault-Pelletier
Copy link
Collaborator

Thibault-Pelletier commented May 30, 2024

@amitjc the extension is only compatible with nnUNet V2.

If you take a look at recent TotalSegmentator weights, the folder structure looks like the following :

  • Dataset730_TotalSegmentatorMRI_part1_organs_495subj
    • nnUNetTrainer_DASegOrd0_NoMirroring__nnUNetPlans__3d_fullres
      • fold_0
        • checkpoint_final.pth
      • dataset.json
      • plans.json

The extension can handle multiple folds for ensemble inference.

The dataset.json and folds folders + weights are required for the extension to work. This expectation is documented here : https://github.com/KitwareMedical/SlicerNNUnet/tree/main?tab=readme-ov-file#expected-weight-folder-structure

@Thibault-Pelletier Thibault-Pelletier added the question Further information is requested label Jul 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants