nnunet(六) custom spacing

https://github.com/MIC-DKFZ/nnUNet/blob/master/documentation/tutorials/custom_spacing.md

通过创建一个自定义的ExperimentPlanner来自定义的设置target spacing,让我们运行 Medical Segmentation Decathlon.的一个例子Task002_Heart来阐述它,数据集比较小,所有运行起来不会有太大的困难。

首先下载对应的数据集,然后使用nnUNet_convert_decathlon_task将它转换为nnU-Net对应的数据格式。我们需要运行一个自定义的3d experiment planner对应的nnUNet_plan_and_preprocess来实现,作者已经创建了一个合适的trainer,experiment_planner_baseline_3DUNet_v21_customTargetSpacing_2x2x2.py

这将为3d_fullres配置中的target spacing直接设置成2x2x2mm(3d_lowres没有改变)。现在去看看这个ExperimentPlanner。

运行nnUNet_plan_and_preprocess并指定刚才创建的ExperimentPlanner

nnUNet_plan_and_preprocess -t 2 -pl2d None -pl3d ExperimentPlanner3D_v21_customTargetSpacing_2x2x2

-pl2d None表示禁用2D预处理,ExperimentPlanner中只包含了3D训练,执行完这一步 所有的数据都会被预处理到target spacing。例如,当运行任何nnUNet_*命令时,可以通过指定链接到它的新的自定义计划文件new custom plans file来使用它(参见ExperimentPlanner3D_v21_customTargetSpacing_2x2x2源代码)

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

 确保以_plans_3D.pkl作为后缀。

TODO: how to compare with the default run?

IMPORTANT:当创建自定义ExperimentPlanner时,确保始终将它们放在nnunet.experiment_planning module中的唯一类名下。如果创建子文件夹,请确保它们包含__init__py文件(可以为空)。如果你没有这样做,nnU-Net将无法定位你的ExperimentPlanner并且会崩溃crash!

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
Spacing in QML refers to the amount of empty space or padding between items in a user interface. It can be used to adjust the layout and visual appearance of elements. In QML, you can control spacing using various properties. One way to add spacing between items is by using the `spacing` property of layout containers such as `RowLayout` or `ColumnLayout`. For example, you can set the spacing between items in a horizontal layout using the `spacing` property like this: ```qml RowLayout { spacing: 10 // Set the spacing between items to 10 pixels Rectangle { width: 50 height: 50 color: "red" } Rectangle { width: 50 height: 50 color: "blue" } } ``` In this example, the `spacing` property is set to 10, creating a 10-pixel gap between the two rectangles. Alternatively, you can manually add spacing using the `Item` element and setting the `anchors` properties. For example: ```qml Item { width: 200 height: 200 Rectangle { width: 50 height: 50 color: "red" anchors.left: parent.left // Align to the left edge of the parent item } Rectangle { width: 50 height: 50 color: "blue" anchors.left: prevItem.right // Align to the right edge of the previous item anchors.leftMargin: 10 // Add a 10-pixel spacing } } ``` In this case, the `anchors.leftMargin` property is used to add a 10-pixel spacing between the two rectangles. These are just a couple of examples of how you can add spacing in QML. The specific approach may vary depending on your layout requirements and the QML components you are using.
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值