Replies: 7 comments 4 replies
-
Yes I thing, |
Beta Was this translation helpful? Give feedback.
-
why then not choose the largest image size : the problem, is that for 'small images' you may extract a patch with full zeros ... (you could still play with WeightedSampler if you have a mask of the original image, in order to restrict patch center within the mask) Why are yours images so heterogeneous Is it the field of view (FOV) that is changing or also the voxel size? |
Beta Was this translation helpful? Give feedback.
-
I do not understand what you have in mind with MaybePad ... to pad only small images ? (this is what CorpOrPad already doing) Actually I wonder, if you really need, to CropOrPad, if you are using the Queue, (to extract different patch from each volume) then you will enp up with a fixe patch size (whatever the original image size is) ... Though I am not sure if the Queue can handle volume with different size ... (to test) ... |
Beta Was this translation helpful? Give feedback.
-
So may be the best option is indeed with a MaybePad, (it should be easy, you can do the same as CropOrPad, but with Pad only ... Or just add an extra argument to skip the Croping part in the CropOrPad transform, It will then pad to your target size, if needed (but not crop) ... Other option is to construct an appropriate mask, to be use in the WeightedSampler to restrict the patch center of the extraction ... |
Beta Was this translation helpful? Give feedback.
-
may be it worth a PR (@fepegar ?) |
Beta Was this translation helpful? Give feedback.
-
Hi, both. What about adding an option in the sampler to pad the volume to match the patch size if the patch is larger than the volume? |
Beta Was this translation helpful? Give feedback.
-
yes make sense, it will solve the issue I think |
Beta Was this translation helpful? Give feedback.
-
Consider a heterogeneous dataset comprised of images whose size ranges from 75x190x190 to 300x250x250 and you want to train a CNN on patches of 80x200x200. Is it possible to do this with the existing data transformation functions?
I guess that CropOrPad((80, 200, 200)) won't help because it will crop larger images, and I still want these images to be large so that different patches can be extracted from them. I also guess that Pad(()) won't help either because it will pad all images similarly.
Would a MaybePad(minimum_size=(80, 200, 200)) function that only pads images smaller than the given size be a solution, or is there any way to solve this with the existing functions?
Beta Was this translation helpful? Give feedback.
All reactions