Skip to content

ZarrDataset update for inference

Latest
Compare
Choose a tag to compare
@fercer fercer released this 09 Jul 13:27
· 1 commit to main since this release
v0.2.0
e2bed14

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 to PatchSampler 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 to PatchSampler to add padding into all spatial axes when generating the selection slices.
  • Added stride parameter to PatchSampler 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.