glue-jupyter
glue-jupyter copied to clipboard
Updates for ipyvolume viewer issues
While Azmé and I were investigating the aspect ratio issue mentioned in #451, we noticed that currently, the displayed volume rendering in the ipyvolume viewer seems to be wrong (in particular, it doesn't match what's displayed in the vispy volume viewer). I believe this might also be a partial cause of #450.
I think this is an issue with axes. As an example, I looked at the reduced TAN C14 cube used in the astropy FITS cube tutorial here. If I open this in vispy, I get
but with the current ipyvolume viewer I get
which is what led me to believe that the data was being passed into the ipyvolume widget incorrectly. After rearranging the axes as is done in this PR (note that np.transpose
returns a view if possible, so we shouldn't need to worry about data getting copied), we get
This also fixes #451 for me, in that using the native aspect ratio now behaves the same as it does in vispy.
It's hard to tell how the changes to the ipyvolume viewer code affect the 3D scatter viewer since as #449 points out, it isn't working right now. Only thing I can check is that with these changes, the x/y/z labels indicate that it has a right-handed z-up coordinate system, so that's good.