title: Average 3d numpy array with more weight for central slices
body: <p>I have a set of 3D numpy arrays of size <code>128x128x64</code>.</p>
  <p>I want to reduce these into <code>128x128</code> by averaging over the third axis, and am currently doing that using this line</p>
  <pre><code> np.mean(X, axis=2)
  </code></pre>
  <p>However, the pattern of the data is that the outer slices, contain less influential information and the central slices contain more.</p>
  <p>Is there anyway I can average over the slices giving preference/more weight to the central slices and slowly decreasing out to the outer ones?</p>
  <p>Either that or the important data in the arrays is usually bunched up and has the highest intensity. If there is anyway I can give preference to these regions whilst averaging please suggest any ideas.</p>
  <p>Thanks</p>