Possible Tasks

Here are a few ideas for improving mahotas.

Small Improvements

  • something like the overlay function from pymorph (or even just copy it over and adapt it to mahotas style).
  • H-maxima transform (again, pymorph can provide a basis)
  • entropy thresholding


These can be very complex as they require an understanding of the inner workings of mahotas, but that does appeal to a certain personality.

  • special case 1-D convolution on C-Arrays in C++. The idea is that you can write a tight inner loop in one dimension:

    void multiply(floating* r, const floating* f, const floating a, const int n, const int r_step, const int f_step) {
        for (int i = 0; i != n; ++i) {
            *r += a * *f;
            r += r_step;
            f += f_step;

to implement:

r[row] += a* f[row+offset]

and you can call this with all the different values of a and offset that make up your filter. This would be useful for Guassian filtering.


Mahotas has very good API documentation, but not so many start to finish tutorials which touch several parts of it (and even other packages, the ability to seamlessly use other packages in Python is, of course, a good reason to use it).