Issue 1:
Crap, missed something here in one of the ndimage refactoring PRs - the build is broken on OS X as of commit 9b57607 (Python 3.5, NumPy 1.13.0, OS X 10.12, Clang 8.1.0):

scipy/ndimage/src/ni_morphology.c:470:13: warning: comparison of integers of different signs: 'npy_uint' (aka 'unsigned int') and 'int' [-Wsign-compare]
CASE_ERODE_POINT2(NPY_UINT, npy_uint,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
scipy/ndimage/src/ni_morphology.c:317:55: note: expanded from macro 'CASE_ERODE_POINT2'
if (_to != _bf_value && *(_type *)(_pi + _to) == _true) { \
~~~~~~~~~~~~~~~~~~~~~ ^ ~~~~~
scipy/ndimage/src/ni_morphology.c:476:13: warning: comparison of integers of different signs: 'npy_ulong' (aka 'unsigned long') and 'int' [-Wsign-compare]
CASE_ERODE_POINT2(NPY_ULONG, npy_ulong,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
scipy/ndimage/src/ni_morphology.c:317:55: note: expanded from macro 'CASE_ERODE_POINT2'
if (_to != _bf_value && *(_type *)(_pi + _to) == _true) { \
~~~~~~~~~~~~~~~~~~~~~ ^ ~~~~~
scipy/ndimage/src/ni_morphology.c:482:13: warning: comparison of integers of different signs: 'npy_ulonglong' (aka 'unsigned long long') and 'int' [-Wsign-compare]
CASE_ERODE_POINT2(NPY_ULONGLONG, npy_ulonglong,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
scipy/ndimage/src/ni_morphology.c:317:55: note: expanded from macro 'CASE_ERODE_POINT2'
if (_to != _bf_value && *(_type *)(_pi + _to) == _true) { \
~~~~~~~~~~~~~~~~~~~~~ ^ ~~~~~
In file included from scipy/ndimage/src/ni_morphology.c:32:
In file included from scipy/ndimage/src/ni_support.h:42:
In file included from scipy/ndimage/src/nd_image.h:38:
In file included from /Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/numpy/core/include/numpy/arrayobject.h:4:
In file included from /Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/numpy/core/include/numpy/ndarrayobject.h:27:
/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/numpy/core/include/numpy/__multiarray_api.h:1453:1: warning: unused function '_import_array' [-Wunused-function]
_import_array(void)
^
4 warnings generated.
/usr/bin/clang -bundle -undefined dynamic_lookup -arch i386 -arch x86_64 -g build/temp.macosx-10.6-intel-3.5/scipy/ndimage/src/nd_image.o build/temp.macosx-10.6-intel-3.5/scipy/ndimage/src/ni_filters.o build/temp.macosx-10.6-intel-3.5/scipy/ndimage/src/ni_fourier.o build/temp.macosx-10.6-intel-3.5/scipy/ndimage/src/ni_interpolation.o build/temp.macosx-10.6-intel-3.5/scipy/ndimage/src/ni_measure.o build/temp.macosx-10.6-intel-3.5/scipy/ndimage/src/ni_morphology.o build/temp.macosx-10.6-intel-3.5/scipy/ndimage/src/ni_support.o -Lbuild/temp.macosx-10.6-intel-3.5 -o scipy/ndimage/_nd_image.cpython-35m-darwin.so
duplicate symbol __scipy_ndimage_ARRAY_API in:
build/temp.macosx-10.6-intel-3.5/scipy/ndimage/src/nd_image.o
build/temp.macosx-10.6-intel-3.5/scipy/ndimage/src/ni_filters.o
duplicate symbol __scipy_ndimage_ARRAY_API in:
build/temp.macosx-10.6-intel-3.5/scipy/ndimage/src/nd_image.o
build/temp.macosx-10.6-intel-3.5/scipy/ndimage/src/ni_fourier.o
duplicate symbol __scipy_ndimage_ARRAY_API in:
build/temp.macosx-10.6-intel-3.5/scipy/ndimage/src/nd_image.o
build/temp.macosx-10.6-intel-3.5/scipy/ndimage/src/ni_interpolation.o
duplicate symbol __scipy_ndimage_ARRAY_API in:
build/temp.macosx-10.6-intel-3.5/scipy/ndimage/src/nd_image.o
build/temp.macosx-10.6-intel-3.5/scipy/ndimage/src/ni_measure.o
duplicate symbol __scipy_ndimage_ARRAY_API in:
build/temp.macosx-10.6-intel-3.5/scipy/ndimage/src/nd_image.o
build/temp.macosx-10.6-intel-3.5/scipy/ndimage/src/ni_support.o
duplicate symbol __scipy_ndimage_ARRAY_API in:
build/temp.macosx-10.6-intel-3.5/scipy/ndimage/src/nd_image.o
build/temp.macosx-10.6-intel-3.5/scipy/ndimage/src/ni_morphology.o
ld: 6 duplicate symbols for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
duplicate symbol __scipy_ndimage_ARRAY_API in:
build/temp.macosx-10.6-intel-3.5/scipy/ndimage/src/nd_image.o
build/temp.macosx-10.6-intel-3.5/scipy/ndimage/src/ni_filters.o
duplicate symbol __scipy_ndimage_ARRAY_API in:
build/temp.macosx-10.6-intel-3.5/scipy/ndimage/src/nd_image.o
build/temp.macosx-10.6-intel-3.5/scipy/ndimage/src/ni_fourier.o
duplicate symbol __scipy_ndimage_ARRAY_API in:
build/temp.macosx-10.6-intel-3.5/scipy/ndimage/src/nd_image.o
build/temp.macosx-10.6-intel-3.5/scipy/ndimage/src/ni_interpolation.o
duplicate symbol __scipy_ndimage_ARRAY_API in:
build/temp.macosx-10.6-intel-3.5/scipy/ndimage/src/nd_image.o
build/temp.macosx-10.6-intel-3.5/scipy/ndimage/src/ni_measure.o
duplicate symbol __scipy_ndimage_ARRAY_API in:
build/temp.macosx-10.6-intel-3.5/scipy/ndimage/src/nd_image.o
build/temp.macosx-10.6-intel-3.5/scipy/ndimage/src/ni_support.o
duplicate symbol __scipy_ndimage_ARRAY_API in:
build/temp.macosx-10.6-intel-3.5/scipy/ndimage/src/nd_image.o
build/temp.macosx-10.6-intel-3.5/scipy/ndimage/src/ni_morphology.o
ld: 6 duplicate symbols for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
error: Command "/usr/bin/clang -bundle -undefined dynamic_lookup -arch i386 -arch x86_64 -g build/temp.macosx-10.6-intel-3.5/scipy/ndimage/src/nd_image.o build/temp.macosx-10.6-intel-3.5/scipy/ndimage/src/ni_filters.o build/temp.macosx-10.6-intel-3.5/scipy/ndimage/src/ni_fourier.o build/temp.macosx-10.6-intel-3.5/scipy/ndimage/src/ni_interpolation.o build/temp.macosx-10.6-intel-3.5/scipy/ndimage/src/ni_measure.o build/temp.macosx-10.6-intel-3.5/scipy/ndimage/src/ni_morphology.o build/temp.macosx-10.6-intel-3.5/scipy/ndimage/src/ni_support.o -Lbuild/temp.macosx-10.6-intel-3.5 -o scipy/ndimage/_nd_image.cpython-35m-darwin.so" failed with exit status 1

Will investigate tomorrow. Works fine on Linux, not clear what the difference is.

Also some warnings about unsigned int comparisons (more of the same that I didn't copy in).

Issue 2:
Scipy has stats.median_abs_deviation implemented, which means this supports non-parametric/'median-stack' stats. There is stats.zscore, which is mean-std stack. This feature would be very helpful when working with skewed data or data with outliers.

I'm just wondering if we could have modified z-score with median and median abs deviation implemented?

I am happy to work on this if maintainer would approve. Suggestion on how to implement is appreciated.