<h3 dir="auto">Describe your issue.</h3>
<p dir="auto">Following up to <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="13650930" data-permission-text="Title is private" data-url="https://github.com/scipy/scipy/issues/1616" data-hovercard-type="issue" data-hovercard-url="/scipy/scipy/issues/1616/hovercard" href="https://github.com/scipy/scipy/issues/1616">#1616</a></p>
<p dir="auto">When the input for <code class="notranslate">distance_transform_edt</code> has no background, the results are unexpected.<br>
As in the previous issue, the expectation would be that the function would return an array of zeros.<br>
However, the output distances are based on the distance from (-1, 0), which seems incorrect.<br>
I'm currently having to check if the array has a background or not before using the function, but would like the function to have a more consistent output.</p>
<h3 dir="auto">Reproducing Code Example</h3>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="In [1]: import numpy as np
In [2]: from scipy.ndimage.morphology import distance_transform_edt
In [3]: distance_transform_edt(np.ones((3,3), dtype=int), return_indices=True)
Out[3]:
(array([[1.        , 1.41421356, 2.23606798],
        [2.        , 2.23606798, 2.82842712],
        [3.        , 3.16227766, 3.60555128]]),
 array([[[-1, -1, -1],
         [-1, -1, -1],
         [-1, -1, -1]],

        [[ 0,  0,  0],
         [ 0,  0,  0],
         [ 0,  0,  0]]], dtype=int32))"><pre class="notranslate"><span class="pl-v">In</span> [<span class="pl-c1">1</span>]: <span class="pl-s1">import</span> <span class="pl-s1">numpy</span> <span class="pl-k">as</span> <span class="pl-s1">np</span>
<span class="pl-v">In</span> [<span class="pl-c1">2</span>]: <span class="pl-s1">from</span> <span class="pl-s1">scipy</span>.<span class="pl-s1">ndimage</span>.<span class="pl-s1">morphology</span> <span class="pl-s1">import</span> <span class="pl-s1">distance_transform_edt</span>
<span class="pl-v">In</span> [<span class="pl-c1">3</span>]: <span class="pl-en">distance_transform_edt</span>(<span class="pl-s1">np</span>.<span class="pl-en">ones</span>((<span class="pl-c1">3</span>,<span class="pl-c1">3</span>), <span class="pl-s1">dtype</span><span class="pl-c1">=</span><span class="pl-s1">int</span>), <span class="pl-s1">return_indices</span><span class="pl-c1">=</span><span class="pl-c1">True</span>)
<span class="pl-v">Out</span>[<span class="pl-c1">3</span>]:
(<span class="pl-en">array</span>([[<span class="pl-c1">1.</span>        , <span class="pl-c1">1.41421356</span>, <span class="pl-c1">2.23606798</span>],
        [<span class="pl-c1">2.</span>        , <span class="pl-c1">2.23606798</span>, <span class="pl-c1">2.82842712</span>],
        [<span class="pl-c1">3.</span>        , <span class="pl-c1">3.16227766</span>, <span class="pl-c1">3.60555128</span>]]),
 <span class="pl-en">array</span>([[[<span class="pl-c1">-</span><span class="pl-c1">1</span>, <span class="pl-c1">-</span><span class="pl-c1">1</span>, <span class="pl-c1">-</span><span class="pl-c1">1</span>],
         [<span class="pl-c1">-</span><span class="pl-c1">1</span>, <span class="pl-c1">-</span><span class="pl-c1">1</span>, <span class="pl-c1">-</span><span class="pl-c1">1</span>],
         [<span class="pl-c1">-</span><span class="pl-c1">1</span>, <span class="pl-c1">-</span><span class="pl-c1">1</span>, <span class="pl-c1">-</span><span class="pl-c1">1</span>]],

        [[ <span class="pl-c1">0</span>,  <span class="pl-c1">0</span>,  <span class="pl-c1">0</span>],
         [ <span class="pl-c1">0</span>,  <span class="pl-c1">0</span>,  <span class="pl-c1">0</span>],
         [ <span class="pl-c1">0</span>,  <span class="pl-c1">0</span>,  <span class="pl-c1">0</span>]]], <span class="pl-s1">dtype</span><span class="pl-c1">=</span><span class="pl-s1">int32</span>))</pre></div>
<h3 dir="auto">Error message</h3>
<div class="highlight highlight-source-shell notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="No error"><pre class="notranslate">No error</pre></div>
<h3 dir="auto">SciPy/NumPy/Python version information</h3>
<p dir="auto">1.7.3</p>
<p dir="auto"><em>Original ticket <a href="http://projects.scipy.org/scipy/ticket/1647" rel="nofollow">http://projects.scipy.org/scipy/ticket/1647</a> on 2012-04-22 by <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/WarrenWeckesser/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/WarrenWeckesser">@WarrenWeckesser</a>, assigned to unknown.</em></p>
<p dir="auto">The erlang distribution (in distributions.py) defines the method _arg_check instead of _argcheck, so it currently allows values for n that are not integers.</p>