Bug in scipy.ndimage.sum on linux x86_64

Hi,

Im using trunk checkout of Cell profiler 2 on my Ubuntu 10.10 x86_64 and I’ve encountered lots of exceptions when running my pipeline.
All exceptions were caused by bad argument type in call to scipy.ndimage.sum function.
The last parameter (“index”) to sum function should be one of:

[code][numpy.int8, numpy.int16, numpy.int32, numpy.uint8, numpy.uint16, numpy.bool]

see scipy/ndimage/measurements.py [/code]

but was int64 by default on 64bit linux. ex.:

In [1]: import numpy as np In [2]: np.arange(5).dtype Out[2]: dtype('int64')
I’ve scanned the code for all occurances of this problem, fixed them and have a patch file for it against updated trunk (r10952).

Best,
Matej Usaj
University of Toronto
Donnelly Centre
Boone Lab

Hi Matej,

Thanks for investigating this problem. Would you be able to post a patch to the forum?
-Mark

Hi Mark

attached is diff to trunk@r10955

I’ve tested only the following sources:
cellprofiler/modules/measureobjectintensity.py
cellprofiler/modules/measureobjectneighbors.py
cellprofiler/cpmath/haralick.py
cellprofiler/cpmath/filter.py
cellprofiler/modules/measureimagequality.py
cellprofiler/modules/measuretexture.py

others are untested but I fixed them in the same manner as the ones above.

Best,
Matej

Attachment failed to upload (permissions?).
here is a public link: usajusaj.org/~matej/cp_linux64.diff

Best
Matej

Thanks for the patch. However, this is a bug in Scipy which has been fixed in release 0.9.0b1. You should consider upgrading to that version in order to fix the problem at its root cause.

Thanks for the info, I didn’t check that out.
M

One extra note: If you’re interested, you can join a developer mailing list for CellProfiler by sending mail with “Subscribe” in the Subject field to:
cellprofiler-dev-request@broadinstitute.org.
-Mark