[SciPy-User] how can I create B-splines of mutidimensional values?

Kay F. Jahnke _kfj@yahoo....
Mon Nov 28 16:00:42 CST 2011


Zachary Pincus <zachary.pincus <at> yale.edu> writes:

> 
> >> You could then, as I mentioned, write a Cython module

> Haha... cython is actually less scary than all that. It's more a
 python-like
language that can be
> "compiled" to C, and which transparently interfaces with normal
 python code.
After adding a few type
> annotations, it's really easy to write loops that operate on numpy
 arrays at
C-ish speed.

I had a good look at cython before I opted to use swig for my project
- I had a large body of extant C++ code to deal with, and swig is better
at dealing with existing stuff (you basically include the original
C++ headers and add a bit of collateral code). Cython is more for
writing new code. But I'd have to write the cython code to operate
on numpy data and fit into the scipy environment. That's where the
gulp really came from. I'd have to look at what the current code does
and figure out how to write a new piece of scipy to fit in.

> > how do they go on about RGB images? do each channel separately?
 Someone
> > must have thought of exploiting the obvious redundancies.
> 
> Probably, but they might not have been writing in Python! After all,
 3x slower doesn't change the big-O
> complexity, and for most tasks that's often going to be fine. I mean,
everything equal it's always better
> to have faster, more general tools, but there's an API complexity cost,
 and someone needs to write the
> code, etc. etc. etc...

Still I feel going that way is right. But maybe I can get lucky elsewhere
- I suppose if I look around among the various image processing packages
I might find just what I want. In hugin, which is the project I work with,
they use vigra, and since vigra uses 'generic' programming I wouldn't be
too surprised if the type of vectorization I anticipate is already there.
I was just hoping to be able to do it all inside scipy rather than having
to pull in yet another dependency.

Kay





More information about the SciPy-User mailing list