From c1bb30f625abb9ecba5a92b4ded37e9e945307d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20Sch=C3=B6nberger?= Date: Wed, 1 May 2013 11:15:47 +0200 Subject: [PATCH] Return combined xy-coordinate array with arbitrary dimensions in predict_xy --- skimage/measure/fit.py | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/skimage/measure/fit.py b/skimage/measure/fit.py index 3b2d7d32..4f3445bf 100644 --- a/skimage/measure/fit.py +++ b/skimage/measure/fit.py @@ -277,10 +277,8 @@ class CircleModel(BaseModel): Returns ------- - x : array - Predicted x-coordinates. - y : array - Predicted y-coordinates. + xy : (..., 2) array + Predicted x- and y-coordinates. ''' if params is None: @@ -290,7 +288,7 @@ class CircleModel(BaseModel): x = xc + r * np.cos(t) y = yc + r * np.sin(t) - return x, y + return np.concatenate((x[..., None], y[..., None]), axis=t.ndim) class EllipseModel(BaseModel): @@ -483,10 +481,8 @@ class EllipseModel(BaseModel): Returns ------- - x : array - Predicted x-coordinates. - y : array - Predicted y-coordinates. + xy : (..., 2) array + Predicted x- and y-coordinates. ''' @@ -502,7 +498,7 @@ class EllipseModel(BaseModel): x = xc + a * ctheta * ct - b * stheta * st y = yc + a * stheta * ct + b * ctheta * st - return x, y + return np.concatenate((x[..., None], y[..., None]), axis=t.ndim) def ransac(data, model_class, min_samples, residual_threshold,