Re: [Numpy-discussion] ndimage.label - howto force SWIG to use int32 - even on 64bit Linux ?

2010-05-03 Thread Stéfan van der Walt
Hi Sebastian On 3 May 2010 09:55, Sebastian Haase wrote: > I have actually not been using scikits.image so far. > Maybe I should give it a try. > Are you saying that scikits.image.measurements has its own > implementation of ndimage.label !? Sorry, I wasn't focusing: I merged his patch into scip

Re: [Numpy-discussion] ndimage.label - howto force SWIG to use int32 - even on 64bit Linux ?

2010-05-03 Thread Sebastian Haase
Hi Stéfan, I have actually not been using scikits.image so far. Maybe I should give it a try. Are you saying that scikits.image.measurements has its own implementation of ndimage.label !? My original post was actually referring to a C++ function I wrote to calculate 2nd-order moments of labeled ob

Re: [Numpy-discussion] ndimage.label - howto force SWIG to use int32 - even on 64bit Linux ?

2010-05-01 Thread Stéfan van der Walt
Hi Sebastian On 27 April 2010 10:27, Sebastian Haase wrote: > Hi, > I wanted to write some C code to accept labels as they come from > ndimage.label. > For some reason ndimage.label produces its output as an int32 array - > even on my 64bit system . I've merged Thouis's patch to implement sciki

Re: [Numpy-discussion] ndimage.label - howto force SWIG to use int32 - even on 64bit Linux ?

2010-04-29 Thread Charles R Harris
On Thu, Apr 29, 2010 at 1:52 AM, Sebastian Haase wrote: > Thanks for those replies. > But isn't npy_intp about pointers ? > At one point perhaps, but how it is used is to get 32 bits on 32 OS's and 64 bits on 64 bit OS's, For the common architectures int will always be 32 bits regardless, it i

Re: [Numpy-discussion] ndimage.label - howto force SWIG to use int32 - even on 64bit Linux ?

2010-04-29 Thread Sebastian Haase
Thanks for those replies. But isn't npy_intp about pointers ? I would need something likenpy_int32 . But does that exist ? Where is the list of types that numpy.i supports ? Also, BTW, is there code duplication if numpy.i supports (let's say) both npy_int and npy_int32 on a machine, where

Re: [Numpy-discussion] ndimage.label - howto force SWIG to use int32 - even on 64bit Linux ?

2010-04-28 Thread Bill Spotz
Both types of typemaps are enabled, so you just need to do you %apply directives correctly: %apply (npy_intp* IN_ARRAY1, int DIM1) {(npy_intp* seq, int n)}; etc SWIG should be able to figure it out from there. On Apr 28, 2010, at 12:58 PM, Charles R Harris wrote: > On Tue, Apr 27, 2

Re: [Numpy-discussion] ndimage.label - howto force SWIG to use int32 - even on 64bit Linux ?

2010-04-28 Thread Charles R Harris
On Tue, Apr 27, 2010 at 2:27 AM, Sebastian Haase wrote: > Hi, > I wanted to write some C code to accept labels as they come from > ndimage.label. > For some reason ndimage.label produces its output as an int32 array - > even on my 64bit system . > > BTW, could this be considered a bug ? > > Likely

[Numpy-discussion] ndimage.label - howto force SWIG to use int32 - even on 64bit Linux ?

2010-04-28 Thread Sebastian Haase
(2nd try to get this post into the mailing list archive...) Hi, I wanted to write some C code to accept labels as they come from ndimage.label. For some reason ndimage.label produces its output as an int32 array - even on my 64bit system . BTW, could this be considered a bug ? Now, if I use the

[Numpy-discussion] ndimage.label - howto force SWIG to use int32 - even on 64bit Linux ?

2010-04-28 Thread Sebastian Haase
Hi, I wanted to write some C code to accept labels as they come from ndimage.label. For some reason ndimage.label produces its output as an int32 array - even on my 64bit system . BTW, could this be considered a bug ? Now, if I use the typemaps of numpy.i I can choose between NPY_LONG and NPY_INT