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

3D plots using neurone.plot.flow not properly visualised #34

Open
Kanyq opened this issue Apr 4, 2021 · 3 comments
Open

3D plots using neurone.plot.flow not properly visualised #34

Kanyq opened this issue Apr 4, 2021 · 3 comments

Comments

@Kanyq
Copy link

Kanyq commented Apr 4, 2021

Hello,

I'm trying to plot the flow field vectors for my 3D warping but the "flow" plot of neurite asks me to convert the 3D array into 2D+2 to plot it. So the actual array (1, 160, 160, 48, 3) has to be compressed to (54, 54, 16, 2) and I end up plotting (1, 54, 16, 2) for each flow plot, which does not give proper visualisation.
I'm squeezing the image in the following way:
flow = pred_warp.squeeze()[::3,::3,::3,::2]

pred_warp.shape = (1, 160, 160, 48, 3)
flow.shape = (54, 54, 16, 2)

Is there a way for me to plot the 3D flow plot or is there a better way to represent this flow vector? Thank you

flow

@adalca
Copy link
Owner

adalca commented Apr 4, 2021

@Kanyq thanks for the question -- can you check if the dev branch is better for you? @halleewong pushed a modification to the visualization tool that I think might be adressing your problem: 34ae090

@hy-23
Copy link

hy-23 commented Jul 29, 2022

May I ask what the blue and green colors mean? Initially I thought they were supposed to correspond to magnitude, but there seem to be vectors of approximately the same length in both blue and green.

@adalca
Copy link
Owner

adalca commented Jul 29, 2022

I would guess there's a directionality component, but I honestly forget -- we use plt.quiver under the hood for this one, so take a look at https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.quiver.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants