Skip to content
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

New GLCM properties to graycoprops #7375

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

SerodioJ
Copy link

@SerodioJ SerodioJ commented Apr 8, 2024

Description

This PR extends the graycoprops function with new properties that can be computed from the GLCM. The new properties are:

  • mean
  • variance
  • standard deviation
  • entropy

These properties can be found as texture attributes in the OpendTect software, used in seismic processing.

Checklist

Release note

We use changelist to
compile each pull request into an item of the release notes. Please refer to
the instructions
and past release notes
for guidance and examples.

Add support for the new Grey-Level Co-occurrence Matrix (GLCM) properties
mean, variance, standard deviation and entropy to `skimage.feature.texture.graycoprops`.

Copy link
Member

@lagru lagru left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @SerodioJ for the new feature suggestion! Even though we usually suggest opening an issue first to suggest new features (or did I miss that), this is looking very good for a first contribution.

I haven't looked into this too deeply yet, but it seems like this is something we can add to scikit-image. Though, I am curious about the context around this PR. How did you come across this and why do you think this would be useful to add to the library?

I've also left a few minor suggestions from a first review.

skimage/feature/texture.py Outdated Show resolved Hide resolved
skimage/feature/texture.py Outdated Show resolved Hide resolved
skimage/feature/texture.py Outdated Show resolved Hide resolved
@SerodioJ
Copy link
Author

SerodioJ commented Apr 8, 2024

Thanks for the review @lagru.
I didn't open an issue, sorry for that.

Regarding the context of this PR. I am currently working with seismic processing, and one of the things I am using are attributes based on the GLCM. As I am using Python on my experiments, I ended up using scikit-image to compute some attributes, but not all of the ones listed here where available on the library (the ones added by this PR).
I was using my own function, but I thought it would be interesting to add them to scikit-image, as more people might need them.

Also thank you for the suggestions. I will update the PR with them.

Copy link
Member

@lagru lagru left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for addressing the suggestions. The implementation looks good. Though, I'd like to make sure that we are testing the correct things. Especially with regards to -np.log(P, where=(P != 0), ...).

skimage/feature/tests/test_texture.py Show resolved Hide resolved
@SerodioJ
Copy link
Author

@lagru what do you think would be the best approach to test the properties?

  • Use the values from the reference and reduce the precision used for comparison to 3 decimal digits like the tests for the initial properties (contrast and dissimilarity).
  • Use the manually computed values and do not specify precision like the test for the properties added later.

@jcfaracco
Copy link

@lagru, @SerodioJ and I work together. That's why I closed #6569. In fact, I deleted my fork 🤦🏻 . If you need any help to ACK João's PR. I can help too.

@SerodioJ
Copy link
Author

Hi @lagru, is there anything that must be updated on the PR?

Copy link
Member

@lagru lagru left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Sorry for the delayed feedback. Would you mind adding the clarification on where the reference values come from?

skimage/feature/tests/test_texture.py Show resolved Hide resolved
@lagru
Copy link
Member

lagru commented May 7, 2024

Oh, feel free to ignore the failures on MacOS for now. We need to fix that, hopefully soon.

@lagru
Copy link
Member

lagru commented May 9, 2024

I was so confused for a minute, why this PR-branch is passing on MacOS even though you didn't merge the fixes from #7414. I think it's because GitHub runs the job on the would-be merge between this branch and the target? So the fixes are included in the job just by being present on main. That sure isn't obvious at all!

Thanks for the update though.

@SerodioJ
Copy link
Author

Hi @lagru. When will it be merged? And also whats is the frequency of new releases of the package?

@lagru lagru added this to the 0.24 milestone May 18, 2024
@lagru
Copy link
Member

lagru commented May 18, 2024

@SerodioJ, hard to say. It depends on when a second pair of maintainer eyes has the free time & priority to review this. Could be tomorrow could be much later. Sorry, open source contributions can sometimes require a bit of time due to the volunteer nature of most parties involved.

I've added the PR manually and will request reviews, though since this should be ready if not close.

@lagru lagru requested review from stefanv and mkcor May 18, 2024 21:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants