Description
New capabilities were added to PatchSampler
and ImageBase
to handle padded samples and incomplete patches.
This allows to use ZarrDataset
in an inference workflow and not only for training.
Additionally, patch sampling is now based on multiples of the patch_size
instead of the chunk size from input files. This allow to sample patches from "incomplete" chunks (those smaller than the file's chunk size).
Changes
- Added
allow_incomplete_patches
parameter toPatchSampler
class. This allows to retrieve patches from chunks that are smaller than the input file's chunk size. Previously, these chunks and all patches that could potentially be extracted were discarded. - Added
pad
parameter toPatchSampler
to add padding into all spatial axes when generating the selection slices. - Added
stride
parameter toPatchSampler
to introduce spacing between sampled patches. - Updated
ImageBase
to handle indices that request pixels from outside the actual image by adding padding to cached chunks.