From 9cfee81a64a46651daf0739e95261b86407614d9 Mon Sep 17 00:00:00 2001 From: Yujing Huang Date: Fri, 9 Feb 2024 15:18:24 -0500 Subject: [PATCH] for backward compatibility, add `points` as a named argument with default value None to Affine.transform. Issue deprecated warning if it is not None. --- surfa/transform/affine.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/surfa/transform/affine.py b/surfa/transform/affine.py index 607ef16..b2b09ea 100644 --- a/surfa/transform/affine.py +++ b/surfa/transform/affine.py @@ -201,7 +201,7 @@ def __call__(self, *args, **kwargs): """ return self.transform(*args, **kwargs) - def transform(self, data, method='linear', rotation='corner', resample=True, fill=0): + def transform(self, data, method='linear', rotation='corner', resample=True, fill=0, points=None): """ Apply the affine transform matrix to the input data. @@ -228,6 +228,12 @@ def transform(self, data, method='linear', rotation='corner', resample=True, fil transformed : Volume Transformed image if (input data is an image Volume) """ + if points is not None: + data = points + warnings.warn('The \'points\' argument to transform() is deprecated. Just use ' + 'the first positional argument to specify set of points or an image to transform.', + DeprecationWarning, stacklevel=2) + # a common mistake is to use this function for transforming a mesh, # so run this check to help the user out a bit if ismesh(data):