Fixed flowchart gaussian filter not accepting MetaArray input
(fixes examples/Flowchart.py)
This commit is contained in:
parent
4ddf077a4b
commit
d100c1770c
|
@ -164,8 +164,15 @@ class Gaussian(CtrlNode):
|
||||||
import scipy.ndimage
|
import scipy.ndimage
|
||||||
except ImportError:
|
except ImportError:
|
||||||
raise Exception("GaussianFilter node requires the package scipy.ndimage.")
|
raise Exception("GaussianFilter node requires the package scipy.ndimage.")
|
||||||
return pgfn.gaussianFilter(data, self.ctrls['sigma'].value())
|
|
||||||
|
|
||||||
|
if hasattr(data, 'implements') and data.implements('MetaArray'):
|
||||||
|
info = data.infoCopy()
|
||||||
|
filt = pgfn.gaussianFilter(data.asarray(), self.ctrls['sigma'].value())
|
||||||
|
if 'values' in info[0]:
|
||||||
|
info[0]['values'] = info[0]['values'][:filt.shape[0]]
|
||||||
|
return metaarray.MetaArray(filt, info=info)
|
||||||
|
else:
|
||||||
|
return pgfn.gaussianFilter(data, self.ctrls['sigma'].value())
|
||||||
|
|
||||||
class Derivative(CtrlNode):
|
class Derivative(CtrlNode):
|
||||||
"""Returns the pointwise derivative of the input"""
|
"""Returns the pointwise derivative of the input"""
|
||||||
|
|
Loading…
Reference in New Issue
Block a user