custom_spacing

Sometimes you want to set custom target spacings. This is done by creating a custom ExperimentPlanner.
Let’s run this with the Task002_Heart example from the Medical Segmentation Decathlon. This dataset is not too large
and working with it is therefore a breeze!

This example requires you to have downloaded the dataset and converted it to nnU-Net format with
nnUNet_convert_decathlon_task

We need to run the nnUNet_plan_and_preprocess command with a custom 3d experiment planner to achieve this. I have
created an appropriate trainer and placed it in experiment_planner_baseline_3DUNet_v21_customTargetSpacing_2x2x2.py

This will set a hard coded target spacing of 2x2x2mm for the 3d_fullres configuration (3d_lowres is unchanged).
Go have a look at this ExperimentPlanner now.

To run nnUNet_plan_and_preprocess with the new ExperimentPlanner, simply specify it:

nnUNet_plan_and_preprocess -t 2 -pl2d None -pl3d ExperimentPlanner3D_v21_customTargetSpacing_2x2x2

Note how we are disabling 2D preprocessing with -pl2d None. The ExperimentPlanner I created is only for 3D.
You will need to generate a separate one for 3D.

Once this is completed your task will have been preprocessed with the desired target spacing. You can use it by
specifying the new custom plans file that is linked to it (see
ExperimentPlanner3D_v21_customTargetSpacing_2x2x2 source code) when running any nnUNet_* command, for example:

nnUNet_train 3d_fullres nnUNetTrainerV2 2 FOLD -p nnUNetPlansv2.1_trgSp_2x2x2

(make sure to omit the _plans_3D.pkl suffix!)

TODO: how to compare with the default run?

IMPORTANT: When creating custom ExperimentPlanner, make sure to always place them under a unique class name somewhere
in the nnunet.experiment_planning module. If you create subfolders, make sure they contain an __init__py file
(can be empty). If you fail to do so nnU-Net will not be able to locate your ExperimentPlanner and crash!

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值