Beckschen / 3D-TransUNet

This is the official repository for the paper "3D TransUNet: Advancing Medical Image Segmentation through Vision Transformers"
Apache License 2.0
182 stars 10 forks source link

How to generate default_plans_identifier_plans_2D.pkl? #21

Closed stelatopalova closed 6 months ago

stelatopalova commented 7 months ago

Hello,

I am trying to train your model. I already ran the preprocessing from nnUNet. From the preprocessing, we get a folder with the gt_segmentations, nnUNetPlans_2d, nnUNetPlans_3d_fullresand so on. Additionally, we also get dataset_fingerprint.json, dataset.json, nnUNetPlans.json and splits_final.json. How can I generate the pickle file you need? There isn't much documentation from which I can see how to do it.

Thank you in advance.

dimitar10 commented 6 months ago

@stelatopalova you need nnUNetV1 to generate the pickle files, nnUNetV2 generates .json files. If you run the install script scripts/install.sh, it should install the correct version: https://github.com/Beckschen/3D-TransUNet/blob/190fe40735b2a5f688264db8bc0c93d19b0b98ec/scripts/install.sh#L13

Alternatively, you can install nnunet v1 in a separate env, and run preprocessing commands from there. The confusion I think is because on the nnUNet github repo the default is to install v2. Then, you can run a command similar to:

nnUNet_plan_and_preprocess -t 501,

or if you want a particular planner for 2d/3d setups for example:

nnUNet_plan_and_preprocess -t 501 -pl2d ExperimentPlanner2D_v21 -pl3d None, (this will create planner only for a 2D setup) or you can add/remove pl2d/pl3d flags and set them appropriately etc.

You need to make sure that you have previously exported all the right environment variables, they have the same names as in scripts/train.sh

Hope this helps

stelatopalova commented 6 months ago

@dimitar10 Thank you for your help! The confusion came because I was following the readme file of 3D-TransUNet and the link of the preprocessing goes to nnunetv2. I now have the preprocessing files I need.