brisvag / blik

Python tool for visualising and interacting with cryo-ET and subtomogram averaging data.
https://brisvag.github.io/blik/
GNU General Public License v3.0
23 stars 8 forks source link

Suggestion: show tomograms in the same orientation as IMOD #157

Open rdrighetto opened 6 months ago

rdrighetto commented 6 months ago

(separate topic, separate issue)

Hi again Lorenzo,

If I may suggest, would it be possible to make blik display the tomogram in the same orientation as IMOD and ChimeraX, at least as an option? Or if this option is already available somewhere in blik or napari, can you please let us know?

image image image

It seems there is a mirroring around the X axis going on, presumably because of how Python loads the data. I know this is probably only a visualization thing, and I don't know if it would violate any internal napari conventions, but would be nice to be able to look at the data in the same way as other visualization tools commonly used in cryo-ET.

(FWIW, Amira does the same mirroring thing...)

Thanks a lot!

brisvag commented 6 months ago

The flip is in Y, and that's because napari has the origin at the top left like most graphics programs, instead of swapping it to the bottom left like IMOD and Co do.

While it's easy to do the flip, it's a bit trickier for annotations because we'd have to flip coordinates, accounting for different scales and shifts of the origin if any. Should be doable, I just need to be careful :P I'll play around with it and see if it makes sense.

brisvag commented 6 months ago

FYI if it's just for visualisation and you need it to work now, you can just do:

layer.data = layer.data[:, ::-1]

to flip it.

rdrighetto commented 6 months ago

Hi Lorenzo, thanks a lot for the clarifications and the snippet! If you manage to include this option it would be awesome, but it's not urgent. It's no big deal as long as everything is consistent :-)