Amshaker / unetr_plus_plus

[IEEE TMI-2024] UNETR++: Delving into Efficient and Accurate 3D Medical Image Segmentation
Apache License 2.0
340 stars 32 forks source link

How to use the pretrained Synapse weight to test my own dataset? #28

Open qingwang-usc opened 1 year ago

qingwang-usc commented 1 year ago

Dear Authors: Hello, now I have some abdomen data, I want to load the pre-training Synapse weight directly and then test my data, but I don't know how to do it, could you tell me the approximate steps of testing my own data, thank you very much!

Amshaker commented 1 year ago

Hi @qingwang-usc ,

Sorry for the late reply.

To do that, please follow the following steps:-

1- You have to do the preprocessing of nnFormer. Mainly, you have to divide your data into 3D slices of size 128x128x64. Then, apply the same transformation of nnFormer.

2- After the data is pre-processed and ready, you may follow the scripts inside: https://github.com/Amshaker/unetr_plus_plus/blob/main/evaluation_scripts/run_evaluation_synapse.sh and replace the evaluation samples of Synapse by your pre-processed data and run the same script. Alternatively, you can adopt https://github.com/Amshaker/unetr_plus_plus/blob/main/unetr_pp/inference/predict_simple.py to load your pre-processed data, our Synapse architecture, and the checkpoint of Synapse, and do the prediction for your pre-processed data.

I hope my answer gives you an overview of the steps you needed.

Please let me know if you have other questions.

Best regards, Abdelrahman.

qingwang-usc commented 1 year ago

Thanks a lot!

---Original--- From: "Abdelrahman @.> Date: 2023/6/2 08:27:20 To: @.>; Cc: @.**@.>; Subject: Re: [Amshaker/unetr_plus_plus] How to use the pretrained Synapseweight to test my own dataset? (Issue #28)

Hi @qingwang-usc ,

Sorry for the late reply.

To do that, please follow the following steps:-

1- You have to do the preprocessing of nnFormer. Mainly, you have to divide your data into 3D slices of size 128x128x64. Then, apply the same transformation of nnFormer.

2- After the data is pre-processed and ready, you may follow the scripts inside: https://github.com/Amshaker/unetr_plus_plus/blob/main/evaluation_scripts/run_evaluation_synapse.sh and replace the evaluation samples of Synapse by your pre-processed data and run the same script. Alternatively, you can adopt https://github.com/Amshaker/unetr_plus_plus/blob/main/unetr_pp/inference/predict_simple.py to load your pre-processed data, our Synapse architecture, and the checkpoint of Synapse, and do the prediction for your pre-processed data.

I hope my answer gives you an overview of the steps you needed.

Please let me know if you have other questions.

Best regards, Abdelrahman.

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were mentioned.Message ID: @.***>