New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add morphological reconstruction #215

Merged
merged 21 commits into from Aug 25, 2012

Conversation

Projects
None yet
4 participants
@tonysyu
Copy link
Member

tonysyu commented Jul 13, 2012

Add greyscale, morphological reconstruction adapted from CellProfiler.

Todo:

  • Clean up code (most of this is taken from CellProfiler with little modification).
  • Improve example: there could be more explanatory text (esp. for the white-tophat part). Also, the example was written before the plot2rst extension was added, so plot titles should probably be replaced by explanatory text.
"""Test reconstruction where the image is uniform and less than mask"""
image = np.ones((5, 5))
mask = np.ones((5, 5)) * 2
assert np.all(reconstruction(image,mask) == 1)

This comment has been minimized.

@emmanuelle

emmanuelle Jul 20, 2012

Member

whitespace after comma

image = np.ones((5, 5))
image[2, 2] = 2
mask = np.ones((5, 5)) * 3
assert np.all(reconstruction(image,mask) == 2)

This comment has been minimized.

@emmanuelle

emmanuelle Jul 20, 2012

Member

whitespace after comma

@emmanuelle

This comment has been minimized.

Copy link
Member

emmanuelle commented Jul 20, 2012

Hi Tony, would you prefer me to comment on the diff, or to checkout your branch and work on it? If you're busy with other things the second solution might be better.

@tonysyu

This comment has been minimized.

Copy link
Member

tonysyu commented Jul 20, 2012

If you have time to make changes directly to a branch, that'd be great.

@tonysyu

This comment has been minimized.

Copy link
Member

tonysyu commented Aug 19, 2012

@emmanuelle I made some major changes in the last couple of days. I removed the tutorial because it needed a lot of work, but I replaced it with 2 examples. I also added the ability to do reconstruction by erosion and cleaned up the code a bit. If you have time to take a look at the revised PR, that'd be great.



@cython.boundscheck(False)
def reconstruction_loop(unsigned int[:] ranks, int[:] prev, int[:] next,

This comment has been minimized.

@stefanv

stefanv Aug 24, 2012

Member

This does not work on Cython 0.15.

This comment has been minimized.

@tonysyu

tonysyu Aug 25, 2012

Member

Hmm, I thought we were pretty aggressive with our Cython dependency. Since it's a bit less stable than, say, numpy or matplotlib, I thought it was OK to use the latest stable version, i.e. 0.16. Thoughts? (Note: the website currently states 0.15 as the minimum requirement)

This comment has been minimized.

@stefanv

stefanv Aug 25, 2012

Member

I think that's fine, as long as we update the DEPENDS.txt

tonysyu added some commits Aug 25, 2012

DOC: Bump up Cython version up to 0.16
This PR uses typed memoryviews, which were introduced in 0.16.

stefanv added a commit that referenced this pull request Aug 25, 2012

Merge pull request #215 from tonysyu/morph-reconstruction
ENH: Add morphological reconstruction.

@stefanv stefanv merged commit 544fec7 into scikit-image:master Aug 25, 2012

@amueller

This comment has been minimized.

Copy link
Member

amueller commented Aug 25, 2012

There seems to be lots of test failures because grey_reconstruct was moved. It seems to be imported in many places.

@amueller

This comment has been minimized.

Copy link
Member

amueller commented Aug 25, 2012

The actual error I get is (No module named rank_order)
File "/home/andy/checkout/scikits.image/skimage/morphology/greyreconstruct.py", line 14, in

@tonysyu

This comment has been minimized.

Copy link
Member

tonysyu commented Aug 25, 2012

This should be addressed by PR #270. (I always forget to clean out *.pyc files)

@amueller

This comment has been minimized.

Copy link
Member

amueller commented Aug 25, 2012

Thanks for the quick fix!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment