nnUNet
nnUNet copied to clipboard
number of patch sizes
Hi, My data is in 3D. I want to know how many patches my data is divided into. My patch_size is 24x320x320. Can I understand that 24 represents the number of data layers? However, some of my data is less than 24 layers, how to do this?
Best wish!
24 represents the patch size in the first dimension. If your first dimension consists of layers then yes that's the layers. If the number of slices/layers is less than 24 nnU-Net will just pad the images. No problem with that.
nnU-Net does not explicitly create patches from your data. It just loads random locations during training.
Best, Fabian
So my data has only one patch to input into the prediction network?
During preprocessing each image is processed as one, it is not divided into patches. During training, an infinite number of random (!) patches is cropped from the preprocessed image. Patches are never created and stored explicitly. This would be a waste of disk space due to redundant saving of some partsof the images
From what I read in the article, nnUNet starts with a median patch size at the target spacing then slowly reduces the patch size to meet the GPU requirements as well as a minimum batch size of 2. I wonder how it is possible the final patch size has (several) dimension(s) larger than those of the initial median shape? For example, Figure SN3.1 in the supplementary material shows that for 3D full res model, the median patch size @ target spacing is 18x237x208 and the final chosen patch is 20x256x224. Can you help me explain this choice @FabianIsensee? Best, Tuan
Hey @beantr96, this is because the patch size must be a multiple of 2**num_pool. So if we want to pool 4 times along that axis, we cannot have 18 because that would result in a non-integer filter map size in the bottleneck. So we increase the patch size to the closest value that fulfills this requirement. Best, Fabian