[SciPy-dev] Should ndimage.measurements.* should return lists if index is a list?

Zachary Pincus zachary.pincus at yale.edu
Fri Apr 17 22:06:57 EDT 2009


> Current behavior:
>>>> from scipy import ndimage
>>>> ndimage.maximum([[1,2], [3,4]], [[1,0],[0,2]], index=[1,2])
> [1.0, 4.0]
>>>> ndimage.maximum([[1,2], [3,4]], [[1,0],[0,2]], index=[1])
> 1.0
>>>> ndimage.maximum([[1,2], [3,4]], [[1,0],[0,2]], index=1)
> 1.0
>
> I think the second result should be [1.0].  We're using the ndimage
> code for image processing, and have to wrap the measurement functions
> to make the code general for the case where there is only one object
> in the image.

I've run into this too, and had the same thought. It's such a corner- 
case that it doesn't seem like gratuitous API-breakage to make this  
fix...

Zach



More information about the SciPy-Dev mailing list