-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Fixed skimage.feature.graycomatrix example documentation. #7297
Open
FedericoWZhaw
wants to merge
3
commits into
scikit-image:main
Choose a base branch
from
FedericoWZhaw:graycomatrix-docfix#7293
base: main
Could not load branches
Branch not found: {{ refName }}
Could not load tags
Nothing to show
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 2 commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you, @FedericoWZhaw! I would be a little more explicit; maybe:
or include it as comments in the code, when each GLCM is printed. Is it correct that pi/4 and 3*pi/4 correspond to the upward diagonal directions?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"1-pixel offset" and "distance 1" seem somewhat redundant, I find the later more precise? "bisector" seems like a very technical term that's not used anywhere else in the docstring..?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The description of the distance parameter states:
distances : array_like
List of pixel pair distance offsets.
What about:
"Compute 4 GLCMs using 1-pixel distance and 4 different angles. For example, an angle of 0 radians refers to the neighboring pixel to the right; pi/4 to the top-right diagonal neighbor (row-1,column+1); pi/2 to the pixel above, etc."
Feel free to suggest something else.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you both for iterating! 😃
Totally, but that was on purpose, to clarify the arguments, as done in the text of the gallery example: "a 1-pixel offset to the right (distance 1 and angle 0 rad)" parallels "a horizontal offset of 5 (
distance=[5]
andangles=[0]
)."I must say I'm not sure how it sound to most ears... I would assume that someone using scikit-image would have some minimal computing background and, for instance, would have already heard something like "the equation of the first bisector line is y=x" (but I'm definitely not attached to this term).
I very much like @FedericoWZhaw's suggestion (minor: I would write "0 radian" instead of "0 radians"). It's just that -- and that was my original motivation for suggesting a change -- an angle refers to a direction so, e.g., an angle of 0 refers to all pixels to the right, not only to the pixel to the right; the fact that it's the pixel to the right comes from the pair (distance=1, angle=0); same with all other angles (angle pi/2 means one of the pixels straight above, and it's the pixel right above because it's at distance 1).