Viewer Plugins -> Passing precalculated arguments
jni.soma at gmail.com
Wed Jan 28 06:10:02 EST 2015
Check out functools.partial, which is a standard function in Python. It allows you to create functions with pre-evaluated arguments:
from skimage.restoration import denoise_tv_bregman
denoise = functools.partial(denoise_tv_bregman, weight=5, max_iter=10)
# use denoise_tv_bregman with weight and max_iter set:
denoise_plugin = Plugin(image_filter=denoise)
On Wed, Jan 28, 2015 at 9:59 PM, Marcel Gutsche <marcel.gutsche at gmail.com>
> Hi everyone,
> I'm working on an image processing project involving several consecutive
> steps. For parameter optimization I would like to create a viewer plugin
> which is capable to take these previous outputs into account.
> So basically the introductory example found in the docs of
> denoise_plugin = Plugin(image_filter=denoise_tv_bregman)
> would be sufficient, if I could pass additional fixed arguments (like an
> additional numpy array).
> I hope I made myself clear, and someone can give me hint at where to look
> Best regards,
> You received this message because you are subscribed to the Google Groups "scikit-image" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to scikit-image+unsubscribe at googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the scikit-image