napari icon indicating copy to clipboard operation
napari copied to clipboard

Support for non-orthogonal slicing (specifically solid transformations)

Open jules-vanaret opened this issue 4 months ago • 4 comments

🚀 Feature

Currently, a rotated layer via layer.rotate is correctly displayed in 3D, but after switching to 2D, the layer is not displayed correctly and following message appears:

Non-orthogonal slicing is being requested, but is not fully supported. Data is displayed without applying an out-of-slice rotation or shear component.

I know

  • that this has already been asked for in the past (e.g #2616 #3410 #4205)
  • that "consistent transformations" is part of the roadmap as per @jni's message in #2616
  • that this is a complex problem

I was just wondering

  • if a simpler solution could be found specifically for the case of solid transformations (i.e translation + true rotation)
  • if yes, if someone could point me to the relevant part of the code that would need to be modified so that I can try to work on a PR

Motivation

I am the developer of the plugin napari-manual-registration, which allows users to manually find the optimal solid transformation to register two views of the same sample. One of the feature of this plugin is to provide sliders to directly set the values of each transformation component individually. When a translation is specified, I can use layer.translate which allows for immediate visualization of the result. When a rotation is specified, I currently rotate the array itself (!) using pyclesperanto_prototype.rotate as a brute force solution to the aforementioned problem. On a good computer with a GPU, the result displays almost instantly, but this is of course not ideal for all other cases. This was pointed out by @JoOkuma here by the way.

jules-vanaret avatar Oct 01 '24 14:10 jules-vanaret