Repository: scikit-image/scikit-image

Issue:
Bring back coordinates='rc' parameter
## Description

While we were trying to fix #3667, @holly-c-gibbs, @hmaarrfk, @alexdesiqueira and I noticed that `coordinates='rc'` is actually gone as a keyword argument for regionprops. I think that is the incorrect approach for the deprecation: we should change the default value to 'rc', and maybe warn that 'xy' support will disappear, *but* we should not break user code that worked *only* on 0.14 and 0.15 when we release 0.16. Specifically, the *recommended*, *correct* way to silence the warnings was to pass `coordinates='rc'` to the function, but that code will now break in 0.16.

## Way to reproduce
```python
# Place the full code we need to recreate your issue here
# upload all necessary images to github too!
```


## Version information
```python
# Paste the output of the following python commands
from __future__ import print_function
import sys; print(sys.version)
import platform; print(platform.platform())
import skimage; print("scikit-image version: {}".format(skimage.__version__))
import numpy; print("numpy version: {}".format(numpy.__version__))
```

```python
# your output here

```




Discussion:

Resolving patch:
diff --git a/skimage/measure/_regionprops.py b/skimage/measure/_regionprops.py
--- a/skimage/measure/_regionprops.py
+++ b/skimage/measure/_regionprops.py
@@ -1,3 +1,4 @@
+from warnings import warn
 from math import sqrt, atan2, pi as PI
 import numpy as np
 from scipy import ndimage as ndi
@@ -619,8 +620,9 @@ def regionprops_table(label_image, intensity_image=None, cache=True,
     return _props_to_dict(regions, properties=properties, separator=separator)
 
 
-def regionprops(label_image, intensity_image=None, cache=True):
-    """Measure properties of labeled image regions.
+def regionprops(label_image, intensity_image=None, cache=True,
+                coordinates=None):
+    r"""Measure properties of labeled image regions.
 
     Parameters
     ----------
@@ -640,6 +642,20 @@ def regionprops(label_image, intensity_image=None, cache=True):
         Determine whether to cache calculated properties. The computation is
         much faster for cached properties, whereas the memory consumption
         increases.
+    coordinates : DEPRECATED
+        This argument is deprecated and will be removed in a future version
+        of scikit-image.
+
+        See :ref:`Coordinate conventions <numpy-images-coordinate-conventions>`
+        for more details.
+
+        .. deprecated:: 0.16.0
+            Use "rc" coordinates everywhere. It may be sufficient to call
+            ``numpy.transpose`` on your label image to get the same values as
+            0.15 and earlier. However, for some properties, the transformation
+            will be less trivial. For example, the new orientation is
+            :math:`\frac{\pi}{2}` plus the old orientation.
+
 
     Returns
     -------
@@ -819,6 +835,22 @@ def regionprops(label_image, intensity_image=None, cache=True):
     if not np.issubdtype(label_image.dtype, np.integer):
         raise TypeError('Label image must be of integer type.')
 
+    if coordinates is not None:
+        if coordinates == 'rc':
+            msg = ('The coordinates keyword argument to skimage.measure.'
+                   'regionprops is deprecated. All features are now computed '
+                   'in rc (row-column) coordinates. Please remove '
+                   '`coordinates="rc"` from all calls to regionprops before '
+                   'updating scikit-image.')
+            warn(msg, stacklevel=2, category=FutureWarning)
+        else:
+            msg = ('Values other than "rc" for the "coordinates" argument '
+                   'to skimage.measure.regionprops are no longer supported. '
+                   'You should update your code to use "rc" coordinates and '
+                   'stop using the "coordinates" argument, or use skimage '
+                   'version 0.15.x or earlier.')
+            raise ValueError(msg)
+
     regions = []
 
     objects = ndi.find_objects(label_image)


Test patch:
diff --git a/skimage/measure/tests/test_regionprops.py b/skimage/measure/tests/test_regionprops.py
--- a/skimage/measure/tests/test_regionprops.py
+++ b/skimage/measure/tests/test_regionprops.py
@@ -2,6 +2,8 @@
 
 import numpy as np
 from numpy import array
+
+from skimage._shared._warnings import expected_warnings
 from skimage.measure._regionprops import (regionprops, PROPS, perimeter,
                                           _parse_docs, _props_to_dict,
                                           regionprops_table, OBJECT_COLUMNS,
@@ -525,3 +527,10 @@ def test_props_dict_complete():
 
 def test_column_dtypes_complete():
     assert set(COL_DTYPES.keys()).union(OBJECT_COLUMNS) == set(PROPS.values())
+
+
+def test_deprecated_coords_argument():
+    with expected_warnings(['coordinates keyword argument']):
+        region = regionprops(SAMPLE, coordinates='rc')
+    with testing.raises(ValueError):
+        region = regionprops(SAMPLE, coordinates='xy')