-
-
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
Add gallery example for structure_tensor... in 3D! #5012
Conversation
Hello @mkcor! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found:
Comment last updated at 2021-01-27 10:25:51 UTC |
Yes I would and they are f-strings |
@scikit-image/core please review when you get a chance! |
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 @mkcor! I just left some minor suggestions 😉
Co-authored-by: Riadh Fezzani <rfezzani@gmail.com>
@rfezzani thank you for the thorough review! |
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.
Thanks for working on this @mkcor! I have some comments, but think the general approach here is fine and this dataset should be okay to demonstrate the basic principles
coords = np.unravel_index(eigen.argmax(), eigen.shape) | ||
assert coords[0] == 0 # by definition | ||
coords | ||
|
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.
I think it would be nice to also plot all 3 eigenvalues for a single slice (e.g. 1 subplot per eigenvalue, using uniform brightness scale across subplots).
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.
I was suggesting a figure something like this, which shows the spatial distribution of the eigenvalues. Do you think it is helpful?
fig, axes = plt.subplots(1, 3)
vmax = eigen[0][coords[1]].max()
axes[0].imshow(eigen[0][coords[1]], vmin=0, vmax=vmax, cmap=plt.cm.viridis)
axes[0].set_title('eigenvalue 0')
axes[1].imshow(eigen[1][coords[1]], vmin=0, vmax=vmax, cmap=plt.cm.viridis)
axes[1].set_title('eigenvalue 1')
axes[2].imshow(eigen[2][coords[1]], vmin=0, vmax=vmax, cmap=plt.cm.viridis)
axes[2].set_title('eigenvalue 2')
for ax in axes:
ax.set_axis_off()
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.
I'm aware I hadn't addressed all of your review comments -- looking now! Thanks.
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.
Yes, I think it is helpful: It makes it easier to follow the rest of the story. I've added the plot in d82d754. I couldn't resist but use facet_col
with plotly's imshow... ❤️ @emmanuelle 😉
Co-authored-by: Gregory R. Lee <grlee77@gmail.com>
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.
Thanks @mkcor. I am approving this now, but please see one other suggestion regarding potentially showing the eigenvalue images themselves.
Thank you @mkcor 🎉. |
Description
Addresses part of #4831.
With this PR, I'm following up on #4831 (comment).
@emmanuelle I tried telling a story but, in terms of applications, it's more didactic than scientific.
@GenevieveBuckley I used a small region of the kidney image!
I wanted to include some 3D rendering with Plotly, like:
but it would only spit out a JSON:
(plus it would be too heavy).
Checklist
./doc/examples
(new features only)./benchmarks
, if your changes aren't covered by anexisting benchmark
For reviewers
later.
__init__.py
.doc/release/release_dev.rst
.