From holtzhau at gmail.com Sat Jun 4 07:45:37 2011 From: holtzhau at gmail.com (Pieter Holtzhausen) Date: Sat, 4 Jun 2011 13:45:37 +0200 Subject: A good article on optimization Message-ID: http://scikit-learn.sourceforge.net/dev/developers/performance.html from our scikits-learn brethren. And here is a google summer of code 2007 participant: http://www.python.org/dev/peps/pep-0368 I'm interested in how much one would gain in comparison with a numpy based approach. From ralf.gommers at googlemail.com Sat Jun 4 15:14:36 2011 From: ralf.gommers at googlemail.com (Ralf Gommers) Date: Sat, 4 Jun 2011 21:14:36 +0200 Subject: A good article on optimization In-Reply-To: References: Message-ID: On Sat, Jun 4, 2011 at 1:45 PM, Pieter Holtzhausen wrote: > http://scikit-learn.sourceforge.net/dev/developers/performance.html > from our scikits-learn brethren. > Yes, that's a very good approach. > > And here is a google summer of code 2007 participant: > http://www.python.org/dev/peps/pep-0368 > I'm interested in how much one would gain in comparison with a numpy > based approach. > Eh, nothing? Looks like that never got off the ground, it sounds to me like it wanted to do what the buffer protocol does - just in a more clumsy way. I also don't see anything in that PEP that would make it faster then scipy.ndimage. Cheers, Ralf -------------- next part -------------- An HTML attachment was scrubbed... URL: From stefan at sun.ac.za Mon Jun 6 06:33:50 2011 From: stefan at sun.ac.za (=?ISO-8859-1?Q?St=E9fan_van_der_Walt?=) Date: Mon, 6 Jun 2011 12:33:50 +0200 Subject: A good article on optimization In-Reply-To: References: Message-ID: On Sat, Jun 4, 2011 at 1:45 PM, Pieter Holtzhausen wrote: > http://scikit-learn.sourceforge.net/dev/developers/performance.html > from our scikits-learn brethren. It's a pity this page doesn't yet document the valgrind / kcachegrind approach; I find this to be by far the most useful way of examining Cython bottlenecks! Graphical visualisation of Python code: $ easy_install RunSnakeRun $ python -m cProfile -o prof.data scriptname $ runsnake prof.data Graphical visualisation of extensions: $ valgrind --tool=callgrind -v --dump-instr=yes --trace-jump=yes --callgrind-out-file=callgrind.log python benchmark.py $ kcachegrind callgrind.log Cheers St?fan From jeanpatrick.pommier at gmail.com Fri Jun 17 12:11:16 2011 From: jeanpatrick.pommier at gmail.com (jip) Date: Fri, 17 Jun 2011 09:11:16 -0700 (PDT) Subject: How to get the skeleton of a binary particle. Message-ID: Hi, Using scikits.image, is it possible to get the skeleton of a binary 2D particle ? Best regards Jean-Patrick From zachary.pincus at yale.edu Fri Jun 17 15:51:08 2011 From: zachary.pincus at yale.edu (Zachary Pincus) Date: Fri, 17 Jun 2011 15:51:08 -0400 Subject: How to get the skeleton of a binary particle. In-Reply-To: References: <000e0cdf8ebeaba2ec04a5eb0904@google.com> Message-ID: > Then this is simply a connected component :) > > You can do morphological thinning > (see http://homepages.inf.ed.ac.uk/rbf/HIPR2/thin.htm or http://microboone-docdb.fnal.gov/cgi-bin/RetrieveFile?docid=732&version=1&filename=12-11-09-CAnderson-CVCenterlineExtraction.pdf ) > using simple operations, most of which should be either in sckits.image or easily implementable from numpy > Also, CellProfiler has good skeletonization routines, amongst others: https://svn.broadinstitute.org/CellProfiler/trunk/CellProfiler/cellprofiler/cpmath/ It's built on top of scipy.ndimage where practical, and with extensions written in cython otherwise. Check out cpmorphology.py for the skeletonization stuff. (The cpmath is pretty stand-alone from the rest of the package.) Zach From jeanpatrick.pommier at gmail.com Fri Jun 17 12:40:04 2011 From: jeanpatrick.pommier at gmail.com (jeanpatrick.pommier at gmail.com) Date: Fri, 17 Jun 2011 16:40:04 +0000 Subject: How to get the skeleton of a binary particle. In-Reply-To: Message-ID: <000e0cdf8ebeaba2ec04a5eb0904@google.com> To me a particle is a set of 8-connected component, with or without hole. It can have anyshape like this: http://dip4fish.blogspot.com/2011/04/detecting-branched-points-in-skeleton.html. The aim i then to analyse the skeleton and the contour of the particle:http://dip4fish.blogspot.com/2011/06/open-curve-to-ordered-pixels-second.html I was wandering if there was something like scikits.image.thin( binaryparticle) could be directly done. Jean-Patrick Le , Ma?l Primet a ?crit : > what do you mean by particle? round? you would want to detect the center > then? skeletons will probably not be appropriate in this case because > they are sensible to noise. > There are many existing skeleton algorithms, either using simple > morphological operations, > distance transforms or EDP, but to my knowledge none have been > implemented in this package. > On Fri, Jun 17, 2011 at 18:11, jip jeanpatrick.pommier at gmail.com> wrote: > Hi, > Using scikits.image, is it possible to get the skeleton of a binary 2D > particle ? > Best regards > Jean-Patrick -------------- next part -------------- An HTML attachment was scrubbed... URL: From mael.primet at gmail.com Fri Jun 17 12:25:14 2011 From: mael.primet at gmail.com (=?UTF-8?B?TWHDq2wgUHJpbWV0?=) Date: Fri, 17 Jun 2011 18:25:14 +0200 Subject: How to get the skeleton of a binary particle. In-Reply-To: References: Message-ID: what do you mean by particle? round? you would want to detect the center then? skeletons will probably not be appropriate in this case because they are sensible to noise. There are many existing skeleton algorithms, either using simple morphological operations, distance transforms or EDP, but to my knowledge none have been implemented in this package. On Fri, Jun 17, 2011 at 18:11, jip wrote: > Hi, > Using scikits.image, is it possible to get the skeleton of a binary 2D > particle ? > > Best regards > > Jean-Patrick -------------- next part -------------- An HTML attachment was scrubbed... URL: From jeanpatrick.pommier at gmail.com Fri Jun 17 12:43:53 2011 From: jeanpatrick.pommier at gmail.com (Jean-Patrick Pommier) Date: Fri, 17 Jun 2011 18:43:53 +0200 Subject: How to get the skeleton of a binary particle. In-Reply-To: <000e0cdf8ebeaba2ec04a5eb0904@google.com> References: <000e0cdf8ebeaba2ec04a5eb0904@google.com> Message-ID: ...I was wondering... 2011/6/17 > To me a particle is a set of 8-connected component, with or without hole. > It can have anyshape like this: > http://dip4fish.blogspot.com/2011/04/detecting-branched-points-in-skeleton.html. > The aim i then to analyse the skeleton and the contour of the particle: > http://dip4fish.blogspot.com/2011/06/open-curve-to-ordered-pixels-second.html > > I was wandering if there was something like scikits.image.thin( > binaryparticle) could be directly done. > > Jean-Patrick > > Le , Ma?l Primet a ?crit : > > > what do you mean by particle? round? you would want to detect the center > then? skeletons will probably not be appropriate in this case because they > are sensible to noise. > > There are many existing skeleton algorithms, either using simple > morphological operations, > > > > > > distance transforms or EDP, but to my knowledge none have been > > implemented in this package. > > > > On Fri, Jun 17, 2011 at 18:11, jip jeanpatrick.pommier at gmail.com> wrote: > > > > > > Hi, > > > > Using scikits.image, is it possible to get the skeleton of a binary 2D > > > > particle ? > > > > > > > > Best regards > > > > > > > > Jean-Patrick > > > > > > > > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From mael.primet at gmail.com Fri Jun 17 15:46:36 2011 From: mael.primet at gmail.com (=?UTF-8?B?TWHDq2wgUHJpbWV0?=) Date: Fri, 17 Jun 2011 21:46:36 +0200 Subject: How to get the skeleton of a binary particle. In-Reply-To: References: <000e0cdf8ebeaba2ec04a5eb0904@google.com> Message-ID: Then this is simply a connected component :) You can do morphological thinning (see http://homepages.inf.ed.ac.uk/rbf/HIPR2/thin.htm or http://microboone-docdb.fnal.gov/cgi-bin/RetrieveFile?docid=732&version=1&filename=12-11-09-CAnderson-CVCenterlineExtraction.pdf ) using simple operations, most of which should be either in sckits.image or easily implementable from numpy Ma?l -------------- next part -------------- An HTML attachment was scrubbed... URL: From zachary.pincus at yale.edu Sat Jun 18 08:53:36 2011 From: zachary.pincus at yale.edu (Zachary Pincus) Date: Sat, 18 Jun 2011 08:53:36 -0400 Subject: How to get the skeleton of a binary particle. In-Reply-To: References: <000e0cdf8ebeaba2ec04a5eb0904@google.com> Message-ID: <9CD55C51-4281-41B1-979C-B581800F9084@yale.edu> > Also, CellProfiler has good skeletonization routines, amongst others: > https://svn.broadinstitute.org/CellProfiler/trunk/CellProfiler/cellprofiler/cpmath/ > It's built on top of scipy.ndimage where practical, and with extensions written in cython otherwise. Check out cpmorphology.py for the skeletonization stuff. (The cpmath is pretty stand-alone from the rest of the package.) > > To install cpmath, do I have to download all the files from the adress then run something like sudo python setup.py, or can I use it after importing sckikits.image? I suppose that some routine of cell profiler are merged into scikits.image. If I do: > In [4]: import scikits.image > > In [5]: import scikits.image as scim > > I don't know then where to search to find cellprofiler module. I have: > > In [6]: scim.version > Out[6]: Some of the cellprofiler stuff has been integrated into scikits, I think, but I don't know to what extent. Perhaps someone else can weigh in. For installing cpmath standalone, you'll need to download that code. Checking it out using svn would be easiest: svn co https://svn.broadinstitute.org/CellProfiler/trunk/CellProfiler/cellprofiler/cpmath/ Then do whatever 'python setup.py install' dance is appropriate for your system. (You'll need cython installed too.) You might have to fix a few places where cpmath imports something from the rest of cellprofiler, but those dependencies are trivial; just comment them out. Zach From jeanpatrick.pommier at gmail.com Sat Jun 18 08:40:47 2011 From: jeanpatrick.pommier at gmail.com (Jean-Patrick Pommier) Date: Sat, 18 Jun 2011 14:40:47 +0200 Subject: How to get the skeleton of a binary particle. In-Reply-To: References: <000e0cdf8ebeaba2ec04a5eb0904@google.com> Message-ID: 2011/6/17 Zachary Pincus > > Then this is simply a connected component :) > > > > You can do morphological thinning > > (see http://homepages.inf.ed.ac.uk/rbf/HIPR2/thin.htm or > http://microboone-docdb.fnal.gov/cgi-bin/RetrieveFile?docid=732&version=1&filename=12-11-09-CAnderson-CVCenterlineExtraction.pdf) > > using simple operations, most of which should be either in sckits.image > or easily implementable from numpy > > > > Also, CellProfiler has good skeletonization routines, amongst others: > > https://svn.broadinstitute.org/CellProfiler/trunk/CellProfiler/cellprofiler/cpmath/ > It's built on top of scipy.ndimage where practical, and with extensions > written in cython otherwise. Check out cpmorphology.py for the > skeletonization stuff. (The cpmath is pretty stand-alone from the rest of > the package.) > To install cpmath, do I have to download all the files from the adress then run something like sudo python setup.py, or can I use it after importing sckikits.image? I suppose that some routine of cell profiler are merged into scikits.image. If I do: In [4]: import scikits.image In [5]: import scikits.image as scim I don't know then where to search to find cellprofiler module. I have: In [6]: scim.version Out[6]: > > Zach Thanks a lot. Jean-Patrick -------------- next part -------------- An HTML attachment was scrubbed... URL: From jeanpatrick.pommier at gmail.com Sat Jun 18 08:58:23 2011 From: jeanpatrick.pommier at gmail.com (Jean-Patrick Pommier) Date: Sat, 18 Jun 2011 14:58:23 +0200 Subject: How to get the skeleton of a binary particle. In-Reply-To: References: <000e0cdf8ebeaba2ec04a5eb0904@google.com> Message-ID: 2011/6/17 Ma?l Primet > Then this is simply a connected component :) > > You can do morphological thinning > (see http://homepages.inf.ed.ac.uk/rbf/HIPR2/thin.htm or > http://microboone-docdb.fnal.gov/cgi-bin/RetrieveFile?docid=732&version=1&filename=12-11-09-CAnderson-CVCenterlineExtraction.pdf > ) > using simple operations, most of which should be either in sckits.image > where is it? If I do from a ipython/spyder console: In [4]: import scikits.image In [5]: import scikits.image as scim writting scim with a dot, I don't see so much modules, only:data_dir, getlog,test,version. > or easily implementable from numpy > > > Ma?l > > Do you know how to handle the "don't care points" in a structuring element when using the hit and miss operator provided by ndimage? I can do it under ubuntu with mahotas, but not under windows due to freeimage.dll issues. Thanks for your help. Jean-Patrick -------------- next part -------------- An HTML attachment was scrubbed... URL: From stefan at sun.ac.za Mon Jun 20 05:20:32 2011 From: stefan at sun.ac.za (=?ISO-8859-1?Q?St=E9fan_van_der_Walt?=) Date: Mon, 20 Jun 2011 11:20:32 +0200 Subject: How to get the skeleton of a binary particle. In-Reply-To: <000e0cdf8ebeaba2ec04a5eb0904@google.com> References: <000e0cdf8ebeaba2ec04a5eb0904@google.com> Message-ID: Hi On Fri, Jun 17, 2011 at 6:40 PM, wrote: > To me a particle is a set of 8-connected component, with or without hole. It > can have anyshape like this: We also have code in place for doing connected component labelling, if that would help (it's under the morphology sub-module). Unfortunately, the skeletonisation code from Cell Profiler has not been integrated yet (but we'd appreciate a patch!). Regards St?fan From stefan at sun.ac.za Mon Jun 20 10:49:23 2011 From: stefan at sun.ac.za (=?ISO-8859-1?Q?St=E9fan_van_der_Walt?=) Date: Mon, 20 Jun 2011 16:49:23 +0200 Subject: scikits.image sprints at EuroScipy and SciPy 2011 Message-ID: Hi everyone Just a heads-up about two upcoming scikits.image sprints. The first will be at SciPy 2011, held in Austin, Tx from 11 to 16 July. Then, we'll do the same at the EuroSciPy conference from 25 to 28 August in Paris. Thank you to Emmanuelle Guillart for taking care of the arrangements! At EuroSciPy, we'll be in the room next to the scikits.learn guys, so there should be some great cross-pollination and collaboration happening. If you're around, come and join us to finalise the 3.0 release! Here are the important dates again: * SciPy: July 11 - July 16 2011, Austin, Tx * EuroSciPy: August 25 - 28 2011, Paris Regards St?fan From emmanuelle.gouillart at normalesup.org Mon Jun 20 11:22:21 2011 From: emmanuelle.gouillart at normalesup.org (Emmanuelle Gouillart) Date: Mon, 20 Jun 2011 17:22:21 +0200 Subject: scikits.image sprints at EuroScipy and SciPy 2011 In-Reply-To: References: Message-ID: <20110620152221.GB5586@phare.normalesup.org> Hi, about the Euroscipy sprint, it would be possible to have rooms at the Ecole Normale Superieure also on the days before the conference (Tuesday August 23rd and Wednesday 24th, I think the scikits.learn guys plan to work on these two days). If some of you can make it to Paris before the start of the conference, then we'll have more time to work on the scikit. The other possibility is to work in the evening and/or skip lectures, but as an organizer of Euroscipy, this is not an option for me :-). Cheers, Emmanuelle On Mon, Jun 20, 2011 at 04:49:23PM +0200, St??????fan van der Walt wrote: > Hi everyone > Just a heads-up about two upcoming scikits.image sprints. > The first will be at SciPy 2011, held in Austin, Tx from 11 to 16 July. > Then, we'll do the same at the EuroSciPy conference from 25 to 28 > August in Paris. Thank you to Emmanuelle Guillart for taking care of > the arrangements! At EuroSciPy, we'll be in the room next to the > scikits.learn guys, so there should be some great cross-pollination > and collaboration happening. > If you're around, come and join us to finalise the 3.0 release! > Here are the important dates again: > * SciPy: July 11 - July 16 2011, Austin, Tx > * EuroSciPy: August 25 - 28 2011, Paris > Regards > St??????fan From tsyu80 at gmail.com Thu Jun 23 10:45:00 2011 From: tsyu80 at gmail.com (Tony Yu) Date: Thu, 23 Jun 2011 10:45:00 -0400 Subject: Pull request: fix tv denoise Message-ID: A while back, I sent a pull request for a fix to tv_denoise, but I just realized that I never actually emailed the group. The patch is a simple change: the order of arguments passed to a function was reversed. There are couple of other minor changes in addition, as detailed in the pull request: https://github.com/stefanv/scikits.image/pull/25 Best, -Tony -------------- next part -------------- An HTML attachment was scrubbed... URL: From tsyu80 at gmail.com Thu Jun 23 10:58:56 2011 From: tsyu80 at gmail.com (Tony Yu) Date: Thu, 23 Jun 2011 10:58:56 -0400 Subject: Pull request: fix tv denoise In-Reply-To: References: Message-ID: On Thu, Jun 23, 2011 at 10:47 AM, Ma?l Primet wrote: > Why would you do that? People will usually change the weight, not eps, so > it is more natural to set weight as the second argument? The point of the patch isn't to set the order of arguments based on preference, but instead, based on consistency. The other functions (`tv_denoise` and `_tv_denoise_3d`) have `eps` followed by `weight`. Most importantly, the arguments passed to `_tv_denoise_2d` are in this order, so that setting the keyword arg `eps` in `tv_denoise` actually adjusts the `weight` argument of `_tv_denoise_2d` (and vice-versa). (See line 268 in https://github.com/stefanv/scikits.image/blob/master/scikits/image/filter/tv_denoise.py ) -Tony -------------- next part -------------- An HTML attachment was scrubbed... URL: From tsyu80 at gmail.com Thu Jun 23 11:24:24 2011 From: tsyu80 at gmail.com (Tony Yu) Date: Thu, 23 Jun 2011 11:24:24 -0400 Subject: Pull request: fix tv denoise In-Reply-To: References: Message-ID: I'd agree that `weight` is the more natural variable to change (that's actually the parameter I was trying to change when I found this error). I've added this change to a new branch and submitted this as a separate pull request. Others should probably weigh in on the argument order, but both options are available in the pull requests. -Tony On Thu, Jun 23, 2011 at 11:02 AM, Ma?l Primet wrote: > Hum.. then I guess we should rather change the other functions to im, > weight, eps, no? > > it makes more sense to be able to call denoise(image, weight) directly > > On Thu, Jun 23, 2011 at 16:58, Tony Yu wrote: > >> >> >> On Thu, Jun 23, 2011 at 10:47 AM, Ma?l Primet wrote: >> >>> Why would you do that? People will usually change the weight, not eps, so >>> it is more natural to set weight as the second argument? >> >> >> The point of the patch isn't to set the order of arguments based on >> preference, but instead, based on consistency. The other functions >> (`tv_denoise` and `_tv_denoise_3d`) have `eps` followed by `weight`. Most >> importantly, the arguments passed to `_tv_denoise_2d` are in this order, so >> that setting the keyword arg `eps` in `tv_denoise` actually adjusts the >> `weight` argument of `_tv_denoise_2d` (and vice-versa). (See line 268 in >> https://github.com/stefanv/scikits.image/blob/master/scikits/image/filter/tv_denoise.py >> ) >> >> -Tony >> > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From mael.primet at gmail.com Thu Jun 23 10:47:42 2011 From: mael.primet at gmail.com (=?UTF-8?B?TWHDq2wgUHJpbWV0?=) Date: Thu, 23 Jun 2011 16:47:42 +0200 Subject: Pull request: fix tv denoise In-Reply-To: References: Message-ID: Why would you do that? People will usually change the weight, not eps, so it is more natural to set weight as the second argument? -------------- next part -------------- An HTML attachment was scrubbed... URL: From mael.primet at gmail.com Thu Jun 23 11:02:14 2011 From: mael.primet at gmail.com (=?UTF-8?B?TWHDq2wgUHJpbWV0?=) Date: Thu, 23 Jun 2011 17:02:14 +0200 Subject: Pull request: fix tv denoise In-Reply-To: References: Message-ID: Hum.. then I guess we should rather change the other functions to im, weight, eps, no? it makes more sense to be able to call denoise(image, weight) directly On Thu, Jun 23, 2011 at 16:58, Tony Yu wrote: > > > On Thu, Jun 23, 2011 at 10:47 AM, Ma?l Primet wrote: > >> Why would you do that? People will usually change the weight, not eps, so >> it is more natural to set weight as the second argument? > > > The point of the patch isn't to set the order of arguments based on > preference, but instead, based on consistency. The other functions > (`tv_denoise` and `_tv_denoise_3d`) have `eps` followed by `weight`. Most > importantly, the arguments passed to `_tv_denoise_2d` are in this order, so > that setting the keyword arg `eps` in `tv_denoise` actually adjusts the > `weight` argument of `_tv_denoise_2d` (and vice-versa). (See line 268 in > https://github.com/stefanv/scikits.image/blob/master/scikits/image/filter/tv_denoise.py > ) > > -Tony > -------------- next part -------------- An HTML attachment was scrubbed... URL: From stefan at sun.ac.za Thu Jun 23 22:14:50 2011 From: stefan at sun.ac.za (=?ISO-8859-1?Q?St=E9fan_van_der_Walt?=) Date: Fri, 24 Jun 2011 04:14:50 +0200 Subject: Pull request: fix tv denoise In-Reply-To: References: Message-ID: On Jun 23, 2011 6:39 PM, "Tony Yu" wrote: > The point of the patch isn't to set the order of arguments based on preference, but instead, based on consistency. The other functions (`tv_denoise` and `_tv_denoise_3d`) have `eps` followed by `weight`. Most importantly, the arguments passed to `_tv_denoise_2d` are in this order, so that setting the keyword arg `eps` in `tv_denoise` actually adjusts the `weight` argument of `_tv_denoise_2d` (and vice-versa). (See line 268 in https://github.com/stefanv/scikits.image/blob/master/scikits/image/filter/tv_denoise.py ) Thanks for looking at this issue, Tony and Ma?l. I'm currently travelling, but will be able to merge pull requests over the weekend, if you can come to an agreement on the best solution. Thanks St?fan -------------- next part -------------- An HTML attachment was scrubbed... URL: