Skip to content

Reverse order in the RandomAffineElasticDeformation application #1491

Description

@Mathlab99

Thank you for building and sharing this great work!

I noticed this "bug":
When the argument "affine_first" is set to True in RandomAffineElasticDeformation(), the order of the affine and the elastic deformation application should be reversed because the sitk.CompositeTransform expects the reverse order with the back transformation being applied first while in the code the back transformation is the elastic one (bspline_transform) when "affine_first" is True (instead of the affine one).

The lines 183-186 in spatial/random_affine_elastic_deformation.py should be modified from :
if self.affine_first:
combined_transforms = [affine_transform, bspline_transform]
else:
combined_transforms = [bspline_transform, affine_transform]

to :
if self.affine_first:
combined_transforms = [bspline_transform, affine_transform]
else:
combined_transforms = [affine_transform, bspline_transform]

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions