-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Optimize 3D display #6085
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
Optimize 3D display #6085
Conversation
attn @WeatherGod |
You have a lot of test failures: https://travis-ci.org/matplotlib/matplotlib/jobs/112810572 |
minz = 1e9 | ||
for (xs, ys, zs) in xyslist: | ||
minz = min(minz, min(zs)) | ||
minz = np.min(xys[:, :, 2]) |
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.
We are not guaranteed a non-empty array, hence the initialization of minz with 1e9.
@AlexandreAbraham any progress on this front? |
+1 to this. I still haven't found a good method for plotting 3-D brains w/ points on top of it in python. Making a trisurf is super slow when I have lots of triangles. |
Hi, |
a3bdaf8
to
6315961
Compare
'power cycled' to restart the CI against current master. |
Looks like there is a problem in one of the examples
|
I guess my point is more "let's not add more public API". |
Hi @AlexandreAbraham |
Hi, I ended up here from this paper: https://riojournal.com/articles.php?id=12342 I'd be very interested in using the method in the paper, but I'm finding the speed that it can be accomplished with the current implementation of 3d meshses is a dealbreaker. Is there hope for this PR moving forward? |
+1 to this PR moving forward |
ok, I'll make it a priority this week during SciPy.
…On Wed, Jul 12, 2017 at 10:11 AM, Chris Holdgraf ***@***.***> wrote:
+1 to this PR moving forward
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#6085 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AARy-Lv2kePQIHFLTlgb98P4Wy33BQm1ks5sNNQCgaJpZM4HmSzk>
.
|
I think that this is the PR that @GaelVaroquaux mentioned to me earlier this week. |
lmk if you want someone to usertest this at the sprint. I can bring some brain surfaces :-) |
There are several unaddressed comments from @Kojoley . I am currently working on rebasing this as well. I'll force-push a rebase soon (if github allows me). |
doesn't look like github will let me, so, I'll do it the old way and submit a PR against your branch. |
hmmph, that won't work, either. @AlexandreAbraham , do you see any option to allow maintainers to push changes to your PR on this page? |
self._segments3d_data = np.vstack(segments) | ||
# Add a fourth dimension for quaternions | ||
self._segments3d_data = np.hstack([self._segments3d_data, | ||
np.ones((n_segments, 1))]) |
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.
This would be marginally better as
self._segments3d_data = np.empty((n_segments, 4))
self._segments3d_data[:,:3] = segments
self._segments3d_data[:,3] = 1
Also, are you sure you mean "quaternion" and not "homogenous coordinate"?
cum_s = 0 | ||
for s in self._seg_sizes: | ||
segments_2d.append(xys[cum_s:cum_s + s, :2]) | ||
cum_s += s |
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 this loop is np.split
in some form
tis = vecw[1] < 1 | ||
vecw /= vecw[3] | ||
# Integrating tis in the numpy array for optimization purposes | ||
vecw[3, :] = tis |
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.
Get rid of this colon - it makes the function fail on 1d inputs
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.
Storing coordinates in the first axis of the array is kind of unusual (see how np.linalg
and scipy.misc.imread
behave).
Perhaps these should all be xyz[..., 0]
instead of xyz[0]
?
This seems to have attracted lots of interest, but eventually never made it over the hump. @WeatherGod is there still some hope for this, or has its momment passed? |
Perhaps parts of this needs to be separated out into smaller PRs. There is
some good stuff here, but there were also some questionable stuff, too,
that never got addressed.
…On Wed, May 2, 2018 at 1:10 PM, Jody Klymak ***@***.***> wrote:
This seems to have attracted lots of interest, but eventually never made
it over the hump. @WeatherGod <https://github.com/WeatherGod> is there
still some hope for this, or has its momment passed?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#6085 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AARy-ENj7x-jsaEbU7onzowiCV_Giuu8ks5tueiYgaJpZM4HmSzk>
.
|
Closing as inactive. The goodies are here for anyone who wants them! |
If it's closed, what's the mechanism then for contributors to know that this PR is stalled, needs help and can be continued ?
Should be allowed by Github by default now.
Maybe someone might be interested in looking into it during the scipy sprint next week? |
If I understand correctly this PR rebased (as of July 2017) can be found in @WeatherGod 's https://github.com/WeatherGod/matplotlib/tree/pr/6085 branch. |
This PR was continued in #11577 |
While printing 3D objects, I noticed that the display was pretty slow. The reason is that matplotlib relies a lot on list of objects instead of using big numpy arrays to fasten 3D projections.
This PR aims at solving part of this problem. I replaced some airthmetic on list of vectors by artihmetic on big matrices. This impacts mainly 3D display.
I work on neuroimaging data. I noticed an approximate 25% speedup optimization on 3D display (depending on the complexity of the figure). Refreshment in interactive plotting is also faster. Example script:
Possible other optimizations:
@agramfort and @juhuntenburg, do you notice significant running time reduction with this PR?