nnunet编辑自己的数据集2d
以我使用的2d数据为例,需要如下格式
需要将训练样本和标签分别放入imagesTr和labelTr中,imagesTs中放验证数据,nnunet使用交叉验证不需要测试数据。
然后根据dataset.json来分编辑数据集,2d这些都是必须的,numTraining就是图像总数,这里会有一个断言。另外需要在每张图像命名后面标注多模态_0000
{
"channel_names": {
"0": "R",
"1": "G",
"2": "B"
},
"labels": {
"background": 0,
"T1": 1,
"T2": 2,
"T3": 3,
"T4": 4,
"T5": 5,
"T6": 6,
"T7": 7,
"T8": 8,
"T9": 9,
"T10": 10,
"T11": 11,
"T12": 12,
"L1": 13,
"L2": 14,
"L3": 15,
"L4": 16,
"L5": 17
},
"numTraining": 656,
"file_ending": ".png",
"name": "Dataset606_spineXray",
"description": "This dataset was from the MICCAI 2017 Robotic Instrument Segmentation Challenge https://endovissub2017-roboticinstrumentsegmentation.grand-challenge.org/Home/"
}
图像的名字无所谓,最后加上一个_0000,表示单一模态,图像和标签名字对应即可,标签不需要_0000
3d的dataset.json也大差不差
{
"channel_names": {
"0": "CT"
},
"labels": {
"background": 0,
"liver": 1,
"right kidney": 2,
"spleen": 3,
"pancreas": 4,
"aorta": 5,
"inferior vena cava": 6,
"right adrenal gland": 7,
"left adrenal gland": 8,
"gallbladder": 9,
"esophagus": 10,
"stomach": 11,
"duodenum": 12,
"left kidney": 13
},
"numTraining": 50,
"file_ending": ".nii.gz",
"name": "Dataset701_AbdomenCT",
"description": "This dataset was from MICCAI FLARE 2022 Challenge. The training set contained 50 CT scans that were from the MSD Pancreas dataset and the annotations were from AbdomenCT-1K. Another 50 validation cases were from TCIA and the annotations were provided by the challenge organizers."
}
@end