[Insight-users] python prototyping advice

Richard Beare richard.beare at gmail.com
Wed Aug 17 02:01:07 EDT 2005


Hi,

I'm trying to stick with prototyping using python for simpler trials.
At the moment this includes mimicing a few old matlab scripts. This
brings me to my two questions.

Every time I've attempted to do something in python I've been slowed
down by missing wrappers. Some of these are easy enough to add (I hope
this is true - I'm waiting for the build to finish at the moment).
Assuming I've done this successfully, is there any way I can commit
these additions back to the repository? What is the protocol for this
type of thing?

The other question relates to certain types of operations that are
often done in interactive interpreter environments like matlab or R.
The particular matlab script I'm porting has a step where every pixel
in a mask is weighted by the distance to the mask center of gravity.

The approach in matlab is to generate coordinate images and operate on them e.g

dist = sqrt((xcoords - xcog).^2 + (ycoords - ycog).^2);

result = mask * dist

How do I do something equivalent in python? Is this where the numarray
stuff comes in?

Thanks


More information about the Insight-users mailing list