From witzjean at gmail.com Sat Dec 1 05:34:10 2012 From: witzjean at gmail.com (jeff witz) Date: Sat, 1 Dec 2012 02:34:10 -0800 (PST) Subject: Making algorithms at least 3D, preferably nD In-Reply-To: References: Message-ID: Hello, I think you must all pay attention to standards if you want to act on nD images. For structured data files there is a library that hab been used for decade and which is very efficient, it's netcdf (http://www.unidata.ucar.edu/software/netcdf/), there is already tools in python to deal with it. This library allows one to deal with data in // which is important when one deals with big datas. The last version is based on hdf wich is the tools used on HPC. If your data are not stored in a standard format, the library ITK has provide a binding called SimpleITK that allows one to read every format ITK konws. It is important to take into account the fact that the operation on pixel depend on the grid spacing, as for exampe the finite difference gradient which is wrong when one chooses a step of one because the file as not been read correctly. As the 3D datas often comes from the measurement X-Ray Tomography, MRI, Echography, it is important to consider the device information. The format dicom as been made in this specific purpose there is a python binding called pydicom. I know that scikit team does'nt want to have to much dependances, but for nD case I think it is important to use existing libraries. Best regards Le vendredi 30 novembre 2012 05:45:49 UTC+1, Juan Nunez-Iglesias a ?crit : > > Hey Guys, > > I mentioned this briefly at SciPy, but I would like to reiterate: a lot of > data is 3D images these days, and more and more data is being generated > that is multi-channel, 3D+t. Therefore, it would be awesome if scikit-image > started making more of an effort to support these. In the best case, the > dimension of the underlying array can be abstracted away ? see herefor example, the functions juicy_center (which extracts the centre of an > array, along all dimensions), surfaces (grabs the "border" arrays along > each dimension), hollowed (zeroes-out the centre), and more. Otherwise, > writing a 3D function that gracefully degrades to 2D when one of the > dimensions is 1 is also possible. > > In general, the amount of additional effort to make code 3-, 4- or n- > dimensional is relatively low when you write the algorithm initially, > relative to refactoring a whole bunch of functions later. I'll try to > fiddle with whichever code I need, but in the meantime, what do you think > about adding a paragraph or a sentence about this issue in the scikit-image > contribute section, so > that people at least have this in mind when they are thinking of writing > something new? > > Thanks, > > Juan. > -------------- next part -------------- An HTML attachment was scrubbed... URL: From stefan at sun.ac.za Thu Dec 6 16:06:07 2012 From: stefan at sun.ac.za (=?ISO-8859-1?Q?St=E9fan_van_der_Walt?=) Date: Thu, 6 Dec 2012 13:06:07 -0800 Subject: Hello, everyone In-Reply-To: References: Message-ID: Hi there, On Wed, Dec 5, 2012 at 5:58 PM, Han Cao wrote: > I am new guy to this group. I am a student who want to get some development > experiences to image processing products. So I choose scikit-image. I want > to contribute to this product. > I hope to know is there any products using this library now? Thanks a lot if > anyone answer me? Welcome, I hope you find the project useful! Are you asking about commercial products specifically, or research projects in general? Scikit-image has found all sorts of interesting applications, ranging from astronomy to biology to computer vision. I think it would be a good idea to gather more such "user stories"! St?fan From simonda72819 at gmail.com Fri Dec 7 03:18:39 2012 From: simonda72819 at gmail.com (caohan) Date: Fri, 07 Dec 2012 16:18:39 +0800 Subject: Hello, everyone In-Reply-To: References: Message-ID: <50C1A65F.7050509@gmail.com> On 12/07/2012 05:06 AM, St??????fan van der Walt wrote: > Hi there, > > On Wed, Dec 5, 2012 at 5:58 PM, Han Cao wrote: >> I am new guy to this group. I am a student who want to get some development >> experiences to image processing products. So I choose scikit-image. I want >> to contribute to this product. >> I hope to know is there any products using this library now? Thanks a lot if >> anyone answer me? > Welcome, I hope you find the project useful! > > Are you asking about commercial products specifically, or research > projects in general? Scikit-image has found all sorts of interesting > applications, ranging from astronomy to biology to computer vision. I > think it would be a good idea to gather more such "user stories"! > > St??????fan > Thank you for replying me, I am asking about commercial products, such as Matlab? Hank Cao From steven.silvester at gmail.com Thu Dec 13 22:42:04 2012 From: steven.silvester at gmail.com (Steven Silvester) Date: Thu, 13 Dec 2012 19:42:04 -0800 (PST) Subject: import speedup Message-ID: <72c15392-9d66-4153-9f26-8c7b2b06c6c4@googlegroups.com> Hey all, I noticed that loading skimage seemed to take a bit longer than I'd like, so I profiled it. On my machine, it takes 1.6 seconds to import skimage, 0.4 of which was from numpy, and 1.2 of which was from loading nose in skimage/__init__.py. This simple patch brings my import time down to ~0.4 seconds, since it only imports nose when the test function is called. diff --git a/skimage/__init__.py b/skimage/__init__.py index 1ac121b..f3e5e88 100644 --- a/skimage/__init__.py +++ b/skimage/__init__.py @@ -84,8 +84,9 @@ def _setup_test(verbose=False): return f -test = _setup_test() -test_verbose = _setup_test(verbose=True) +test = lambda : _setup_test()() +test_verbose = lambda : _setup_test(verbose=True)() +test_verbose.__doc__ = test.__doc__ = 'Invoke the skimage test suite.' def get_log(name=None): -------------- next part -------------- An HTML attachment was scrubbed... URL: From silvertrumpet999 at gmail.com Thu Dec 13 23:22:00 2012 From: silvertrumpet999 at gmail.com (Josh Warner) Date: Thu, 13 Dec 2012 20:22:00 -0800 (PST) Subject: Stable vs Dev version, document image enhancement In-Reply-To: References: Message-ID: Hi Parand, Welcome! Most of the gallery examples work in the current release (0.7.2 I believe), but the rank filter is in a PR that was merged recently, and is presently only in the dev version. You may want the functionality in the rank filter for OCR work, where fast local operations like the otsu threshold could be very beneficial. I'll let other people answer the questions about specific references as I'm on the road, but I think most of what you need to do is available in scikit-image. Josh Warner On Wednesday, December 12, 2012 7:00:24 PM UTC-6, Parand Darugar wrote: > > Hello, > > I'm new to scikit-image, having mostly used PIL and imagemagick to date. > Looks very promising, thanks for putting it together. > > A few newbie questions: > > - It seems the examples in the gallery are based on the dev version as > opposed to the stable version? Therefore I assume it's recommended to use > the dev version instead of the "pip install" version? I just tried the > latest from git and am getting some errors (see below) - which version > should I be using? > > - My initial goal is image/document enhancement and cleanup in order to > improve OCR. The images are primarily captured via cell phone cameras and > scanners, so I'm looking to normalize and enhance the color, remove noise, > and straighten them. Any pointers to code, papers, or algorithms that may > be of interest would be appreciated. > > -- Error message -- > >>> import skimage.filter.rank as rank > Traceback (most recent call last): > File "", line 1, in > File "skimage/filter/__init__.py", line 2, in > from .ctmf import median_filter > File "skimage/filter/ctmf.py", line 15, in > from . import _ctmf > ImportError: cannot import name _ctmf > > Much thanks, > > Parand > -------------- next part -------------- An HTML attachment was scrubbed... URL: From silvertrumpet999 at gmail.com Thu Dec 13 23:25:49 2012 From: silvertrumpet999 at gmail.com (Josh Warner) Date: Thu, 13 Dec 2012 20:25:49 -0800 (PST) Subject: import speedup In-Reply-To: <72c15392-9d66-4153-9f26-8c7b2b06c6c4@googlegroups.com> References: <72c15392-9d66-4153-9f26-8c7b2b06c6c4@googlegroups.com> Message-ID: <14a17e6a-3d3f-4865-81e5-d1c2e8b845b9@googlegroups.com> I say toss it in a PR, and assuming the Travis build passes this sounds completely reasonable to me. On Thursday, December 13, 2012 9:42:04 PM UTC-6, Steven Silvester wrote: > > Hey all, I noticed that loading skimage seemed to take a bit longer than > I'd like, so I profiled it. On my machine, it takes 1.6 seconds to import > skimage, 0.4 of which was from numpy, and 1.2 of which was from loading > nose in skimage/__init__.py. This simple patch brings my import time down > to ~0.4 seconds, since it only imports nose when the test function is > called. > > diff --git a/skimage/__init__.py b/skimage/__init__.py > index 1ac121b..f3e5e88 100644 > --- a/skimage/__init__.py > +++ b/skimage/__init__.py > @@ -84,8 +84,9 @@ def _setup_test(verbose=False): > return f > > > -test = _setup_test() > -test_verbose = _setup_test(verbose=True) > +test = lambda : _setup_test()() > +test_verbose = lambda : _setup_test(verbose=True)() > +test_verbose.__doc__ = test.__doc__ = 'Invoke the skimage test suite.' > > > def get_log(name=None): > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From stefan at sun.ac.za Fri Dec 14 00:28:11 2012 From: stefan at sun.ac.za (=?ISO-8859-1?Q?St=E9fan_van_der_Walt?=) Date: Thu, 13 Dec 2012 21:28:11 -0800 Subject: Stable vs Dev version, document image enhancement In-Reply-To: References: Message-ID: On Thu, Dec 13, 2012 at 8:54 PM, Tony Yu wrote: > It might be a good idea for us to point to the stable version instead of the > development version by default. The development gallery is useful as an advertisement, but we could maybe make the link to the other versions clearer? St?fan From tsyu80 at gmail.com Thu Dec 13 22:43:13 2012 From: tsyu80 at gmail.com (Tony Yu) Date: Thu, 13 Dec 2012 22:43:13 -0500 Subject: canvastools subpackage for scikit-image viewer Message-ID: About a month-or-so ago, I promised I would start work on selection tool for the image viewer. I finally got around to it. I ended up doing a pretty significant overhaul, but I think it was worth it. See PR # 390 I'll copy my PR message below, just for completeness: Major overhaul of tools for interacting with the scikit-image viewer. * Add skimage.viewer.canvastools subpackage with line and rectangle selection tools * Refactor line profile plugin to use line tool * Fix viewer canvas * Fix blitting behavior * New plugins (ColorHistogram, Measure, Crop) To get a feel for the changes, see new examples in `viewer_examples/plugins` located in the root directory of package. Cheers, -Tony -------------- next part -------------- An HTML attachment was scrubbed... URL: From tsyu80 at gmail.com Thu Dec 13 23:54:00 2012 From: tsyu80 at gmail.com (Tony Yu) Date: Thu, 13 Dec 2012 23:54:00 -0500 Subject: Stable vs Dev version, document image enhancement In-Reply-To: References: Message-ID: On Thu, Dec 13, 2012 at 11:22 PM, Josh Warner wrote: > Hi Parand, > > Welcome! Most of the gallery examples work in the current release (0.7.2 > I believe), but the rank filter is in a PR that was merged recently, and is > presently only in the dev version. You may want the functionality in the > rank filter for OCR work, where fast local operations like the otsu > threshold could be very beneficial. > > I'll let other people answer the questions about specific references as > I'm on the road, but I think most of what you need to do is available in > scikit-image. > > Josh Warner > Just wanted to add: The documentation for the last release can be found here: http://scikit-image.org/docs/0.7.0/ It might be a good idea for us to point to the stable version instead of the development version by default. On Wednesday, December 12, 2012 7:00:24 PM UTC-6, Parand Darugar wrote: >> >> >> > - My initial goal is image/document enhancement and cleanup in order to >> improve OCR. The images are primarily captured via cell phone cameras and >> scanners, so I'm looking to normalize and enhance the color, remove noise, >> and straighten them. Any pointers to code, papers, or algorithms that may >> be of interest would be appreciated. >> >> -- Error message -- >> >>> import skimage.filter.rank as rank >> Traceback (most recent call last): >> File "", line 1, in >> File "skimage/filter/__init__.py", line 2, in >> from .ctmf import median_filter >> File "skimage/filter/ctmf.py", line 15, in >> from . import _ctmf >> ImportError: cannot import name _ctmf >> > This shouldn't happen. How did you install scikit-image? Are you sure that you built the package after downloading. Cheers, -Tony -------------- next part -------------- An HTML attachment was scrubbed... URL: From steven.silvester at gmail.com Fri Dec 14 11:14:18 2012 From: steven.silvester at gmail.com (Steven Silvester) Date: Fri, 14 Dec 2012 08:14:18 -0800 (PST) Subject: canvastools subpackage for scikit-image viewer In-Reply-To: References: Message-ID: <3d65b13b-c793-4337-a1fa-764e4210b264@googlegroups.com> Tony, I'm going all in on this with you. I have been hacking at matplotlib recently as well, and have demonstrated the following in PySide and PyQt4: - right click menu with grid toggle and colormap selection, and simplified uimenu creation - roi with stats overlay (mean, std, min, max) - cross section slice view - scroll zoom - improved colorbar placement I also wrote a tool in enaml that allows you to pick a skimage package and function from dropdowns. It then displays the docstring and allows you to write the function call inline, and safely evaluates it. Thus far, it has all been proof of concept and for use at work, but I'd like to start integrating these features into your viewer. I will start a repo on my github to demonstrate the features prior to integration. Thoughts? From darugar at gmail.com Fri Dec 14 13:31:27 2012 From: darugar at gmail.com (Parand Darugar) Date: Fri, 14 Dec 2012 10:31:27 -0800 (PST) Subject: Stable vs Dev version, document image enhancement In-Reply-To: References: Message-ID: <66cc4b6d-2942-416a-a37a-d8fa196ce5df@googlegroups.com> Hi Tony, Installation steps: This is on OS X 10.8.2, Python 2.7.2: - I setup a virtualenv and activated that virtual env. - I cloned the scikit-image git repository - I installed: $ python ./setup.py install ... Installed /Users/parand/Projects/Receipts/pyenv/lib/python2.7/site-packages/scikit_image-0.8dev-py2.7-macosx-10.8-intel.egg Processing dependencies for scikit-image==0.8dev Finished processing dependencies for scikit-image==0.8dev $ python Python 2.7.2 (default, Jun 20 2012, 16:23:33) [GCC 4.2.1 Compatible Apple Clang 4.0 (tags/Apple/clang-418.0.60)] on darwin >>> import skimage >>> skimage.__version__ '0.8dev' >>> import skimage.filter.rank as rank Traceback (most recent call last): File "", line 1, in File "skimage/filter/__init__.py", line 2, in from .ctmf import median_filter File "skimage/filter/ctmf.py", line 15, in from . import _ctmf ImportError: cannot import name _ctmf Best, Parand On Thursday, December 13, 2012 8:54:00 PM UTC-8, Tony S Yu wrote: > > On Thu, Dec 13, 2012 at 11:22 PM, Josh Warner > > wrote: > >> Hi Parand, >> >> Welcome! Most of the gallery examples work in the current release (0.7.2 >> I believe), but the rank filter is in a PR that was merged recently, and is >> presently only in the dev version. You may want the functionality in the >> rank filter for OCR work, where fast local operations like the otsu >> threshold could be very beneficial. >> >> I'll let other people answer the questions about specific references as >> I'm on the road, but I think most of what you need to do is available in >> scikit-image. >> >> Josh Warner >> > > Just wanted to add: The documentation for the last release can be found > here: > > http://scikit-image.org/docs/0.7.0/ > > > It might be a good idea for us to point to the stable version instead of > the development version by default. > > > > On Wednesday, December 12, 2012 7:00:24 PM UTC-6, Parand Darugar wrote: >>> >>> >>> > >> - My initial goal is image/document enhancement and cleanup in order to >>> improve OCR. The images are primarily captured via cell phone cameras and >>> scanners, so I'm looking to normalize and enhance the color, remove noise, >>> and straighten them. Any pointers to code, papers, or algorithms that may >>> be of interest would be appreciated. >>> >>> -- Error message -- >>> >>> import skimage.filter.rank as rank >>> Traceback (most recent call last): >>> File "", line 1, in >>> File "skimage/filter/__init__.py", line 2, in >>> from .ctmf import median_filter >>> File "skimage/filter/ctmf.py", line 15, in >>> from . import _ctmf >>> ImportError: cannot import name _ctmf >>> >> > This shouldn't happen. How did you install scikit-image? Are you sure that > you built the package after downloading. > > Cheers, > -Tony > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From steven.silvester at gmail.com Fri Dec 14 14:11:39 2012 From: steven.silvester at gmail.com (Steven Silvester) Date: Fri, 14 Dec 2012 11:11:39 -0800 (PST) Subject: canvastools subpackage for scikit-image viewer In-Reply-To: References: <3d65b13b-c793-4337-a1fa-764e4210b264@googlegroups.com> Message-ID: Great, I'll dig into your PR this weekend. I was thinking that each plugin could be registered as a dock window, and be switchable via a View menu. From tsyu80 at gmail.com Fri Dec 14 11:37:17 2012 From: tsyu80 at gmail.com (Tony Yu) Date: Fri, 14 Dec 2012 11:37:17 -0500 Subject: canvastools subpackage for scikit-image viewer In-Reply-To: <3d65b13b-c793-4337-a1fa-764e4210b264@googlegroups.com> References: <3d65b13b-c793-4337-a1fa-764e4210b264@googlegroups.com> Message-ID: On Fri, Dec 14, 2012 at 11:14 AM, Steven Silvester < steven.silvester at gmail.com> wrote: > Tony, > > I'm going all in on this with you. I have been hacking at matplotlib > recently as well, and have demonstrated the following in PySide and PyQt4: > - right click menu with grid toggle and colormap selection, and simplified > uimenu creation > - roi with stats overlay (mean, std, min, max) > - cross section slice view > - scroll zoom > - improved colorbar placement > > I also wrote a tool in enaml that allows you to pick a skimage package and > function from dropdowns. It then displays the docstring and allows you to > write the function call inline, and safely evaluates it. > > Thus far, it has all been proof of concept and for use at work, but I'd > like to start integrating these features into your viewer. > > I will start a repo on my github to demonstrate the features prior to > integration. > > Thoughts? > > -- > Hey Steven, That sounds fantastic! I've tried to make a pretty solid API for the viewer, but since I'm the only one playing with this code (as far as I know), it's tough to know whether any of the infrastructure makes sense. It'd be great to have someone else around to kick the tires and tell me what I did wrong. As far as your suggestions, they all sound great. The "cross section slice view", however, sounds similar to the lineprofile pluginthat Guillaume Gay wrote, so you may want to check that out first. I've been wanting to add some sort of menu interface to access the plugins, so it'd be great if you already have something. Also, I think the ROI stats viewer would be a pretty good example of the RectangleTool added in this PR. I'm looking forward to seeing some more PRs from you :) Best, -Tony -------------- next part -------------- An HTML attachment was scrubbed... URL: From hannesschoenberger at gmail.com Fri Dec 14 08:26:12 2012 From: hannesschoenberger at gmail.com (=?iso-8859-1?Q?Sch=F6nberger_Johannes?=) Date: Fri, 14 Dec 2012 14:26:12 +0100 Subject: Stable vs Dev version, document image enhancement In-Reply-To: References: Message-ID: <02582B6B-4C51-4153-894D-7E7B64DAB5ED@gmail.com> Maybe the "Gallery" link in the navigation should point to the dev gallery and the "Documentation" link to the stable docs? From tsyu80 at gmail.com Fri Dec 14 14:37:32 2012 From: tsyu80 at gmail.com (Tony Yu) Date: Fri, 14 Dec 2012 14:37:32 -0500 Subject: Stable vs Dev version, document image enhancement In-Reply-To: <66cc4b6d-2942-416a-a37a-d8fa196ce5df@googlegroups.com> References: <66cc4b6d-2942-416a-a37a-d8fa196ce5df@googlegroups.com> Message-ID: On Fri, Dec 14, 2012 at 1:31 PM, Parand Darugar wrote: > Hi Tony, > > Installation steps: > > This is on OS X 10.8.2, Python 2.7.2: > > - I setup a virtualenv and activated that virtual env. > - I cloned the scikit-image git repository > - I installed: > > $ python ./setup.py install > ... > Installed > /Users/parand/Projects/Receipts/pyenv/lib/python2.7/site-packages/scikit_image-0.8dev-py2.7-macosx-10.8-intel.egg > Processing dependencies for scikit-image==0.8dev > Finished processing dependencies for scikit-image==0.8dev > > $ python > Python 2.7.2 (default, Jun 20 2012, 16:23:33) > [GCC 4.2.1 Compatible Apple Clang 4.0 (tags/Apple/clang-418.0.60)] on > darwin > >>> import skimage > >>> skimage.__version__ > '0.8dev' > >>> import skimage.filter.rank as rank > Traceback (most recent call last): > File "", line 1, in > File "skimage/filter/__init__.py", line 2, in > from .ctmf import median_filter > File "skimage/filter/ctmf.py", line 15, in > from . import _ctmf > ImportError: cannot import name _ctmf > > Best, > > Parand > Hi Parand, If those commands are exactly as you copied them above, it looks like you're running the python interpreter from within the root scikit-image directory. Since python prepends the path of the working directory to the python path, you're actually importing the skimage package from that directory---not the one you just installed (i.e. the one in site-packages). You can check which you're running with: python -c 'import skimage; print skimage.__file__' If you move up one directory and then start the python interpreter, does the rank import work? Best, -Tony -------------- next part -------------- An HTML attachment was scrubbed... URL: From hannesschoenberger at gmail.com Fri Dec 14 08:37:43 2012 From: hannesschoenberger at gmail.com (=?windows-1252?Q?Sch=F6nberger_Johannes?=) Date: Fri, 14 Dec 2012 14:37:43 +0100 Subject: import speedup In-Reply-To: <72c15392-9d66-4153-9f26-8c7b2b06c6c4@googlegroups.com> References: <72c15392-9d66-4153-9f26-8c7b2b06c6c4@googlegroups.com> Message-ID: <4063C67F-BC23-4794-818B-29EC977C47F3@gmail.com> Good catch! Another approach would be to rewrite and rename `_setup_test` to `test` and either delete the 'test_verbose' function or write it as `test_verbose = functools.partial(test, verbose=True)` to ged rid of the rather complex setup/lambda routine. Would you add a PR for this, please? I could do it as well, if you don't want? Johannes Sch?nberger Am 14.12.2012 um 04:42 schrieb Steven Silvester : > Hey all, I noticed that loading skimage seemed to take a bit longer than I'd like, so I profiled it. On my machine, it takes 1.6 seconds to import skimage, 0.4 of which was from numpy, and 1.2 of which was from loading nose in skimage/__init__.py. This simple patch brings my import time down to ~0.4 seconds, since it only imports nose when the test function is called. > > diff --git a/skimage/__init__.py b/skimage/__init__.py > index 1ac121b..f3e5e88 100644 > --- a/skimage/__init__.py > +++ b/skimage/__init__.py > @@ -84,8 +84,9 @@ def _setup_test(verbose=False): > return f > > > -test = _setup_test() > -test_verbose = _setup_test(verbose=True) > +test = lambda : _setup_test()() > +test_verbose = lambda : _setup_test(verbose=True)() > +test_verbose.__doc__ = test.__doc__ = 'Invoke the skimage test suite.' > > > def get_log(name=None): > > > -- > > From darugar at gmail.com Sat Dec 15 01:18:54 2012 From: darugar at gmail.com (Parand Darugar) Date: Fri, 14 Dec 2012 22:18:54 -0800 (PST) Subject: Stable vs Dev version, document image enhancement In-Reply-To: References: <66cc4b6d-2942-416a-a37a-d8fa196ce5df@googlegroups.com> Message-ID: Hi Tony, You're absolutely right, that was the issue. Thanks very much. Now to learn how to use scikit-image :-) Best, Parand On Friday, December 14, 2012 11:37:32 AM UTC-8, Tony S Yu wrote: > > > > On Fri, Dec 14, 2012 at 1:31 PM, Parand Darugar > > wrote: > >> Hi Tony, >> >> Installation steps: >> >> This is on OS X 10.8.2, Python 2.7.2: >> >> - I setup a virtualenv and activated that virtual env. >> - I cloned the scikit-image git repository >> - I installed: >> >> $ python ./setup.py install >> ... >> Installed >> /Users/parand/Projects/Receipts/pyenv/lib/python2.7/site-packages/scikit_image-0.8dev-py2.7-macosx-10.8-intel.egg >> Processing dependencies for scikit-image==0.8dev >> Finished processing dependencies for scikit-image==0.8dev >> >> $ python >> Python 2.7.2 (default, Jun 20 2012, 16:23:33) >> [GCC 4.2.1 Compatible Apple Clang 4.0 (tags/Apple/clang-418.0.60)] on >> darwin >> >>> import skimage >> >>> skimage.__version__ >> '0.8dev' >> >>> import skimage.filter.rank as rank >> Traceback (most recent call last): >> File "", line 1, in >> File "skimage/filter/__init__.py", line 2, in >> from .ctmf import median_filter >> File "skimage/filter/ctmf.py", line 15, in >> from . import _ctmf >> ImportError: cannot import name _ctmf >> >> Best, >> >> Parand >> > > Hi Parand, > > If those commands are exactly as you copied them above, it looks like > you're running the python interpreter from within the root scikit-image > directory. Since python prepends the path of the working directory to the > python path, you're actually importing the skimage package from that > directory---not the one you just installed (i.e. the one in site-packages). > You can check which you're running with: > > python -c 'import skimage; print skimage.__file__' > > If you move up one directory and then start the python interpreter, does > the rank import work? > > Best, > -Tony > -------------- next part -------------- An HTML attachment was scrubbed... URL: From dkin at walla.co.il Sat Dec 15 13:58:27 2012 From: dkin at walla.co.il (Dan) Date: Sat, 15 Dec 2012 10:58:27 -0800 (PST) Subject: Segmentation and Granulometry with scikit-image In-Reply-To: References: <4c817a46-75de-4ee7-b58e-1ddb08228126@googlegroups.com> Message-ID: <2d1ccb5f-88cc-4275-8cc8-ac322b7b63b6@googlegroups.com> Dear Tony, Thanks for the script. I was running the script and I got this error: Traceback (most recent call last): File "C:/Users/DK/PProjects/skimage_seg/scikit_seg.py", line 18, in img_background = morph.reconstruction(img-h, img) AttributeError: 'module' object has no attribute 'reconstruction' Process finished with exit code 1 Any reason why? Thanks a lot, Dan El lunes, 24 de septiembre de 2012 18:58:19 UTC-4, Tony S Yu escribi?: > > > > On Fri, Sep 21, 2012 at 8:46 PM, St?fan van der Walt > > wrote: > >> On Wed, Sep 19, 2012 at 4:01 AM, ashz > >> wrote: >> >> > Granulometry of Snowflakes: >> > >> http://www.mathworks.com/products/image/examples.html?file=/products/demos/shipping/images/ipexsnow.html >> >> Tony, do you think the morphological reconstruction would work for >> this? > > > Yes and no. Morphological reconstruction (specifically, h-dome, a.k.a. > h-maxima or regional max) tries to enhance features (maxima) based on the > local region. So the h-dome of a dim snowflake and bright snowflake will > look similar if they have a similar peakiness. In the original example, dim > peaks are still much dimmer than the bright peaks, even after the adaptive > histogram equalization. > > Also, the h-dome of an image will tend to remove the corona-like blurring > around the larger snowflakes since the middle is so much brighter than the > surrounding region. I've attached an image of the results, along with the > code to generate it (although you can't run it without the snowflakes > image, which I probably shouldn't email). You'll notice that dim peaks are > much brighter than in the example, and the large snowflakes are smaller > (because of suppression of the corona region). These differences alter the > intensity curve quite a bit (I'm not sure what the "right" output is, > though). > > >> Otherwise perhaps one of the segmentation algorithms. >> Translating the example line-by-line is pretty easy, except that we do >> not have adaptive histogram equalization implemented yet. >> > > BTW, there's a pending PR to add adaptive histogram equalization. > (Although, I'm not sure how I feel about the large header file required for > that PR.) > > As for the original post about these Matlab examples: Thanks for bringing > this up, ashz! These are exactly the type of examples I'd like to see in > the user guide: Something that takes the user all the way from image > loading to data extraction. We'd probably want to write our own instead of > simply translating the Matlab examples. It'd be great if people on this > list could provide examples from their own research. > > Best, > -Tony > > > [image: Inline image 1] > > # Code to generate image above > # Note: this won't run without image from Matlab install: > # toolbox/images/imdemos/snowflakes.png > > > from skimage import io > from skimage import img_as_float > import skimage.morphology as morph > from skimage import exposure > from scipy import ndimage > > > # snowflake image from a Matlab install > img = io.imread('snowflakes.png') > # convert from uint8 to float since we'll be subtracting (prevent > underflow) > orig = img_as_float(img) > > img = exposure.equalize(img) > img = ndimage.gaussian_filter(img, 1) > > # look for regional maxima greater than surrounding regions by h > h = 0.2 > img_background = morph.reconstruction(img-h, img) > img_hdome = img - img_background > img = exposure.rescale_intensity(img_hdome) > > io.imshow(img) > # io.imsave('snowflakes_enhanced.png', img) > io.show() > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From dkin at walla.co.il Sat Dec 15 18:45:29 2012 From: dkin at walla.co.il (Dan) Date: Sat, 15 Dec 2012 15:45:29 -0800 (PST) Subject: Segmentation and Granulometry with scikit-image In-Reply-To: References: <4c817a46-75de-4ee7-b58e-1ddb08228126@googlegroups.com> <2d1ccb5f-88cc-4275-8cc8-ac322b7b63b6@googlegroups.com> Message-ID: Hi, Thanks for the rapid respnse, I am using 0.7.2 on windows. The error is now: Traceback (most recent call last): File "C:/Users/DK/PProjects/skimage_seg/scikit_seg.py", line 3, in import skimage.morphology as morph File "C:\Python27\lib\site-packages\skimage\morphology\__init__.py", line 7, in from ._skeletonize import skeletonize, medial_axis ImportError: cannot import name skeletonize Any idea why?. Thanks El s?bado, 15 de diciembre de 2012 16:24:31 UTC-5, Tony S Yu escribi?: > > On Sat, Dec 15, 2012 at 1:58 PM, Dan >wrote: > >> Dear Tony, >> >> Thanks for the script. >> >> I was running the script and I got this error: >> Traceback (most recent call last): >> File "C:/Users/DK/PProjects/skimage_seg/scikit_seg.py", line 18, in >> >> img_background = morph.reconstruction(img-h, img) >> AttributeError: 'module' object has no attribute 'reconstruction' >> >> Process finished with exit code 1 >> >> Any reason why? >> >> Thanks a lot, >> Dan >> > > Hi Dan, > > Which version of scikit-image are you running? You'll need at least 0.7 > (the latest stable release). You can check the version with the following > shell command: > > $ python -c "import skimage; print skimage.__version__" > > -Tony > > El lunes, 24 de septiembre de 2012 18:58:19 UTC-4, Tony S Yu escribi?: >>> >>> >>> >>> On Fri, Sep 21, 2012 at 8:46 PM, St?fan van der Walt wrote: >>> >>> On Wed, Sep 19, 2012 at 4:01 AM, ashz wrote: >>>> >>>> > Granulometry of Snowflakes: >>>> > http://www.mathworks.com/**products/image/examples.html?** >>>> file=/products/demos/shipping/**images/ipexsnow.html >>>> >>>> Tony, do you think the morphological reconstruction would work for >>>> this? >>> >>> >>> Yes and no. Morphological reconstruction (specifically, h-dome, a.k.a. >>> h-maxima or regional max) tries to enhance features (maxima) based on the >>> local region. So the h-dome of a dim snowflake and bright snowflake will >>> look similar if they have a similar peakiness. In the original example, dim >>> peaks are still much dimmer than the bright peaks, even after the adaptive >>> histogram equalization. >>> >>> Also, the h-dome of an image will tend to remove the corona-like >>> blurring around the larger snowflakes since the middle is so much brighter >>> than the surrounding region. I've attached an image of the results, along >>> with the code to generate it (although you can't run it without the >>> snowflakes image, which I probably shouldn't email). You'll notice that dim >>> peaks are much brighter than in the example, and the large snowflakes are >>> smaller (because of suppression of the corona region). These differences >>> alter the intensity curve quite a bit (I'm not sure what the "right" output >>> is, though). >>> >>> >>>> Otherwise perhaps one of the segmentation algorithms. >>>> Translating the example line-by-line is pretty easy, except that we do >>>> not have adaptive histogram equalization implemented yet. >>>> >>> >>> BTW, there's a pending PR to add adaptive histogram equalization. >>> (Although, I'm not sure how I feel about the large header file required for >>> that PR.) >>> >>> As for the original post about these Matlab examples: Thanks for >>> bringing this up, ashz! These are exactly the type of examples I'd like to >>> see in the user guide: Something that takes the user all the way from image >>> loading to data extraction. We'd probably want to write our own instead of >>> simply translating the Matlab examples. It'd be great if people on this >>> list could provide examples from their own research. >>> >>> Best, >>> -Tony >>> >>> >>> [image: Inline image 1] >>> >>> # Code to generate image above >>> # Note: this won't run without image from Matlab install: >>> # toolbox/images/imdemos/**snowflakes.png >>> >>> >>> from skimage import io >>> from skimage import img_as_float >>> import skimage.morphology as morph >>> from skimage import exposure >>> from scipy import ndimage >>> >>> >>> # snowflake image from a Matlab install >>> img = io.imread('snowflakes.png') >>> # convert from uint8 to float since we'll be subtracting (prevent >>> underflow) >>> orig = img_as_float(img) >>> >>> img = exposure.equalize(img) >>> img = ndimage.gaussian_filter(img, 1) >>> >>> # look for regional maxima greater than surrounding regions by h >>> h = 0.2 >>> img_background = morph.reconstruction(img-h, img) >>> img_hdome = img - img_background >>> img = exposure.rescale_intensity(**img_hdome) >>> >>> io.imshow(img) >>> # io.imsave('snowflakes_**enhanced.png', img) >>> io.show() >>> >>> >>> >>> -- >> >> >> > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From tsyu80 at gmail.com Sat Dec 15 16:24:31 2012 From: tsyu80 at gmail.com (Tony Yu) Date: Sat, 15 Dec 2012 16:24:31 -0500 Subject: Segmentation and Granulometry with scikit-image In-Reply-To: <2d1ccb5f-88cc-4275-8cc8-ac322b7b63b6@googlegroups.com> References: <4c817a46-75de-4ee7-b58e-1ddb08228126@googlegroups.com> <2d1ccb5f-88cc-4275-8cc8-ac322b7b63b6@googlegroups.com> Message-ID: On Sat, Dec 15, 2012 at 1:58 PM, Dan wrote: > Dear Tony, > > Thanks for the script. > > I was running the script and I got this error: > Traceback (most recent call last): > File "C:/Users/DK/PProjects/skimage_seg/scikit_seg.py", line 18, in > > img_background = morph.reconstruction(img-h, img) > AttributeError: 'module' object has no attribute 'reconstruction' > > Process finished with exit code 1 > > Any reason why? > > Thanks a lot, > Dan > Hi Dan, Which version of scikit-image are you running? You'll need at least 0.7 (the latest stable release). You can check the version with the following shell command: $ python -c "import skimage; print skimage.__version__" -Tony El lunes, 24 de septiembre de 2012 18:58:19 UTC-4, Tony S Yu escribi?: >> >> >> >> On Fri, Sep 21, 2012 at 8:46 PM, St?fan van der Walt wrote: >> >> On Wed, Sep 19, 2012 at 4:01 AM, ashz wrote: >>> >>> > Granulometry of Snowflakes: >>> > http://www.mathworks.com/**products/image/examples.html?** >>> file=/products/demos/shipping/**images/ipexsnow.html >>> >>> Tony, do you think the morphological reconstruction would work for >>> this? >> >> >> Yes and no. Morphological reconstruction (specifically, h-dome, a.k.a. >> h-maxima or regional max) tries to enhance features (maxima) based on the >> local region. So the h-dome of a dim snowflake and bright snowflake will >> look similar if they have a similar peakiness. In the original example, dim >> peaks are still much dimmer than the bright peaks, even after the adaptive >> histogram equalization. >> >> Also, the h-dome of an image will tend to remove the corona-like blurring >> around the larger snowflakes since the middle is so much brighter than the >> surrounding region. I've attached an image of the results, along with the >> code to generate it (although you can't run it without the snowflakes >> image, which I probably shouldn't email). You'll notice that dim peaks are >> much brighter than in the example, and the large snowflakes are smaller >> (because of suppression of the corona region). These differences alter the >> intensity curve quite a bit (I'm not sure what the "right" output is, >> though). >> >> >>> Otherwise perhaps one of the segmentation algorithms. >>> Translating the example line-by-line is pretty easy, except that we do >>> not have adaptive histogram equalization implemented yet. >>> >> >> BTW, there's a pending PR to add adaptive histogram equalization. >> (Although, I'm not sure how I feel about the large header file required for >> that PR.) >> >> As for the original post about these Matlab examples: Thanks for bringing >> this up, ashz! These are exactly the type of examples I'd like to see in >> the user guide: Something that takes the user all the way from image >> loading to data extraction. We'd probably want to write our own instead of >> simply translating the Matlab examples. It'd be great if people on this >> list could provide examples from their own research. >> >> Best, >> -Tony >> >> >> [image: Inline image 1] >> >> # Code to generate image above >> # Note: this won't run without image from Matlab install: >> # toolbox/images/imdemos/**snowflakes.png >> >> >> from skimage import io >> from skimage import img_as_float >> import skimage.morphology as morph >> from skimage import exposure >> from scipy import ndimage >> >> >> # snowflake image from a Matlab install >> img = io.imread('snowflakes.png') >> # convert from uint8 to float since we'll be subtracting (prevent >> underflow) >> orig = img_as_float(img) >> >> img = exposure.equalize(img) >> img = ndimage.gaussian_filter(img, 1) >> >> # look for regional maxima greater than surrounding regions by h >> h = 0.2 >> img_background = morph.reconstruction(img-h, img) >> img_hdome = img - img_background >> img = exposure.rescale_intensity(**img_hdome) >> >> io.imshow(img) >> # io.imsave('snowflakes_**enhanced.png', img) >> io.show() >> >> >> >> -- > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From dkin at walla.co.il Sun Dec 16 03:57:48 2012 From: dkin at walla.co.il (Dan) Date: Sun, 16 Dec 2012 00:57:48 -0800 (PST) Subject: High order statistics/Gary level runlength matrices statistics In-Reply-To: References: Message-ID: Is this interesting option going to be implmented in the future release? El mi?rcoles, 28 de noviembre de 2012 05:21:35 UTC-5, Dan escribi?: > > Dear all, > > Is Scikit-image able to provide High order statistics/Gary level runlength > matrices statistics values(e.g., Short Run Emphasis, Long Run Emphasis, > Gray-Level Nonuniformity, Run Length Nonuniformity, Run Percentage, etc)?. > > Is there a way to calculate it using Scikit-image? > > Thanks a lot in advance. -------------- next part -------------- An HTML attachment was scrubbed... URL: From dkin at walla.co.il Sun Dec 16 10:36:13 2012 From: dkin at walla.co.il (Dan) Date: Sun, 16 Dec 2012 07:36:13 -0800 (PST) Subject: Segmentation and Granulometry with scikit-image In-Reply-To: References: <4c817a46-75de-4ee7-b58e-1ddb08228126@googlegroups.com> <2d1ccb5f-88cc-4275-8cc8-ac322b7b63b6@googlegroups.com> Message-ID: Hi, The output: Python 2.7.3 (default, Apr 10 2012, 23:31:26) [MSC v.1500 32 bit (Intel)] on win32 Type "copyright", "credits" or "license()" for more information. >>> import skimage >>> print skimage.__version__ 0.7.2 >>> print skimage.__file__ C:\Python27\lib\site-packages\skimage\__init__.pyc >>> Thanks El domingo, 16 de diciembre de 2012 09:41:35 UTC-5, Tony S Yu escribi?: > > On Sat, Dec 15, 2012 at 6:45 PM, Dan >wrote: > >> Hi, >> >> Thanks for the rapid respnse, I am using 0.7.2 on windows. >> >> The error is now: >> >> Traceback (most recent call last): >> File "C:/Users/DK/PProjects/skimage_seg/scikit_seg.py", line 3, in >> >> import skimage.morphology as morph >> File "C:\Python27\lib\site-packages\skimage\morphology\__init__.py", >> line 7, in >> from ._skeletonize import skeletonize, medial_axis >> ImportError: cannot import name skeletonize >> >> Any idea why?. >> >> Thanks >> > > > Hi Dan, > > How did you install scikit-image? Also, what's the output of the following? > > > import skimage > print skimage.__version__ > print skimage.__file__ > > > -Tony > > > >> El s?bado, 15 de diciembre de 2012 16:24:31 UTC-5, Tony S Yu escribi?: >> >>> On Sat, Dec 15, 2012 at 1:58 PM, Dan wrote: >>> >>>> Dear Tony, >>>> >>>> Thanks for the script. >>>> >>>> I was running the script and I got this error: >>>> Traceback (most recent call last): >>>> File "C:/Users/DK/PProjects/**skimage_seg/scikit_seg.py", line 18, >>>> in >>>> img_background = morph.reconstruction(img-h, img) >>>> AttributeError: 'module' object has no attribute 'reconstruction' >>>> >>>> Process finished with exit code 1 >>>> >>>> Any reason why? >>>> >>>> Thanks a lot, >>>> Dan >>>> >>> >>> Hi Dan, >>> >>> Which version of scikit-image are you running? You'll need at least 0.7 >>> (the latest stable release). You can check the version with the following >>> shell command: >>> >>> $ python -c "import skimage; print skimage.__version__" >>> >>> -Tony >>> >> -------------- next part -------------- An HTML attachment was scrubbed... URL: From dkin at walla.co.il Sun Dec 16 10:41:43 2012 From: dkin at walla.co.il (Dan) Date: Sun, 16 Dec 2012 07:41:43 -0800 (PST) Subject: Segmentation and Granulometry with scikit-image In-Reply-To: References: <4c817a46-75de-4ee7-b58e-1ddb08228126@googlegroups.com> <2d1ccb5f-88cc-4275-8cc8-ac322b7b63b6@googlegroups.com> Message-ID: Hi, I installed Windows binaries (kindly provided by Christoph Gohlke)- file name:scikit-image-0.7.2.win32-py2.7.?exe Thanks El domingo, 16 de diciembre de 2012 10:36:13 UTC-5, Dan escribi?: > > Hi, > > The output: > Python 2.7.3 (default, Apr 10 2012, 23:31:26) [MSC v.1500 32 bit (Intel)] > on win32 > Type "copyright", "credits" or "license()" for more information. > >>> import skimage > >>> print skimage.__version__ > 0.7.2 > >>> print skimage.__file__ > C:\Python27\lib\site-packages\skimage\__init__.pyc > >>> > > Thanks > > El domingo, 16 de diciembre de 2012 09:41:35 UTC-5, Tony S Yu escribi?: >> >> On Sat, Dec 15, 2012 at 6:45 PM, Dan wrote: >> >>> Hi, >>> >>> Thanks for the rapid respnse, I am using 0.7.2 on windows. >>> >>> The error is now: >>> >>> Traceback (most recent call last): >>> File "C:/Users/DK/PProjects/skimage_seg/scikit_seg.py", line 3, in >>> >>> import skimage.morphology as morph >>> File "C:\Python27\lib\site-packages\skimage\morphology\__init__.py", >>> line 7, in >>> from ._skeletonize import skeletonize, medial_axis >>> ImportError: cannot import name skeletonize >>> >>> Any idea why?. >>> >>> Thanks >>> >> >> >> Hi Dan, >> >> How did you install scikit-image? Also, what's the output of the >> following? >> >> >> import skimage >> print skimage.__version__ >> print skimage.__file__ >> >> >> -Tony >> >> >> >>> El s?bado, 15 de diciembre de 2012 16:24:31 UTC-5, Tony S Yu escribi?: >>> >>>> On Sat, Dec 15, 2012 at 1:58 PM, Dan wrote: >>>> >>>>> Dear Tony, >>>>> >>>>> Thanks for the script. >>>>> >>>>> I was running the script and I got this error: >>>>> Traceback (most recent call last): >>>>> File "C:/Users/DK/PProjects/**skimage_seg/scikit_seg.py", line 18, >>>>> in >>>>> img_background = morph.reconstruction(img-h, img) >>>>> AttributeError: 'module' object has no attribute 'reconstruction' >>>>> >>>>> Process finished with exit code 1 >>>>> >>>>> Any reason why? >>>>> >>>>> Thanks a lot, >>>>> Dan >>>>> >>>> >>>> Hi Dan, >>>> >>>> Which version of scikit-image are you running? You'll need at least 0.7 >>>> (the latest stable release). You can check the version with the following >>>> shell command: >>>> >>>> $ python -c "import skimage; print skimage.__version__" >>>> >>>> -Tony >>>> >>> -------------- next part -------------- An HTML attachment was scrubbed... URL: From tsyu80 at gmail.com Sun Dec 16 09:41:35 2012 From: tsyu80 at gmail.com (Tony Yu) Date: Sun, 16 Dec 2012 09:41:35 -0500 Subject: Segmentation and Granulometry with scikit-image In-Reply-To: References: <4c817a46-75de-4ee7-b58e-1ddb08228126@googlegroups.com> <2d1ccb5f-88cc-4275-8cc8-ac322b7b63b6@googlegroups.com> Message-ID: On Sat, Dec 15, 2012 at 6:45 PM, Dan wrote: > Hi, > > Thanks for the rapid respnse, I am using 0.7.2 on windows. > > The error is now: > > Traceback (most recent call last): > File "C:/Users/DK/PProjects/skimage_seg/scikit_seg.py", line 3, in > > import skimage.morphology as morph > File "C:\Python27\lib\site-packages\skimage\morphology\__init__.py", > line 7, in > from ._skeletonize import skeletonize, medial_axis > ImportError: cannot import name skeletonize > > Any idea why?. > > Thanks > Hi Dan, How did you install scikit-image? Also, what's the output of the following? import skimage print skimage.__version__ print skimage.__file__ -Tony > El s?bado, 15 de diciembre de 2012 16:24:31 UTC-5, Tony S Yu escribi?: > >> On Sat, Dec 15, 2012 at 1:58 PM, Dan wrote: >> >>> Dear Tony, >>> >>> Thanks for the script. >>> >>> I was running the script and I got this error: >>> Traceback (most recent call last): >>> File "C:/Users/DK/PProjects/**skimage_seg/scikit_seg.py", line 18, in >>> >>> img_background = morph.reconstruction(img-h, img) >>> AttributeError: 'module' object has no attribute 'reconstruction' >>> >>> Process finished with exit code 1 >>> >>> Any reason why? >>> >>> Thanks a lot, >>> Dan >>> >> >> Hi Dan, >> >> Which version of scikit-image are you running? You'll need at least 0.7 >> (the latest stable release). You can check the version with the following >> shell command: >> >> $ python -c "import skimage; print skimage.__version__" >> >> -Tony >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From darugar at gmail.com Sun Dec 16 19:09:47 2012 From: darugar at gmail.com (Parand Darugar) Date: Sun, 16 Dec 2012 16:09:47 -0800 (PST) Subject: Filter out large segments Message-ID: <4ab38a9b-8fa3-437f-a199-d79d457e2301@googlegroups.com> Hello, Not sure if it's appropriate to ask algorithm questions on this mailing list, please let me know if it's not. I'd like to filter out large contiguous regions out of my image - I only care about smaller items. Following the Image Segmentation example/tutorial, I'm able to find and label the large segments using an Otsu threshold and ndimage.label. Now I'd like to replace these large segments with "white", where "white" is the max value find in my grayscale image (basically I'd like to blank them out). I'm not quite following how this is done in the tutorial: >>> label_objects, nb_labels = ndimage.label(fill_coins) >>> sizes = np.bincount(label_objects.ravel()) >>> mask_sizes = sizes > 20 >>> mask_sizes[0] = 0 >>> coins_cleaned = mask_sizes[label_objects] How does the coins_cleaned = mask_sizes[label_objects] line clean the image? Generally speaking, given the labeled segments (label_objects from the tutorial), how would I apply operations to the original image - for example: set all of the pixels in "image" that are parts of objects labeled 3 and 9 to 0.577 . Also, how do I get smarter about how the system works so I don't ask elementary questions? Is there a good high level tutorial that'll familiarize me with the computation model for skimage / ndimage ? Best, Parand -------------- next part -------------- An HTML attachment was scrubbed... URL: From tsyu80 at gmail.com Sun Dec 16 21:46:08 2012 From: tsyu80 at gmail.com (Tony Yu) Date: Sun, 16 Dec 2012 21:46:08 -0500 Subject: Filter out large segments In-Reply-To: <4ab38a9b-8fa3-437f-a199-d79d457e2301@googlegroups.com> References: <4ab38a9b-8fa3-437f-a199-d79d457e2301@googlegroups.com> Message-ID: Hi again, On Sun, Dec 16, 2012 at 7:09 PM, Parand Darugar wrote: > Hello, > > Not sure if it's appropriate to ask algorithm questions on this mailing > list, please let me know if it's not. > Algorithm questions are definitely welcome. > I'd like to filter out large contiguous regions out of my image - I only > care about smaller items. Following the Image Segmentation > example/tutorial, I'm able to find and label the large segments using an > Otsu threshold and ndimage.label. > > Now I'd like to replace these large segments with "white", where "white" > is the max value find in my grayscale image (basically I'd like to blank > them out). > > I'm not quite following how this is done in the tutorial: > > >>> label_objects, nb_labels = ndimage.label(fill_coins) > >>> sizes = np.bincount(label_objects.ravel()) > >>> mask_sizes = sizes > 20 > >>> mask_sizes[0] = 0 > >>> coins_cleaned = mask_sizes[label_objects] > > How does the coins_cleaned = mask_sizes[label_objects] line clean the > image? > In case you didn't follow the `bincount` part: The `sizes` array is a count of frequency of each label; so large labeled regions would have a large size. The index is matched to the integer label: the count for label `i` is stored in `sizes[i]`. `mask_sizes` just looks for all labeled region larger than 20 pixels and stores a boolean array (i.e. mask). So if the region labeled `i` has more than 20 pixels then `mask_sizes[i]` is True. Also, `i = 0` values are set to 0 because `i = 0` is reserved as the background label. Based on your question, you probably understood all that, but I just wanted to make sure we're on the same page. Now, the line that you actually asked about is a bit of a numpy trick: It uses `label_objects` to pick values from `mask_sizes`. A pixel labeled `i` (in `label_objects`) will grab the value in `mask_sizes[i]` (i.e. True or False); that value will then get placed in the output array at the same array position as the pixel in `label_objects`. That explanation was a bit confusing. Perhaps a short example will help: >>> import numpy as np >>> values = np.array([0, 0, 0, 1]) # stand-in for `mask_sizes` >>> picker = np.array([[0, 1, 2, 3], ... [3, 0, 1, 2], ... [2, 3, 0, 1], ... [1, 2, 3, 0]]) # stand-in for `label_objects` >>> print values[picker] [[0 0 0 1] [1 0 0 0] [0 1 0 0] [0 0 1 0]] All the values in the picker labeled 3 are set to 1 in the output because that was the value at `values[3]`. All other values were 0. > Generally speaking, given the labeled segments (label_objects from the > tutorial), how would I apply operations to the original image - for > example: set all of the pixels in "image" that are parts of objects labeled > 3 and 9 to 0.577 . > Something like this should work: >>> mask_low = image < 3 >>> mask_high = image > 9 >>> image[mask_low & mask_high] = 0.577 Also, how do I get smarter about how the system works so I don't ask > elementary questions? Is there a good high level tutorial that'll > familiarize me with the computation model for skimage / ndimage ? > Well, I think these questions are more focused on numpy, which forms the core of skimage. There are tons of numpy tutorials out there, but I don't have a particular favorite. Someone on the numpy mailing list pointed to the following tutorial: http://scipy-lectures.github.com/intro/numpy/index.html So that might be worth a look. Best, -Tony > > Best, > > Parand > > -- > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From tsyu80 at gmail.com Sun Dec 16 23:23:00 2012 From: tsyu80 at gmail.com (Tony Yu) Date: Sun, 16 Dec 2012 23:23:00 -0500 Subject: Segmentation and Granulometry with scikit-image In-Reply-To: References: <4c817a46-75de-4ee7-b58e-1ddb08228126@googlegroups.com> <2d1ccb5f-88cc-4275-8cc8-ac322b7b63b6@googlegroups.com> Message-ID: On Sun, Dec 16, 2012 at 10:41 AM, Dan wrote: > Hi, > > I installed Windows binaries (kindly provided by Christoph Gohlke)- file > name:scikit-image-0.7.2.win32-py2.7.exe > > Thanks > > El domingo, 16 de diciembre de 2012 10:36:13 UTC-5, Dan escribi?: > >> Hi, >> >> The output: >> Python 2.7.3 (default, Apr 10 2012, 23:31:26) [MSC v.1500 32 bit (Intel)] >> on win32 >> Type "copyright", "credits" or "license()" for more information. >> >>> import skimage >> >>> print skimage.__version__ >> 0.7.2 >> >>> print skimage.__file__ >> C:\Python27\lib\site-packages\**skimage\__init__.pyc >> >>> >> >> Thanks >> > Hmm... that all looks good to me. Maybe something went wrong during the install? This is bizarre, because `_skeletonize` is a regular python file (not cython, so it's not a build issue). If you look in "C:\Python27\lib\site-**packages\skimage\morphology\" is there a "_skeletonize.py" and does it like the original (i.e. does it have a `skeletonize` function)? -Tony >> El domingo, 16 de diciembre de 2012 09:41:35 UTC-5, Tony S Yu escribi?: >>> >>> On Sat, Dec 15, 2012 at 6:45 PM, Dan wrote: >>> >>>> Hi, >>>> >>>> Thanks for the rapid respnse, I am using 0.7.2 on windows. >>>> >>>> The error is now: >>>> >>>> Traceback (most recent call last): >>>> File "C:/Users/DK/PProjects/**skimage_seg/scikit_seg.py", line 3, in >>>> >>>> import skimage.morphology as morph >>>> File "C:\Python27\lib\site-**packages\skimage\morphology\__**init__.py", >>>> line 7, in >>>> from ._skeletonize import skeletonize, medial_axis >>>> ImportError: cannot import name skeletonize >>>> >>>> Any idea why?. >>>> >>>> Thanks >>>> >>> >>> >>> Hi Dan, >>> >>> How did you install scikit-image? Also, what's the output of the >>> following? >>> >>> >>> import skimage >>> print skimage.__version__ >>> print skimage.__file__ >>> >>> >>> -Tony >>> >>> >>> >>>> El s?bado, 15 de diciembre de 2012 16:24:31 UTC-5, Tony S Yu escribi?: >>>> >>>>> On Sat, Dec 15, 2012 at 1:58 PM, Dan wrote: >>>>> >>>>>> Dear Tony, >>>>>> >>>>>> Thanks for the script. >>>>>> >>>>>> I was running the script and I got this error: >>>>>> Traceback (most recent call last): >>>>>> File "C:/Users/DK/PProjects/**skimage**_seg/scikit_seg.py", line >>>>>> 18, in >>>>>> img_background = morph.reconstruction(img-h, img) >>>>>> AttributeError: 'module' object has no attribute 'reconstruction' >>>>>> >>>>>> Process finished with exit code 1 >>>>>> >>>>>> Any reason why? >>>>>> >>>>>> Thanks a lot, >>>>>> Dan >>>>>> >>>>> >>>>> Hi Dan, >>>>> >>>>> Which version of scikit-image are you running? You'll need at least >>>>> 0.7 (the latest stable release). You can check the version with the >>>>> following shell command: >>>>> >>>>> $ python -c "import skimage; print skimage.__version__" >>>>> >>>>> -Tony >>>>> >>>> -- > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From darugar at gmail.com Mon Dec 17 02:50:26 2012 From: darugar at gmail.com (Parand Darugar) Date: Sun, 16 Dec 2012 23:50:26 -0800 (PST) Subject: import of skimage.morphology.selem.disk fails Message-ID: Hello, "from skimage.morphology.selem import disk" fails with the message "ImportError: cannot import name convex_hull_image". Subsequent attempts to import result in message "ImportError: cannot import name _template". System: Python 2.7.2 on OS X 1.8.2 , scikit-image latest version from git Installed via "python install setup.py" The install seemed to work fine - I can run most other scripts. Full error log here: http://pastebin.com/hD8ishuH Any ideas? Best, Parand -------------- next part -------------- An HTML attachment was scrubbed... URL: From stefan at sun.ac.za Mon Dec 17 03:03:51 2012 From: stefan at sun.ac.za (=?ISO-8859-1?Q?St=E9fan_van_der_Walt?=) Date: Mon, 17 Dec 2012 00:03:51 -0800 Subject: import of skimage.morphology.selem.disk fails In-Reply-To: References: Message-ID: Hi Prashand On Sun, Dec 16, 2012 at 11:50 PM, Parand Darugar wrote: > "from skimage.morphology.selem import disk" fails with the message > "ImportError: cannot import name convex_hull_image". Subsequent attempts to > import result in message "ImportError: cannot import name _template". No problems on this end. Could you please send usyour build log? Thanks Stefan From guillaume at mitotic-machine.org Mon Dec 17 03:08:06 2012 From: guillaume at mitotic-machine.org (Guillaume Gay) Date: Mon, 17 Dec 2012 09:08:06 +0100 Subject: import of skimage.morphology.selem.disk fails In-Reply-To: References: Message-ID: <50CED2E6.9080902@mitotic-machine.org> Le 17/12/2012 09:03, St?fan van der Walt a ?crit : > Hi Prashand > > On Sun, Dec 16, 2012 at 11:50 PM, Parand Darugar wrote: >> "from skimage.morphology.selem import disk" fails with the message >> "ImportError: cannot import name convex_hull_image". Subsequent attempts to >> import result in message "ImportError: cannot import name _template". > No problems on this end. Could you please send usyour build log? > > Thanks > Stefan > Hi I had very similar import problems when I checked out the source from github last friday, that got sorted out by pulling it again sunday, so maybe it is enough for you to update your repository and build again... Guillaume From jni.soma at gmail.com Sun Dec 16 18:57:12 2012 From: jni.soma at gmail.com (Juan Nunez-Iglesias) Date: Mon, 17 Dec 2012 10:57:12 +1100 Subject: Stable vs Dev version, document image enhancement In-Reply-To: <02582B6B-4C51-4153-894D-7E7B64DAB5ED@gmail.com> References: <02582B6B-4C51-4153-894D-7E7B64DAB5ED@gmail.com> Message-ID: On Sat, Dec 15, 2012 at 12:26 AM, Sch?nberger Johannes < hannesschoenberger at gmail.com> wrote: > Maybe the "Gallery" link in the navigation should point to the dev gallery > and the "Documentation" link to the stable docs? > -1 for this one, as it could cause confusion if the gallery contains examples that are not yet implemented in the stable release. Perhaps you can add a "coming soon" link to the dev gallery? -------------- next part -------------- An HTML attachment was scrubbed... URL: From tsyu80 at gmail.com Mon Dec 17 16:37:35 2012 From: tsyu80 at gmail.com (Tony Yu) Date: Mon, 17 Dec 2012 16:37:35 -0500 Subject: import of skimage.morphology.selem.disk fails In-Reply-To: <50CED2E6.9080902@mitotic-machine.org> References: <50CED2E6.9080902@mitotic-machine.org> Message-ID: On Mon, Dec 17, 2012 at 3:08 AM, Guillaume Gay < guillaume at mitotic-machine.org> wrote: > Le 17/12/2012 09:03, St?fan van der Walt a ?crit : > > Hi Prashand >> >> On Sun, Dec 16, 2012 at 11:50 PM, Parand Darugar >> wrote: >> >>> "from skimage.morphology.selem import disk" fails with the message >>> "ImportError: cannot import name convex_hull_image". Subsequent attempts >>> to >>> import result in message "ImportError: cannot import name _template". >>> >> No problems on this end. Could you please send usyour build log? >> >> Thanks >> Stefan >> >> Hi > > I had very similar import problems when I checked out the source from > github last friday, that got sorted out by pulling it again sunday, > so maybe it is enough for you to update your repository and build again... > > Guillaume > > I think Guillaume is correct here. The error looks like a circular import that was fixed in PR #394. Does updating fix the issue? -Tony -------------- next part -------------- An HTML attachment was scrubbed... URL: From darugar at gmail.com Tue Dec 18 01:41:17 2012 From: darugar at gmail.com (Parand Darugar) Date: Mon, 17 Dec 2012 22:41:17 -0800 (PST) Subject: import of skimage.morphology.selem.disk fails In-Reply-To: References: <50CED2E6.9080902@mitotic-machine.org> Message-ID: <9f4774a9-c9ec-4906-9e8b-3f36b577b023@googlegroups.com> Yes indeed, a git pull and rebuild has fixed the issue. Much thanks! Best, Parand On Monday, December 17, 2012 1:37:35 PM UTC-8, Tony S Yu wrote: > > > > On Mon, Dec 17, 2012 at 3:08 AM, Guillaume Gay < > guil... at mitotic-machine.org > wrote: > >> Le 17/12/2012 09:03, St?fan van der Walt a ?crit : >> >> Hi Prashand >>> >>> On Sun, Dec 16, 2012 at 11:50 PM, Parand Darugar > >>> wrote: >>> >>>> "from skimage.morphology.selem import disk" fails with the message >>>> "ImportError: cannot import name convex_hull_image". Subsequent >>>> attempts to >>>> import result in message "ImportError: cannot import name _template". >>>> >>> No problems on this end. Could you please send usyour build log? >>> >>> Thanks >>> Stefan >>> >>> Hi >> >> I had very similar import problems when I checked out the source from >> github last friday, that got sorted out by pulling it again sunday, >> so maybe it is enough for you to update your repository and build again... >> >> Guillaume >> >> > I think Guillaume is correct here. The error looks like a circular import > that was fixed in PR #394. > Does updating fix the issue? > > -Tony > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From dkin at walla.co.il Thu Dec 20 03:33:39 2012 From: dkin at walla.co.il (Dan) Date: Thu, 20 Dec 2012 00:33:39 -0800 (PST) Subject: Segmentation and Granulometry with scikit-image In-Reply-To: References: <4c817a46-75de-4ee7-b58e-1ddb08228126@googlegroups.com> <2d1ccb5f-88cc-4275-8cc8-ac322b7b63b6@googlegroups.com> Message-ID: <2c8ea1e1-61ab-4752-8b59-846c9bc12b4d@googlegroups.com> El lunes, 17 de diciembre de 2012 05:23:00 UTC+1, Tony S Yu escribi?: > > > > On Sun, Dec 16, 2012 at 10:41 AM, Dan >wrote: > >> Hi, >> >> I installed Windows binaries (kindly provided by Christoph Gohlke)- file >> name:scikit-image-0.7.2.win32-py2.7.exe >> >> Thanks >> >> El domingo, 16 de diciembre de 2012 10:36:13 UTC-5, Dan escribi?: >> >>> Hi, >>> >>> The output: >>> Python 2.7.3 (default, Apr 10 2012, 23:31:26) [MSC v.1500 32 bit >>> (Intel)] on win32 >>> Type "copyright", "credits" or "license()" for more information. >>> >>> import skimage >>> >>> print skimage.__version__ >>> 0.7.2 >>> >>> print skimage.__file__ >>> C:\Python27\lib\site-packages\**skimage\__init__.pyc >>> >>> >>> >>> Thanks >>> >> > > Hmm... that all looks good to me. > > Maybe something went wrong during the install? This is bizarre, because > `_skeletonize` is a regular python file (not cython, so it's not a build > issue). If you look in > > "C:\Python27\lib\site-**packages\skimage\morphology\" > > > is there a "_skeletonize.py" and does it like the original (i.e. > does it have a `skeletonize` function)? > > -Tony > > >>> El domingo, 16 de diciembre de 2012 09:41:35 UTC-5, Tony S Yu escribi?: >>>> >>>> On Sat, Dec 15, 2012 at 6:45 PM, Dan wrote: >>>> >>>>> Hi, >>>>> >>>>> Thanks for the rapid respnse, I am using 0.7.2 on windows. >>>>> >>>>> The error is now: >>>>> >>>>> Traceback (most recent call last): >>>>> File "C:/Users/DK/PProjects/**skimage_seg/scikit_seg.py", line 3, >>>>> in >>>>> import skimage.morphology as morph >>>>> File "C:\Python27\lib\site-**packages\skimage\morphology\__**init__.py", >>>>> line 7, in >>>>> from ._skeletonize import skeletonize, medial_axis >>>>> ImportError: cannot import name skeletonize >>>>> >>>>> Any idea why?. >>>>> >>>>> Thanks >>>>> >>>> >>>> >>>> Hi Dan, >>>> >>>> How did you install scikit-image? Also, what's the output of the >>>> following? >>>> >>>> >>>> import skimage >>>> print skimage.__version__ >>>> print skimage.__file__ >>>> >>>> >>>> -Tony >>>> >>>> >>>> >>>>> El s?bado, 15 de diciembre de 2012 16:24:31 UTC-5, Tony S Yu escribi?: >>>>> >>>>>> On Sat, Dec 15, 2012 at 1:58 PM, Dan wrote: >>>>>> >>>>>>> Dear Tony, >>>>>>> >>>>>>> Thanks for the script. >>>>>>> >>>>>>> I was running the script and I got this error: >>>>>>> Traceback (most recent call last): >>>>>>> File "C:/Users/DK/PProjects/**skimage**_seg/scikit_seg.py", line >>>>>>> 18, in >>>>>>> img_background = morph.reconstruction(img-h, img) >>>>>>> AttributeError: 'module' object has no attribute 'reconstruction' >>>>>>> >>>>>>> Process finished with exit code 1 >>>>>>> >>>>>>> Any reason why? >>>>>>> >>>>>>> Thanks a lot, >>>>>>> Dan >>>>>>> >>>>>> >>>>>> Hi Dan, >>>>>> >>>>>> Which version of scikit-image are you running? You'll need at least >>>>>> 0.7 (the latest stable release). You can check the version with the >>>>>> following shell command: >>>>>> >>>>>> $ python -c "import skimage; print skimage.__version__" >>>>>> >>>>>> -Tony >>>>>> >>>>> -- >> >> >> > Dear Tony, > > The files were a match. I uninstalled python and the other libraries, > installed them again and it works fine now. I do not what was the problem. > > Thanks a lot for the help. > > Dan -------------- next part -------------- An HTML attachment was scrubbed... URL: From marianne.corvellec at ens-lyon.org Thu Dec 20 04:08:41 2012 From: marianne.corvellec at ens-lyon.org (Marianne Corvellec) Date: Thu, 20 Dec 2012 01:08:41 -0800 (PST) Subject: Stable vs Dev version, document image enhancement In-Reply-To: References: <02582B6B-4C51-4153-894D-7E7B64DAB5ED@gmail.com> Message-ID: <656792f1-e661-41ca-8ca3-bc976873d83a@googlegroups.com> On December 14, Tony S Yu wrote: > It might be a good idea for us to point to the stable version instead of > the development version by default. +1 For both "Gallery" and "Documentation". On Monday, December 17, 2012 12:57:12 AM UTC+1, Juan Nunez-Iglesias wrote: > > Perhaps you can add a "coming soon" link to the dev gallery? > +1 Would act as a teaser. :) "Coming soon" link on the "Gallery" page of stable version pointing to "Gallery" page of dev version. On December 14, Stefan van der Walt wrote: > The development gallery is useful as an advertisement, but we could maybe make the link to the other versions clearer? +1 I think the above could resolve the issue. The "Versions" box on the right-hand side is visible and great, but again, imho it makes more sense to point to the stable version by default. Marianne -------------- next part -------------- An HTML attachment was scrubbed... URL: From marianne.corvellec at ens-lyon.org Thu Dec 20 11:10:36 2012 From: marianne.corvellec at ens-lyon.org (Marianne Corvellec) Date: Thu, 20 Dec 2012 08:10:36 -0800 (PST) Subject: Stable vs Dev version, document image enhancement In-Reply-To: <656792f1-e661-41ca-8ca3-bc976873d83a@googlegroups.com> References: <02582B6B-4C51-4153-894D-7E7B64DAB5ED@gmail.com> <656792f1-e661-41ca-8ca3-bc976873d83a@googlegroups.com> Message-ID: <11fb4853-a030-4701-9950-1e1b5fae5364@googlegroups.com> My bad, I realize now it wouldn't be fine at all to point to the stable version 0.7.0 for documentation. There are too many broken links, notably from the change in name scikits-image -> scikit-image. So for now, let's keep pointing to the dev version by default. When version 0.8 is released, we can ask the question again. Marianne On Thursday, December 20, 2012 10:08:41 AM UTC+1, Marianne Corvellec wrote: > > On December 14, Tony S Yu wrote: > >> It might be a good idea for us to point to the stable version instead of >> the development version by default. > > > +1 > For both "Gallery" and "Documentation". > > On Monday, December 17, 2012 12:57:12 AM UTC+1, Juan Nunez-Iglesias wrote: >> >> Perhaps you can add a "coming soon" link to the dev gallery? >> > > +1 > Would act as a teaser. :) > "Coming soon" link on the "Gallery" page of stable version pointing to > "Gallery" page of dev version. > > On December 14, Stefan van der Walt wrote: > >> The development gallery is useful as an advertisement, but we could > > maybe make the link to the other versions clearer? > > > +1 > I think the above could resolve the issue. > The "Versions" box on the right-hand side is visible and great, but again, > imho it makes more sense to point to the stable version by default. > > Marianne > -------------- next part -------------- An HTML attachment was scrubbed... URL: From stefan at sun.ac.za Sat Dec 22 15:41:22 2012 From: stefan at sun.ac.za (=?ISO-8859-1?Q?St=E9fan_van_der_Walt?=) Date: Sat, 22 Dec 2012 12:41:22 -0800 Subject: Fourier transform upsample/shift? In-Reply-To: References: Message-ID: Hi Adam On Fri, Dec 21, 2012 at 8:01 PM, Adam Ginsburg wrote: > https://github.com/keflavich/image_registration/blob/master/image_registration/fft_tools/shift.py > https://github.com/keflavich/image_registration/blob/master/image_registration/fft_tools/scale.py > https://github.com/keflavich/image_registration/blob/master/image_registration/fft_tools/zoom.py > (docs here: > https://image-registration.readthedocs.org/en/latest/fourier_tools.html) These look interesting; do they provide any real speed-up over the existing routines? If so, how about using a `fourier_` prefix and implement them all in the same file? Regards St?fan From keflavich at gmail.com Sat Dec 22 20:24:47 2012 From: keflavich at gmail.com (Adam Ginsburg) Date: Sat, 22 Dec 2012 17:24:47 -0800 (PST) Subject: Fourier transform upsample/shift? In-Reply-To: References: Message-ID: Reasonable idea. I think they are faster for at least some cases, but they also behave a little differently than other interpolation techniques. So put them all in a "fourier_interpolation.py" file, then put them somewhere in transforms? On Saturday, December 22, 2012 1:41:22 PM UTC-7, Stefan van der Walt wrote: > > Hi Adam > > On Fri, Dec 21, 2012 at 8:01 PM, Adam Ginsburg > > wrote: > > > https://github.com/keflavich/image_registration/blob/master/image_registration/fft_tools/shift.py > > > https://github.com/keflavich/image_registration/blob/master/image_registration/fft_tools/scale.py > > > https://github.com/keflavich/image_registration/blob/master/image_registration/fft_tools/zoom.py > > (docs here: > > https://image-registration.readthedocs.org/en/latest/fourier_tools.html) > > > These look interesting; do they provide any real speed-up over the > existing routines? If so, how about using a `fourier_` prefix and > implement them all in the same file? > > Regards > St?fan > -------------- next part -------------- An HTML attachment was scrubbed... URL: From stefan at sun.ac.za Sat Dec 22 22:31:48 2012 From: stefan at sun.ac.za (=?ISO-8859-1?Q?St=E9fan_van_der_Walt?=) Date: Sat, 22 Dec 2012 19:31:48 -0800 Subject: Fourier transform upsample/shift? In-Reply-To: References: Message-ID: On Sat, Dec 22, 2012 at 5:24 PM, Adam Ginsburg wrote: > Reasonable idea. I think they are faster for at least some cases, but they > also behave a little differently than other interpolation techniques. So > put them all in a "fourier_interpolation.py" file, then put them somewhere > in transforms? Yes, I think some benchmarks would be interesting. Otherwise, we may want to add sinc interpolation to ndimage and see if that yields the same results. Thanks! St?fan From hannesschoenberger at gmail.com Sat Dec 22 13:50:05 2012 From: hannesschoenberger at gmail.com (=?UTF-8?Q?Johannes_Sch=C3=B6nberger?=) Date: Sat, 22 Dec 2012 19:50:05 +0100 Subject: problem with skimage.measure.perimeter (version 0.7.1) In-Reply-To: References: Message-ID: Off course, you are right. I'll quickly fix this bug! Thanks for reporting. 2012/12/18 Patrice Munger : > Comparing the code in regionprops.py with the reference > http://www.cs.qub.ac.uk/~d.crookes/webpubs/papers/perimeter.doc, > should line 450 be (1 + sqrt(2) )/ 2: (13, 23) rather than 1 + sqrt(2) / 2: > (13, 23) ? > > -- > > From hannesschoenberger at gmail.com Sat Dec 22 14:12:06 2012 From: hannesschoenberger at gmail.com (=?iso-8859-1?Q?Sch=F6nberger_Johannes?=) Date: Sat, 22 Dec 2012 20:12:06 +0100 Subject: problem with skimage.measure.perimeter (version 0.7.1) In-Reply-To: References: Message-ID: See https://github.com/scikit-image/scikit-image/pull/402. From keflavich at gmail.com Sun Dec 23 02:30:45 2012 From: keflavich at gmail.com (Adam) Date: Sun, 23 Dec 2012 00:30:45 -0700 Subject: Fourier transform upsample/shift? In-Reply-To: References: Message-ID: Benchmark tests created: https://github.com/keflavich/image_registration/blob/master/examples/benchmarks_zoom.py https://github.com/keflavich/image_registration/blob/master/examples/benchmarks_shift.py They ought to be more extensive, but give the general results: -fourier-based shifting is a little faster (maybe 50%), but follows the same power-law -fourier-based upsampling is marginally slower, but my test results so far are questionable because of machine variability Of course, with fftw3, one can increase the number of processes used for the fft, which may speed things up. On Sat, Dec 22, 2012 at 8:31 PM, St?fan van der Walt wrote: > On Sat, Dec 22, 2012 at 5:24 PM, Adam Ginsburg wrote: >> Reasonable idea. I think they are faster for at least some cases, but they >> also behave a little differently than other interpolation techniques. So >> put them all in a "fourier_interpolation.py" file, then put them somewhere >> in transforms? > > Yes, I think some benchmarks would be interesting. Otherwise, we may > want to add sinc interpolation to ndimage and see if that yields the > same results. > > Thanks! > St?fan > > -- > > -- Adam From stefan at sun.ac.za Sun Dec 23 06:23:58 2012 From: stefan at sun.ac.za (=?ISO-8859-1?Q?St=E9fan_van_der_Walt?=) Date: Sun, 23 Dec 2012 03:23:58 -0800 Subject: High order statistics/Gary level runlength matrices statistics In-Reply-To: References: Message-ID: Hi Dan On Sun, Dec 16, 2012 at 12:57 AM, Dan wrote: > Is this interesting option going to be implmented in the future release? How would you define run-length on a two-dimensional array? Regards St?fan From stefan at sun.ac.za Sun Dec 23 06:34:37 2012 From: stefan at sun.ac.za (=?ISO-8859-1?Q?St=E9fan_van_der_Walt?=) Date: Sun, 23 Dec 2012 03:34:37 -0800 Subject: canvastools subpackage for scikit-image viewer In-Reply-To: References: <3d65b13b-c793-4337-a1fa-764e4210b264@googlegroups.com> Message-ID: Tony and Steven, On Fri, Dec 14, 2012 at 11:11 AM, Steven Silvester wrote: > Great, I'll dig into your PR this weekend. I was thinking that each plugin could be registered as a dock window, and be switchable via a View menu. Thanks for working on this--it turns out to be a very powerful teaching and demonstration tool! Cheers St?fan From stefan at sun.ac.za Sun Dec 23 07:39:43 2012 From: stefan at sun.ac.za (=?ISO-8859-1?Q?St=E9fan_van_der_Walt?=) Date: Sun, 23 Dec 2012 04:39:43 -0800 Subject: "No definition found" In-Reply-To: References: Message-ID: On Thu, Nov 29, 2012 at 6:43 PM, Juan Nunez-Iglesias wrote: > I'm getting this message when trying to find the definition header for > skimage.segmentation.slic: > > In [12]: %pdef segmentation.slic > No definition header found for segmentation.slic > > In [15]: %pdef segmentation.join_segmentations > segmentation.join_segmentations(s1, s2) > > Anyone know why this is? Is this a general feature of Cython functions? Not sure--but this also shows that IPython does not handle unicode characters in a docstring correctly! Would you like to file a bug report? St?fan From hannesschoenberger at gmail.com Sun Dec 23 03:07:43 2012 From: hannesschoenberger at gmail.com (=?iso-8859-1?Q?Sch=F6nberger_Johannes?=) Date: Sun, 23 Dec 2012 09:07:43 +0100 Subject: Fourier transform upsample/shift? In-Reply-To: References: Message-ID: <2E74811A-927C-4423-B795-D2893BC92330@gmail.com> Hi, I see you haven't benchmarked against the skimage.transform.* functions, those should be a lot faster compared to `ndimage.map_coordinates`. If your implementation provides a different kind of interpolation, I suggest to integrate them into the current functions and add a new parameter `mode="fourier"`. I'm not sure if there is an equivalent for your functions in all cases (see `transform/_warps.py`). Thoughts? Am 23.12.2012 um 08:30 schrieb Adam : > Benchmark tests created: > https://github.com/keflavich/image_registration/blob/master/examples/benchmarks_zoom.py > https://github.com/keflavich/image_registration/blob/master/examples/benchmarks_shift.py > > They ought to be more extensive, but give the general results: > -fourier-based shifting is a little faster (maybe 50%), but follows > the same power-law > -fourier-based upsampling is marginally slower, but my test results so > far are questionable because of machine variability > > Of course, with fftw3, one can increase the number of processes used > for the fft, which may speed things up. > > On Sat, Dec 22, 2012 at 8:31 PM, St?fan van der Walt wrote: >> On Sat, Dec 22, 2012 at 5:24 PM, Adam Ginsburg wrote: >>> Reasonable idea. I think they are faster for at least some cases, but they >>> also behave a little differently than other interpolation techniques. So >>> put them all in a "fourier_interpolation.py" file, then put them somewhere >>> in transforms? >> >> Yes, I think some benchmarks would be interesting. Otherwise, we may >> want to add sinc interpolation to ndimage and see if that yields the >> same results. >> >> Thanks! >> St?fan >> >> -- >> >> > > -- > Adam > > -- > > From stefan at sun.ac.za Wed Dec 26 16:08:59 2012 From: stefan at sun.ac.za (=?ISO-8859-1?Q?St=E9fan_van_der_Walt?=) Date: Wed, 26 Dec 2012 13:08:59 -0800 Subject: Testing In-Reply-To: <76833066-56a9-422b-aacb-94230355b8e9@googlegroups.com> References: <76833066-56a9-422b-aacb-94230355b8e9@googlegroups.com> Message-ID: Hi Vikram On Wed, Dec 26, 2012 at 11:36 AM, Vikram Kamath wrote: > The problem I'm having is - I've installed scikit-image and I've also forked > the repo. I've created a branch and I'm tinkering with it. How do I run > tests to ensure that the code, after my modification actually works? First, you need to build the extension modules (type "make" in the repository root). Then, you can add that path to your PYTHONPATH: export PYTHONPATH=$PYTHONPATH:/path/to/skimage Then run "nosetests skimage" or import skimage skimage.test() > Also, is there an IRC channel for scikit-image? . Googling for it doesn't > show any relevant results and joining #scikit-image takes me to an empty > channel. Most of our communication takes place through the mailing list, although you may receive general installation help in #scipy on Freenode. Good luck! St?fan From tsyu80 at gmail.com Thu Dec 27 01:41:18 2012 From: tsyu80 at gmail.com (Tony Yu) Date: Wed, 26 Dec 2012 22:41:18 -0800 Subject: canvastools subpackage for scikit-image viewer In-Reply-To: References: <3d65b13b-c793-4337-a1fa-764e4210b264@googlegroups.com> Message-ID: On Sun, Dec 23, 2012 at 3:34 AM, St?fan van der Walt wrote: > Tony and Steven, > > On Fri, Dec 14, 2012 at 11:11 AM, Steven Silvester > wrote: > > Great, I'll dig into your PR this weekend. I was thinking that each > plugin could be registered as a dock window, and be switchable via a View > menu. > > Thanks for working on this--it turns out to be a very powerful > teaching and demonstration tool! > > Cheers > St?fan > > I'm glad you like it. I just added another tool: A canvas painter. It's a bit less responsive than I'd like, but I think it's as fast as it'll get (it's limited by matplotlib's blitting support for images). Check out the watershed demo in the `viewer_examples/plugins` folder, which uses the paint tool to generate markers for watershed segmentation. Best, -Tony -------------- next part -------------- An HTML attachment was scrubbed... URL: From stefan at sun.ac.za Fri Dec 28 00:56:13 2012 From: stefan at sun.ac.za (=?ISO-8859-1?Q?St=E9fan_van_der_Walt?=) Date: Thu, 27 Dec 2012 21:56:13 -0800 Subject: canvastools subpackage for scikit-image viewer In-Reply-To: References: <3d65b13b-c793-4337-a1fa-764e4210b264@googlegroups.com> Message-ID: Hi Tony On Wed, Dec 26, 2012 at 10:41 PM, Tony Yu wrote: > I just added another tool: A canvas painter. It's a bit less responsive than > I'd like, but I think it's as fast as it'll get (it's limited by > matplotlib's blitting support for images). Check out the watershed demo in > the `viewer_examples/plugins` folder, which uses the paint tool to generate > markers for watershed segmentation. Finally, a path to that FFT filter painter I've had in mind! This is very exciting. By the way, it took me a while to figure out to press "enter" to run the segmentation, so how about printing some instructions to the terminal? Thanks again, St?fan From emmanuelle.gouillart at nsup.org Fri Dec 28 03:25:07 2012 From: emmanuelle.gouillart at nsup.org (Emmanuelle Gouillart) Date: Fri, 28 Dec 2012 09:25:07 +0100 Subject: skimage and opencv In-Reply-To: <1c1eacb6-349a-40c8-9058-faae9084e436@googlegroups.com> References: <1c1eacb6-349a-40c8-9058-faae9084e436@googlegroups.com> Message-ID: <20121228082507.GA27386@phare.normalesup.org> Hi Fran??????ois, that's an excellent question, and not a troll :-). Opencv is a very powerful library, but it focuses primarily on computer vision (feature detection and extraction, classification, ...), as opposed to image processing in general (with other tasks such as denoising, segmentation, ...). The other big difference is that skimage builds on numpy ndarrays, and uses the full power of the numpy API (including of course the basic facilities for processing arrays as images that come with numpy), as well as some of scipy functions (you could have added scipy.ndimage to your list -- a few functions in skimage are wrappers around scipy.ndimage, that exist for the sake of completeneness). One important consequence is that algorithms working for 3-d or even n-d images can be easily implemented in 3-d/n-d in skimage, whereas opencv is restricted to 2-D images (as far as I know). Thanks to the use of numpy arrays, the API of skimage is also quite pleasant for a numpy user, more than the API of opencv. A related difference is that skimage is written in python and cython, whereas opencv is a C++ library. The two libraries attract a different crowd of developers, and a Python/Cython toolkit based on numpy arrays is easier to develop and maintain inside the Scientific Python ecosystem. I'm sure that other devs/users will have things to add to this discussion! Cheers, Emmanuelle On Thu, Dec 27, 2012 at 02:06:08PM -0800, Fran??????ois wrote: > Hi users and devs, > It came to my knowledge that another python library (based on C++ and C > codes) for image processing exists too : opencv > I understand that numpy intregrates some basic features and we need some > advanced features but I have the feeling that skimages is redoundant with > opencv in some ways. > What's the position of skimage about that? (Don't read this question as a > troll but like a real question). > I mean that similar features exist in both. Would not be possible to > reuse/integrate opencv or merge? what's the reason for keeping them apart? > My observation is there is 4 libraries to manipulate images: > * PIL > * numpy > * skimages > * opencv > That's a lot. > Cheers, From stefan at sun.ac.za Fri Dec 28 15:01:40 2012 From: stefan at sun.ac.za (=?ISO-8859-1?Q?St=E9fan_van_der_Walt?=) Date: Fri, 28 Dec 2012 12:01:40 -0800 Subject: skimage and opencv In-Reply-To: <1c1eacb6-349a-40c8-9058-faae9084e436@googlegroups.com> References: <1c1eacb6-349a-40c8-9058-faae9084e436@googlegroups.com> Message-ID: Hi Francois On Thu, Dec 27, 2012 at 2:06 PM, Fran?ois wrote: > I understand that numpy intregrates some basic features and we need some > advanced features but I have the feeling that skimages is redoundant with > opencv in some ways. > What's the position of skimage about that? Thanks for your question--it's a good one. There are several reasons for a separate project, some of them already highlighted by Emmanuelle. A few years ago, we had to decide whether we wanted to build on top of OpenCV, and the general consensus was that it is too heavy a dependency. We have three aims with `skimage`: 1. Provide a highly Pythonic interface to building blocks for reproducible image processing reseach 2. Have simple, well-written and clear implementations of common algorithms for use in education 3. Provide tools for solving industry problems efficiently I think OpenCV does number 3 particularly well, while some projects such as SimpleCV take on number 1. But when it comes to education and reproducible research, I believe `skimage` still holds a significant advantage, in terms of the transparency and clarity of the code, as well as the examples provided. `skimage` plays particularly well with the scipy stack of tools, and I find that the pipelining tools (dtype conversion, color space handling, exposure adjustment, etc.) significantly improve my research productivity. Your comments and criticisms are most welcome; we are always keen to hear good feedback! Regards St?fan From francois.boulogne at gmail.com Sat Dec 29 09:54:17 2012 From: francois.boulogne at gmail.com (=?UTF-8?Q?Fran=C3=A7ois?=) Date: Sat, 29 Dec 2012 06:54:17 -0800 (PST) Subject: skimage and opencv In-Reply-To: References: <1c1eacb6-349a-40c8-9058-faae9084e436@googlegroups.com> Message-ID: Many thanks for your responses. I agree with the fact that methods implemented in python are definitely easier to read. This a major advantage for education purpose. On the skimage home page, there is a 'Related project' box. Don't you think that it would be interesting to add these explanations on a dedicated page? Even the overview (see http://scikit-image.org/docs/dev/overview.html) is very light on the topic. -------------- next part -------------- An HTML attachment was scrubbed... URL: From emmanuelle.gouillart at nsup.org Sat Dec 29 10:36:49 2012 From: emmanuelle.gouillart at nsup.org (Emmanuelle Gouillart) Date: Sat, 29 Dec 2012 16:36:49 +0100 Subject: skimage and opencv In-Reply-To: References: <1c1eacb6-349a-40c8-9058-faae9084e436@googlegroups.com> Message-ID: <20121229153649.GA17203@phare.normalesup.org> > On the skimage home page, there is a 'Related project' box. Don't you > think that it would be interesting to add these explanations on a > dedicated page? Even the overview (see > http://scikit-image.org/docs/dev/overview.html) is very light on the > topic. We welcome pull requests :-D From emmanuelle.gouillart at nsup.org Mon Dec 31 14:10:15 2012 From: emmanuelle.gouillart at nsup.org (Emmanuelle Gouillart) Date: Mon, 31 Dec 2012 20:10:15 +0100 Subject: the memory issue In-Reply-To: <88d34a27-14d4-4302-bd6e-e52fdb8773d4@googlegroups.com> References: <88d34a27-14d4-4302-bd6e-e52fdb8773d4@googlegroups.com> Message-ID: <20121231191015.GD24873@phare.normalesup.org> Hi Vicky, the random walker algorithm has a quite complex api, because it can use several modes (the 'mode' keyword argument) to solve the linear system of the algorithm - 'bf' (for brute force): an LU decomposition of the matrix is computed. This is very costly in memory, and only recommended for small images. - 'cg' (for conjugate gradient). This mode needs much less memory, I suggest that you use it to test whether the algorithm gives good results for your problem. However, this mode is quite slow. - 'cg_mg': conjugate gradient with multigrid acceleration. This mode is much faster, but you'll need to install the module pyamg to use it. I use the cg_mg mode on tomography data (arrays of 500*500*20 float32 numbers, typically). Hope this helps, Emmanuelle On Mon, Dec 31, 2012 at 11:00:42AM -0800, vicky Liau wrote: > Hi everyone, > I use scikit-image to implement image segmentation for vegetation > classification. The target imagery is about 1GB, and I renewed my laptop > memory to 12GB (Window7 64 bit OS, CPU i7-2860QM) to read in imagery.?????? > However, when I tried to implement random walker segmentation, ipython > shows memory errors.?????? > Also, I shrink the imagery to 188 MB, and implement the same algorithm. > Ipython still shows errors as following.?????? > RuntimeError ?????? ?????? ?????? ?????? ?????? ?????? ?????? ?????? ?????? ?????? ?????? ?????? ?????? ?????? ??????Traceback (most recent call > last) > C:\Dropbox\open_codes\RS_codes\ in > () > ----> 1 labels = random_walker(newarray3, markers, beta=10, mode='bf') > C:\Python27\lib\site-packages\skimage\segmentation\random_walker_segmentation.py > c in random_walker(data, labels, beta, mode, tol, copy, multichannel, > return_ful > l_prob, depth) > ?????? ?????? 396 ?????? ?????? if mode == 'bf': > ?????? ?????? 397 ?????? ?????? ?????? ?????? X = _solve_bf(lap_sparse, B, > --> 398 ?????? ?????? ?????? ?????? ?????? ?????? ?????? ?????? ?????? ?????? ?????? return_full_prob=return_full_prob) > ?????? ?????? 399 ?????? ?????? # Clean up results > ?????? ?????? 400 ?????? ?????? if return_full_prob: > C:\Python27\lib\site-packages\skimage\segmentation\random_walker_segmentation.py > c in _solve_bf(lap_sparse, B, return_full_prob) > ?????? ?????? 418 ?????? ?????? """ > ?????? ?????? 419 ?????? ?????? lap_sparse = lap_sparse.tocsc() > --> 420 ?????? ?????? solver = > sparse.linalg.factorized(lap_sparse.astype(np.double)) > ?????? ?????? 421 ?????? ?????? X = np.array([solver(np.array((-B[i]).todense()).ravel())\ > ?????? ?????? 422 ?????? ?????? ?????? ?????? ?????? ?????? ?????? ?????? ?????? for i in range(len(B))]) > C:\Python27\lib\site-packages\scipy\sparse\linalg\dsolve\linsolve.pyc in > factori > zed(A) > ?????? ?????? 274 > ?????? ?????? 275 ?????? ?????? ?????? ?????? # Make LU decomposition. > --> 276 ?????? ?????? ?????? ?????? umf.numeric( A ) > ?????? ?????? 277 > ?????? ?????? 278 ?????? ?????? ?????? ?????? def solve( b ): > C:\Python27\lib\site-packages\scipy\sparse\linalg\dsolve\umfpack\umfpack.pyc > in > numeric(self, mtx) > ?????? ?????? 401 > ?????? ?????? 402 ?????? ?????? ?????? ?????? if self._symbolic is None: > --> 403 ?????? ?????? ?????? ?????? ?????? ?????? self.symbolic( mtx ) > ?????? ?????? 404 > ?????? ?????? 405 ?????? ?????? ?????? ?????? indx = self._getIndx( mtx ) > C:\Python27\lib\site-packages\scipy\sparse\linalg\dsolve\umfpack\umfpack.pyc > in > symbolic(self, mtx) > ?????? ?????? 384 ?????? ?????? ?????? ?????? if status != UMFPACK_OK: > ?????? ?????? 385 ?????? ?????? ?????? ?????? ?????? ?????? raise RuntimeError('%s failed with %s' % > (self.funs.symbolic > , > --> 386 ?????? ?????? ?????? ?????? ?????? ?????? ?????? ?????? ?????? ?????? ?????? ?????? ?????? ?????? ?????? ?????? ?????? ?????? ?????? ?????? ?????? ?????? ?????? ?????? ?????? ?????? ?????? > ??????umfStatus[status] > )) > ?????? ?????? 387 > ?????? ?????? 388 ?????? ?????? ?????? ?????? self.mtx = mtx > RuntimeError: failed > with U > MFPACK_ERROR_out_of_memory > What can I do for that? Just want to test whether this algorithm works for > my thoughts.?????? > Thanks!??????