Skip to content

Downsampling Augmentation Transform #3781

@lyndonboone

Description

@lyndonboone

Is your feature request related to a problem? Please describe.
Working with augmentation for DL pipelines, it would be nice to have a transform that downsamples the image by a factor (as opposed to a specified tensor shape or voxel size) while preserving the shape of the input to simulate images acquired at a low resolution that have been resampled to a larger shape.

Describe the solution you'd like
An ideal solution would downsample the image by a specified factor, then upsample back to the original shape. Similar to RandomAnisotropy from TorchIO (https://torchio.readthedocs.io/transforms/augmentation.html) except with the capability to do isotropic downsampling.

Describe alternatives you've considered
I can get close to the desired behavior by placing two instances of a Zoom transform one after another, with reciprocal zoom factors and keep_size=False (e.g., Compose([Zoom(zoom=0.5, keep_size=False), Zoom(zoom=2.0, keep_size=False)])); however, this solution doesn't guarantee that the output shape will be the same as the input (although it will likely be close). For example, if the input shape is [192, 256, 256] and the desired downsampling factor is 3, the output shape will be [192, 255, 255].

There may be an alternative solution that I haven't considered. Otherwise, if you think this is worth adding as a new transform (or an adaptation to an existing transform), I'd be more than happy to try to submit a PR.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions