Description
Is your feature request related to a problem? Please describe.
GridPatchDataset
'sdata
argument must be a sequence of already loaded data. However, it would be consistent with other datasets to allow loading and manipulating other types of data throughtransform
. For example, you might want to provide a dict of image and label paths and load them through transforms usingLoadImaged()
.PatchDataset
should follow the same. Moreover, it has atransform
argument that is actually the same aspatch_transform
inGridPatchDataset
, so it should follow that naming.- Finally, it would be useful to have Persistent or Cache versions of these (or just any
IterableDataset
) - is that something that you would want to have?
Describe the solution you'd like
GridPatchDataset
currently haspatch_transform
, but should have two transforms:transform
andpatch_transform
. Thetransform
is to be used the same as in the IterableDataset and is applied prior to patching, whilepatch_transform
is applied to the patch.PatchDataset
should follow the same.
Describe alternatives you've considered
None
Additional context
I started looking into these patch-based datasets because I want to perform validation on large images during my training. Specifically, images are sometimes too big to perform SlidingWindowInferer on GPU, and using cpu_thresh
just results in a very long computation. I hope to use this as a replacement for it, and it should be way faster if Persistent/Cache mode is available too. It basically emulates sliding window inference - still allows you to split into patches with some overlap and pass them through the network to get the prediction, but with a caveat that the predicted patches are never merged and instead evaluated against the corresponding label patches individually.
I am happy to make a PR for the first two points. I am also interested in implementing the third point if you agree with it and if we discuss how we should approach it.
Metadata
Metadata
Assignees
Type
Projects
Status