Black Lives Matter. Please consider donating to Black Girls Code today.

"Visualizing MRI Volume Slices" in Offline Mode

I’m trying to follow the “Visualizing MRI Volume Slices in Python” example in offline mode, however I keep getting an empty plot. I’ve copied the code from the example verbatim, however I’ve omitted the line which uploads the grid:
py.grid_ops.upload(grid, ‘anim_sliceshead’+str(time.time()), auto_open=False)

And at the end, instead of:
py.icreate_animations(fig, filename=‘animslicesHead’+str(time.time()))
I substituted:
plotly.offline.plot(fig)

When I compile the script, a plot is opened in my web browser with a grid and a functional slider, however the graph is empty (no slices). The axes also appear to be scaled incorrectly. I tried substituting the image input data with my own numpy array to no avail.

@tpsatt The code for offline animation is a bit different. Here is an example: https://plot.ly/~empet/14887.

1 Like

@tpsatt Did you manage to do it offline?
I might need some help