From stefan at sun.ac.za Sun May 2 19:55:10 2010 From: stefan at sun.ac.za (Stefan van der Walt) Date: Sun, 2 May 2010 16:55:10 -0700 (PDT) Subject: offer to contribute In-Reply-To: <20100502212749.GA28892@phare.normalesup.org> References: <20100502212749.GA28892@phare.normalesup.org> Message-ID: <4d25c700-3912-4199-aa0b-77565d7775ea@g21g2000yqk.googlegroups.com> Hi Emanuelle On May 2, 11:27?pm, Emmanuelle Gouillart wrote: > ? ? ? ? as I'm using both Python/Scipy and image processing in my daily > work, I would be interested in contributing to the image scikit if I can > be of any help. Welcome! We are always very happy to receive new contributions in any form, be it code, documentation or suggestions. > ? ? ? ? I have read the "Contribute" page of the website, and maybe the > easiest way to start me off would be that I write some documentation and > tests. But please tell me if you have other suggestions, I do not have > specific preferences. The only thing is that I have almost never used > Cython, but I'm willing to learn it. Cython is a very handy tool, especially since we have to process large arrays rapidly. I don't think you'll have any problem getting the hang of it, given your extensive numpy background. It basically just revolves around annotating variables by saying this is an integer, this is an array of floats, etc. to help with the conversion from Python to C. > ? ? ? ? By the way, I had trouble installing the scikit as with my > Ubuntu-packaged version of Cython (0.11) I got lots of errors (such as > "/usr/lib/pymodules/python2.6/Cython/Includes/python_version.pxd:31:8: > Buffer types only allowed as function local variables") and I had to > install Cython 0.12 to make it work. I can provide the whole log if you > expected the install to work with Cython 0.11. I know we've also had to generate the NumPy sources with 0.12, so maybe it's safe to assume this as a minimum requirement. If only minor changes are required to build with 0.11, I'd be happy to apply a patch. > ? ? ? ? In the longer term, I could also contribute two algorithms that I > have implemented in Python (with dependencies to numpy and scipy): > > * the circular Hough transform (for 2-D images) that may be used to > detect circles. Fantastic! Let's get this code integrated. You can branch off the main repo at http://github.com/scikits.image and add your modifications. We can then review your changes and merge as soon as they're ready. > * a "random walker" segmentation algorithm that implements a recent > generic algorithm by L. Grady [Random walks for image segmentation, Leo > Grady, IEEE Trans Pattern Anal Mach Intell. 2006 Nov;28(11):1768-83]. The > algorithm basically finds the region into which given markers > preferentially diffuse, with an anisotropic diffusion that penalizes > diffusion across strong gradients. I use it to segment huge (500x500x500) > 3-D tomography images that are very noisy and full of artifacts and the > results are quite satisfying (much better than what I can get with a > watershed, for example). I haven't read the paper yet, but it sounds like an interesting concept. Again, I'd be happy to integrate the code. > ? ? ? ? But I think it is wiser that I first get to know the project by > contributing to existing parts of the scikit. Maybe the best way to get to know the code-base is to jump right in! Looking forward to your contributions, Cheers St?fan From emmanuelle.gouillart at normalesup.org Sun May 2 17:27:49 2010 From: emmanuelle.gouillart at normalesup.org (Emmanuelle Gouillart) Date: Sun, 2 May 2010 23:27:49 +0200 Subject: offer to contribute Message-ID: <20100502212749.GA28892@phare.normalesup.org> Hello, as I'm using both Python/Scipy and image processing in my daily work, I would be interested in contributing to the image scikit if I can be of any help. I have read the "Contribute" page of the website, and maybe the easiest way to start me off would be that I write some documentation and tests. But please tell me if you have other suggestions, I do not have specific preferences. The only thing is that I have almost never used Cython, but I'm willing to learn it. By the way, I had trouble installing the scikit as with my Ubuntu-packaged version of Cython (0.11) I got lots of errors (such as "/usr/lib/pymodules/python2.6/Cython/Includes/python_version.pxd:31:8: Buffer types only allowed as function local variables") and I had to install Cython 0.12 to make it work. I can provide the whole log if you expected the install to work with Cython 0.11. In the longer term, I could also contribute two algorithms that I have implemented in Python (with dependencies to numpy and scipy): * the circular Hough transform (for 2-D images) that may be used to detect circles. * a "random walker" segmentation algorithm that implements a recent generic algorithm by L. Grady [Random walks for image segmentation, Leo Grady, IEEE Trans Pattern Anal Mach Intell. 2006 Nov;28(11):1768-83]. The algorithm basically finds the region into which given markers preferentially diffuse, with an anisotropic diffusion that penalizes diffusion across strong gradients. I use it to segment huge (500x500x500) 3-D tomography images that are very noisy and full of artifacts and the results are quite satisfying (much better than what I can get with a watershed, for example). But I think it is wiser that I first get to know the project by contributing to existing parts of the scikit. Let me know how I can help. Cheers, Emmanuelle From zachary.pincus at yale.edu Wed May 12 01:56:49 2010 From: zachary.pincus at yale.edu (Zachary Pincus) Date: Wed, 12 May 2010 01:56:49 -0400 Subject: FreeImage <-> numpy IO wrappers Message-ID: <68E7297B-CFDB-41B5-A6F5-F07B8AD671BD@yale.edu> Hi all, I've been meaning for a long time to look into cobbling together some non-broken, maintainable (e.g. non-PIL) image IO library that can deal with scientific (16-bit and floating-point) image formats. I finally bit the bullet yesterday and whipped together a ctypes wrapper for the FreeImage library. (FreeImage is portable and largely if not entirely dependency-free; Windows binaries are available and it compiles cleanly on os x as well as other unixes: http://freeimage.sourceforge.net/ Check out the manual: http://downloads.sourceforge.net/freeimage/FreeImage3131.pdf , particularly the appendix that shows the supported image types and pixel formats: pretty impressive. Also note that there is a "FreeImagePy" project that has ctypes wrappers for FreeImage, but the code is... idiosyncratic... and doesn't interface with numpy anyway.) The underlying library and wrappers I wrote support reading and writing of greyscale, RGB, and RGBA images with 8- and 16-bit int/uint and 32-bit float pixels, as well as greyscale images with 64-bit float and 128-bit complex pixels. (The TIFF spec supports all of these, at least, as does FreeImage, but most other TIFF readers probably don't. The PNG format itself is a bit more limited, but FreeImage can read/ write everything in the spec, I think. Most other formats are 8-bit only.) Multipage image IO is also supported, and there's currently a bit of support for reading EXIF tags, which could easily be beefed up. The wrapper code is pretty compact and straightforward, and the FreeImage library seems pretty robust and simple (once one notes that it uses BGRA ordering on little-endian systems). Overall I feel a lot better about using this than dealing with PIL and its broken memory model and worse patch-acceptance track record. If anyone wants to test the wrappers out, I'll send you the code. Going forward, I'll look into getting this into the scikits image IO system, but I don't really have free cycles for that right now. Zach PS. FreeImage is dual licensed: GPL and a "FreeImage license", the latter of which I have no idea if is BSD compatible -- it says it's "less restrictive" than GPL but I'm unable to parse the license's many clauses. In any case, as long as users are required to provide their own FreeImage dll/so/dylib, it's not really a problem. From thouis at broadinstitute.org Thu May 13 12:00:33 2010 From: thouis at broadinstitute.org (Thouis (Ray) Jones) Date: Thu, 13 May 2010 12:00:33 -0400 Subject: [SciPy-User] FreeImage <-> numpy IO wrappers In-Reply-To: References: <68E7297B-CFDB-41B5-A6F5-F07B8AD671BD@yale.edu> <2A97F654-19A1-43D4-BDEA-D212AB669EBA@yale.edu> Message-ID: 2010/5/13 St?fan van der Walt : > [...] > I converted your wrappers to plugins for scikits.image. ?At the > moment, it still segfaults---could you help me to iron out the > problems? (I mentioned this to Zach, but it may be of general interest to the imaging scikit developers as well, as another source of useful format information, if nothing else...) On a related note, we've been collaborating with the Bio-Formats project (http://www.loci.wisc.edu/software/bio-formats), and we have a wrapper for their library in CellProfiler (but it's not too difficult to use separately). This is probably *not* something for the majority of people, since it requires using a Java JNI wrapper (written in Cython). And using it to save images on the Mac is risky in GUI applications. Examining the bio-formats code can be useful when writing new format parsers, as well. Best, Ray From stefan at sun.ac.za Thu May 13 19:16:06 2010 From: stefan at sun.ac.za (Stefan van der Walt) Date: Thu, 13 May 2010 16:16:06 -0700 (PDT) Subject: FreeImage <-> numpy IO wrappers In-Reply-To: References: <68E7297B-CFDB-41B5-A6F5-F07B8AD671BD@yale.edu> <2A97F654-19A1-43D4-BDEA-D212AB669EBA@yale.edu> Message-ID: <8576902f-4210-4f09-ab27-be10e4f70c2a@e2g2000yqn.googlegroups.com> Hi Jake On May 13, 11:35?pm, jake bolewski wrote: > As someone who has struggled with getting some proprietary microscope images > into python I would love to see this get into scikits.image. ?The more > coverage of formats I say the better given the flexibility of the plugin > system. > > I would be willing to write some code or help test to help make the > integration happen. Wonderful, thanks! Maybe you and Ray can exchange ideas and create a branch on Github so long? Cheers St?fan From stefan at sun.ac.za Thu May 13 10:20:33 2010 From: stefan at sun.ac.za (=?ISO-8859-1?Q?St=E9fan_van_der_Walt?=) Date: Thu, 13 May 2010 16:20:33 +0200 Subject: [SciPy-User] FreeImage <-> numpy IO wrappers In-Reply-To: <2A97F654-19A1-43D4-BDEA-D212AB669EBA@yale.edu> References: <68E7297B-CFDB-41B5-A6F5-F07B8AD671BD@yale.edu> <2A97F654-19A1-43D4-BDEA-D212AB669EBA@yale.edu> Message-ID: Hey Zach On 12 May 2010 23:16, Zachary Pincus wrote: > Hi all, > >> I'm definitely interested, having had several nightmarish attempts at >> making PIL play nice with my 16-bit TIFF data. I don't have a ton of >> spare time myself right now, but I'd like to give it a shot. > > Wrappers attached. Currently, they try to load "FreeImage.[dll|dylib| > so]" (depending on the platform) from the same directory as the > module. This is of course easy to change. I converted your wrappers to plugins for scikits.image. At the moment, it still segfaults---could you help me to iron out the problems? http://github.com/stefanv/scikits.image/tree/freeimage Cheers St?fan From jakebolewski at gmail.com Thu May 13 17:35:11 2010 From: jakebolewski at gmail.com (jake bolewski) Date: Thu, 13 May 2010 17:35:11 -0400 Subject: [SciPy-User] FreeImage <-> numpy IO wrappers In-Reply-To: References: <68E7297B-CFDB-41B5-A6F5-F07B8AD671BD@yale.edu> <2A97F654-19A1-43D4-BDEA-D212AB669EBA@yale.edu> Message-ID: As someone who has struggled with getting some proprietary microscope images into python I would love to see this get into scikits.image. The more coverage of formats I say the better given the flexibility of the plugin system. I would be willing to write some code or help test to help make the integration happen. Best, Jake B. 2010/5/13 St?fan van der Walt > Hi Ray > > On 13 May 2010 18:00, Thouis (Ray) Jones > wrote: > > 2010/5/13 St?fan van der Walt : > >> [...] > >> I converted your wrappers to plugins for scikits.image. At the > >> moment, it still segfaults---could you help me to iron out the > >> problems? > > > > (I mentioned this to Zach, but it may be of general interest to the > > imaging scikit developers as well, as another source of useful format > > information, if nothing else...) > > > > On a related note, we've been collaborating with the Bio-Formats > > project (http://www.loci.wisc.edu/software/bio-formats), and we have a > > wrapper for their library in CellProfiler (but it's not too difficult > > to use separately). This is probably *not* something for the majority > > of people, since it requires using a Java JNI wrapper (written in > > Cython). And using it to save images on the Mac is risky in GUI > > applications. > > > > Examining the bio-formats code can be useful when writing new format > > parsers, as well. > > We've added a plugin framework for I/O so that we can easily add this > sort of optional functionality. The more formats we can support the > better! Would you like to integrate said code? > > The procedure is fairly straightforward: > > 1) Add a .ini file for the plugin. Format something like: > > [bio] > description = Load x, y and z formats using the foo library. > provides = imread, imsave > > 2) Add a bio_plugin.py file, and provide the functions imread and imsave. > > Regards > St?fan > -------------- next part -------------- An HTML attachment was scrubbed... URL: From stefan at sun.ac.za Thu May 13 15:41:54 2010 From: stefan at sun.ac.za (=?ISO-8859-1?Q?St=E9fan_van_der_Walt?=) Date: Thu, 13 May 2010 21:41:54 +0200 Subject: [SciPy-User] FreeImage <-> numpy IO wrappers In-Reply-To: References: <68E7297B-CFDB-41B5-A6F5-F07B8AD671BD@yale.edu> <2A97F654-19A1-43D4-BDEA-D212AB669EBA@yale.edu> Message-ID: Hi Ray On 13 May 2010 18:00, Thouis (Ray) Jones wrote: > 2010/5/13 St?fan van der Walt : >> [...] >> I converted your wrappers to plugins for scikits.image. ?At the >> moment, it still segfaults---could you help me to iron out the >> problems? > > (I mentioned this to Zach, but it may be of general interest to the > imaging scikit developers as well, as another source of useful format > information, if nothing else...) > > On a related note, we've been collaborating with the Bio-Formats > project (http://www.loci.wisc.edu/software/bio-formats), and we have a > wrapper for their library in CellProfiler (but it's not too difficult > to use separately). ?This is probably *not* something for the majority > of people, since it requires using a Java JNI wrapper (written in > Cython). ?And using it to save images on the Mac is risky in GUI > applications. > > Examining the bio-formats code can be useful when writing new format > parsers, as well. We've added a plugin framework for I/O so that we can easily add this sort of optional functionality. The more formats we can support the better! Would you like to integrate said code? The procedure is fairly straightforward: 1) Add a .ini file for the plugin. Format something like: [bio] description = Load x, y and z formats using the foo library. provides = imread, imsave 2) Add a bio_plugin.py file, and provide the functions imread and imsave. Regards St?fan From stefan at sun.ac.za Tue May 25 13:33:19 2010 From: stefan at sun.ac.za (=?ISO-8859-1?Q?St=E9fan_van_der_Walt?=) Date: Tue, 25 May 2010 10:33:19 -0700 Subject: OpenCV module external doc links broken In-Reply-To: <0E6187BF-87DF-4192-BCEA-45DA8DA0F2B4@space.unibe.ch> References: <0E6187BF-87DF-4192-BCEA-45DA8DA0F2B4@space.unibe.ch> Message-ID: Dear Michael Thank you for the bug report! I've fixed the documentation links and uploaded a new version of the docs. Regards St?fan On 25 May 2010 05:20, K.-Michael Aye wrote: > Hi! > Just wanted to let you know, that your links on > http://stefanv.github.com/scikits.image/api/scikits.image.opencv.html > ?to the OpenCV documentation are broken. > > Instead of, for example, > > http://opencv.willowgarage.com/documentation/image_processing.html#cvGoodFeaturesToTrack > > it is now > > http://opencv.willowgarage.com/documentation/feature_detection.html#goodfeaturestotrack > > > Best regards, > Michael From stefan at sun.ac.za Tue May 25 20:18:29 2010 From: stefan at sun.ac.za (=?ISO-8859-1?Q?St=E9fan_van_der_Walt?=) Date: Tue, 25 May 2010 17:18:29 -0700 Subject: OpenCV module external doc links broken In-Reply-To: <4BFC5503.6000108@gmail.com> References: <0E6187BF-87DF-4192-BCEA-45DA8DA0F2B4@space.unibe.ch> <4BFC5503.6000108@gmail.com> Message-ID: Hey Chris On 25 May 2010 15:53, S. Chris Colbert wrote: > I suppose we should update the cvdoc decorator as well? That's the way I fixed it. Cheers Stefan From sccolbert at gmail.com Tue May 25 18:53:55 2010 From: sccolbert at gmail.com (S. Chris Colbert) Date: Tue, 25 May 2010 18:53:55 -0400 Subject: OpenCV module external doc links broken In-Reply-To: References: <0E6187BF-87DF-4192-BCEA-45DA8DA0F2B4@space.unibe.ch> Message-ID: <4BFC5503.6000108@gmail.com> I suppose we should update the cvdoc decorator as well? On 05/25/2010 01:33 PM, St??????fan van der Walt wrote: > Dear Michael > > Thank you for the bug report! I've fixed the documentation links and > uploaded a new version of the docs. > > Regards > St??????fan > > On 25 May 2010 05:20, K.-Michael Aye wrote: > >> Hi! >> Just wanted to let you know, that your links on >> http://stefanv.github.com/scikits.image/api/scikits.image.opencv.html >> to the OpenCV documentation are broken. >> >> Instead of, for example, >> >> http://opencv.willowgarage.com/documentation/image_processing.html#cvGoodFeaturesToTrack >> >> it is now >> >> http://opencv.willowgarage.com/documentation/feature_detection.html#goodfeaturestotrack >> >> >> Best regards, >> Michael >> From stefan at sun.ac.za Tue May 25 22:40:46 2010 From: stefan at sun.ac.za (=?ISO-8859-1?Q?St=E9fan_van_der_Walt?=) Date: Tue, 25 May 2010 19:40:46 -0700 Subject: OpenCV module external doc links broken In-Reply-To: <4BFC7C9D.1010309@gmail.com> References: <0E6187BF-87DF-4192-BCEA-45DA8DA0F2B4@space.unibe.ch> <4BFC5503.6000108@gmail.com> <4BFC7C9D.1010309@gmail.com> Message-ID: On 25 May 2010 18:42, S. Chris Colbert wrote: > Did you commit the changes to github? I browsed it manually and the changes > weren't there. Looks like I have a detached head. I'll look into it. Cheers St?fan From sccolbert at gmail.com Tue May 25 21:42:53 2010 From: sccolbert at gmail.com (S. Chris Colbert) Date: Tue, 25 May 2010 21:42:53 -0400 Subject: OpenCV module external doc links broken In-Reply-To: References: <0E6187BF-87DF-4192-BCEA-45DA8DA0F2B4@space.unibe.ch> <4BFC5503.6000108@gmail.com> Message-ID: <4BFC7C9D.1010309@gmail.com> Did you commit the changes to github? I browsed it manually and the changes weren't there. On 05/25/2010 08:18 PM, St??????fan van der Walt wrote: > Hey Chris > > On 25 May 2010 15:53, S. Chris Colbert wrote: > >> I suppose we should update the cvdoc decorator as well? >> > That's the way I fixed it. > > Cheers > Stefan >