<!DOCTYPE html>

<html>
  <head>
    <meta charset="utf-8">
    
    <title>scipy.ndimage.fourier_ellipsoid &mdash; SciPy v1.1.0.dev0+4e64658 Reference Guide</title>
    
    <link rel="stylesheet" type="text/css" href="../_static/css/spc-bootstrap.css">
    <link rel="stylesheet" type="text/css" href="../_static/css/spc-extend.css">
    <link rel="stylesheet" href="../_static/scipy.css" type="text/css" >
    <link rel="stylesheet" href="../_static/pygments.css" type="text/css" >
    
    <script type="text/javascript">
      var DOCUMENTATION_OPTIONS = {
        URL_ROOT:    '../',
        VERSION:     '1.1.0.dev0+4e64658',
        COLLAPSE_INDEX: false,
        FILE_SUFFIX: '.html',
        HAS_SOURCE:  false
      };
    </script>
    <script type="text/javascript" src="../_static/jquery.js"></script>
    <script type="text/javascript" src="../_static/underscore.js"></script>
    <script type="text/javascript" src="../_static/doctools.js"></script>
    <script type="text/javascript" src="../_static/scipy-mathjax/MathJax.js?config=scipy-mathjax"></script>
    <script type="text/javascript" src="../_static/js/copybutton.js"></script>
    <link rel="index" title="Index" href="../genindex.html" >
    <link rel="search" title="Search" href="../search.html" >
    <link rel="top" title="SciPy v1.1.0.dev0+4e64658 Reference Guide" href="../index.html" >
    <link rel="up" title="Multi-dimensional image processing (scipy.ndimage)" href="../ndimage.html" >
    <link rel="next" title="scipy.ndimage.fourier_gaussian" href="scipy.ndimage.fourier_gaussian.html" >
    <link rel="prev" title="scipy.ndimage.uniform_filter1d" href="scipy.ndimage.uniform_filter1d.html" > 
  </head>
  <body>

  <div class="container">
    <div class="header">
    </div>
  </div>


    <div class="container">
      <div class="main">
        
	<div class="row-fluid">
	  <div class="span12">
	    <div class="spc-navbar">
              
    <ul class="nav nav-pills pull-left">
	
        <li class="active"><a href="../index.html">SciPy v1.1.0.dev0+4e64658 Reference Guide</a></li>
	
          <li class="active"><a href="../ndimage.html" accesskey="U">Multi-dimensional image processing (<code class="docutils literal"><span class="pre">scipy.ndimage</span></code>)</a></li> 
    </ul>
              
              
    <ul class="nav nav-pills pull-right">
      <li class="active">
        <a href="../genindex.html" title="General Index"
           accesskey="I">index</a>
      </li>
      <li class="active">
        <a href="../py-modindex.html" title="Python Module Index"
           >modules</a>
      </li>
      <li class="active">
        <a href="scipy.ndimage.fourier_gaussian.html" title="scipy.ndimage.fourier_gaussian"
           accesskey="N">next</a>
      </li>
      <li class="active">
        <a href="scipy.ndimage.uniform_filter1d.html" title="scipy.ndimage.uniform_filter1d"
           accesskey="P">previous</a>
      </li>
    </ul>
              
	    </div>
	  </div>
	</div>
        

	<div class="row-fluid">
      <div class="spc-rightsidebar span3">
        <div class="sphinxsidebarwrapper">
            <p class="logo"><a href="../index.html">
              <img class="logo" src="../_static/scipyshiny_small.png" alt="Logo">
            </a></p>
  <h4>Previous topic</h4>
  <p class="topless"><a href="scipy.ndimage.uniform_filter1d.html"
                        title="previous chapter">scipy.ndimage.uniform_filter1d</a></p>
  <h4>Next topic</h4>
  <p class="topless"><a href="scipy.ndimage.fourier_gaussian.html"
                        title="next chapter">scipy.ndimage.fourier_gaussian</a></p>


        </div>
      </div>
          <div class="span9">
            
        <div class="bodywrapper">
          <div class="body" id="spc-section-body">
            
  <div class="section" id="scipy-ndimage-fourier-ellipsoid">
<h1>scipy.ndimage.fourier_ellipsoid<a class="headerlink" href="#scipy-ndimage-fourier-ellipsoid" title="Permalink to this headline">¶</a></h1>
<dl class="function">
<dt id="scipy.ndimage.fourier_ellipsoid">
<code class="descclassname">scipy.ndimage.</code><code class="descname">fourier_ellipsoid</code><span class="sig-paren">(</span><em>input</em>, <em>size</em>, <em>n=-1</em>, <em>axis=-1</em>, <em>output=None</em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/scipy/scipy/blob/4e64658/scipy/ndimage/fourier.py#L200-L260"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#scipy.ndimage.fourier_ellipsoid" title="Permalink to this definition">¶</a></dt>
<dd><p>Multi-dimensional ellipsoid fourier filter.</p>
<p>The array is multiplied with the fourier transform of a ellipsoid of
given sizes.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><p class="first"><strong>input</strong> : array_like</p>
<blockquote>
<div><p>The input array.</p>
</div></blockquote>
<p><strong>size</strong> : float or sequence</p>
<blockquote>
<div><p>The size of the box used for filtering.
If a float, <em class="xref py py-obj">size</em> is the same for all axes. If a sequence, <em class="xref py py-obj">size</em> has
to contain one value for each axis.</p>
</div></blockquote>
<p><strong>n</strong> : int, optional</p>
<blockquote>
<div><p>If <em class="xref py py-obj">n</em> is negative (default), then the input is assumed to be the
result of a complex fft.
If <em class="xref py py-obj">n</em> is larger than or equal to zero, the input is assumed to be the
result of a real fft, and <em class="xref py py-obj">n</em> gives the length of the array before
transformation along the real transform direction.</p>
</div></blockquote>
<p><strong>axis</strong> : int, optional</p>
<blockquote>
<div><p>The axis of the real transform.</p>
</div></blockquote>
<p><strong>output</strong> : ndarray, optional</p>
<blockquote>
<div><p>If given, the result of filtering the input is placed in this array.
None is returned in this case.</p>
</div></blockquote>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first"><strong>fourier_ellipsoid</strong> : ndarray or None</p>
<blockquote class="last">
<div><p>The filtered input. If <em class="xref py py-obj">output</em> is given as a parameter, None is
returned.</p>
</div></blockquote>
</td>
</tr>
</tbody>
</table>
<p class="rubric">Notes</p>
<p>This function is implemented for arrays of rank 1, 2, or 3.</p>
<p class="rubric">Examples</p>
<div class="highlight-default"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">scipy</span> <span class="k">import</span> <span class="n">ndimage</span><span class="p">,</span> <span class="n">misc</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">import</span> <span class="nn">numpy.fft</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">import</span> <span class="nn">matplotlib.pyplot</span> <span class="k">as</span> <span class="nn">plt</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">fig</span><span class="p">,</span> <span class="p">(</span><span class="n">ax1</span><span class="p">,</span> <span class="n">ax2</span><span class="p">)</span> <span class="o">=</span> <span class="n">plt</span><span class="o">.</span><span class="n">subplots</span><span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="mi">2</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">plt</span><span class="o">.</span><span class="n">gray</span><span class="p">()</span>  <span class="c1"># show the filtered result in grayscale</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">ascent</span> <span class="o">=</span> <span class="n">misc</span><span class="o">.</span><span class="n">ascent</span><span class="p">()</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">input_</span> <span class="o">=</span> <span class="n">numpy</span><span class="o">.</span><span class="n">fft</span><span class="o">.</span><span class="n">fft2</span><span class="p">(</span><span class="n">ascent</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">result</span> <span class="o">=</span> <span class="n">ndimage</span><span class="o">.</span><span class="n">fourier_ellipsoid</span><span class="p">(</span><span class="n">input_</span><span class="p">,</span> <span class="n">size</span><span class="o">=</span><span class="mi">20</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">result</span> <span class="o">=</span> <span class="n">numpy</span><span class="o">.</span><span class="n">fft</span><span class="o">.</span><span class="n">ifft2</span><span class="p">(</span><span class="n">result</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">ax1</span><span class="o">.</span><span class="n">imshow</span><span class="p">(</span><span class="n">ascent</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">ax2</span><span class="o">.</span><span class="n">imshow</span><span class="p">(</span><span class="n">result</span><span class="o">.</span><span class="n">real</span><span class="p">)</span>  <span class="c1"># the imaginary part is an artifact</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">plt</span><span class="o">.</span><span class="n">show</span><span class="p">()</span>
</pre></div>
</div>
<div class="figure">
<img alt="../_images/scipy-ndimage-fourier_ellipsoid-1.png" src="../_images/scipy-ndimage-fourier_ellipsoid-1.png" />
</div>
</dd></dl>

</div>


          </div>
        </div>
          </div>
        </div>
      </div>
    </div>

    <div class="container container-navbar-bottom">
      <div class="spc-navbar">
        
      </div>
    </div>
    <div class="container">
    <div class="footer">
    <div class="row-fluid">
    <ul class="inline pull-left">
      <li>
        &copy; Copyright 2008-2016, The Scipy community.
      </li>
      <li>
      Last updated on Sep 21, 2017.
      </li>
      <li>
      Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.6.3.
      </li>
    </ul>
    </div>
    </div>
    </div>
  </body>
</html>