Skip to content

random_size defaulting to False in RandSpatialCropd #5652

@wyli

Description

@wyli

Discussed in #5651

Originally posted by MathijsdeBoer December 5, 2022
Hello all!

I've just spent way too much time on debugging a weird shape issue (as is common in deep learning) when trying to get a quick prototype going. Eventually I found out that the input patches would have inconsistent shapes, leading me to run through all of my transforms expecting a mistake, or some other unexpected behavior that I didn't account for.

Eventually, when running through I noticed that transforms.RandSpatialCropd (And the non-dictionary version) have random_size=True by default. To my mind, this is counter to expected default behavior. If I call a RandSpatialCropd(keys=some_keys, roi_size=some_size), I am not expecting my outputs to have random shapes unless specifically enabled.

Would a switch to random_size=False be a reasonable change to make in the next update?

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