<div dir="ltr">Hi Josh,<div><br></div><div>Your framework sounds really interesting!</div><div><br></div><div>In my opinion, it would be great to keep the current implementation (with cython.parallel) for the routine that calculates local weighted variance, while at the same time, expose a general purpose interface that accepts arbitrary python function (provided it still offers some performance gain compared with ndimage.filters.<wbr>generic_filter. Will this be the case?).</div><div><br>On Tuesday, May 27, 2014 11:07:43 AM UTC+8, Josh Warner wrote:<blockquote class="gmail_quote" style="margin: 0;margin-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;"><div dir="ltr">Funny you should request this. I built a Cython framework do exactly what you want (arbitrary selem, boundary handling [padding], and even arbitrary weighting of the selem in 2D and 3D) for local <i>weighted </i>variance.<div><br></div><div>The framework is about as useful as the actual calculation. Replace the innermost loop, change the name, and you get an entirely different non-linear weighted local feature. This requires a somewhat skilled user, but the framework is already done so it isn't as hard as it sounds.</div><div><br></div><div>Trouble is, I used some features from cython.parallel so those would have to be stripped out, losing over an order of magnitude in speed. I've been kicking around submitting them, but going back and ripping out the parallel features is painful.<br><br>If interested I can clean up and put them in a Gist or two.</div><div><br></div><div>Josh<br><br>On Monday, May 26, 2014 1:50:10 AM UTC-5, Chencan QIAN wrote:<blockquote class="gmail_quote" style="margin:0;margin-left:0.8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Essentially, this is something similar to scipy.ndimage.filters.<wbr>generic_filter (which is too slow because of its internal python for-loop), but implemented in cython as with skimage.filter.rank family.<div><br></div><div>Given the diversity within skimage.filter.rank, a generic function would be very useful. For example, I'd like to calculate local variance, which is conceptually similar to skimage.filter.rank.mean, but not supported currently.</div><div><br></div><div>I guess the absence of such a function must be due to some unresolved technical obstacle?</div><div><br></div><div>Thanks~</div><div><br></div><div>Chencan</div></div></blockquote></div></div></blockquote></div></div>