glue-jupyter icon indicating copy to clipboard operation
glue-jupyter copied to clipboard

Updates for ipyvolume viewer issues

Open Carifio24 opened this issue 8 months ago • 4 comments

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 Screenshot_2024-07-01_at_1 38 37_AM_optimized

but with the current ipyvolume viewer I get

Screenshot_2024-07-01_at_1 41 10_AM_optimized

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 Screenshot_2024-07-01_at_1 39 19_AM_optimized

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.

Carifio24 avatar Jul 02 '24 06:07 Carifio24