constantinpape/torch-em

segmentation dataset: padding and sampler negate each other

Closed this issue · 0 comments

Description

if sampler is used the padding sometimes is not correct. this is because of the order: getitem calls _get_sample which first ensures the correct patch_shape of the sample but then the sampler logic is applied (without ensuring the patch shape afterwards)
see

if self.sampler is not None:

Solution

change order so that sampler first and then ensure patch_shape