Image rotation and flip between leginon and DM for Ultrascan 4K
Added by Thomas Klose about 10 years ago
Dear all,
While running some of the alignments on our KRIOS today I discovered that the image orientation displayed in Leginon is different from the one on the Flucam viewer and the one shown in DigitalMicrograph. The problem seems to be comparable to what has been described for the K2 in [[http://emg.nysbc.org/boards/6/topics/2134]], but we are using DigitalMicrograph 1.83 and an Ultrascan 4K. Is there a way to switch the orientation to be the same as in DM or would be better to have dedicated Leginon settings for flipping and rotation in DM?
Thanks,
Thomas
beam2.jpg (238 KB) beam2.jpg | DM view | ||
flucam.PNG (429 KB) flucam.PNG | Flucam view | ||
leginon.png (465 KB) leginon.png | Leginon view |
Replies (4)
RE: Image rotation and flip between leginon and DM for Ultrascan 4K - Added by Anchi Cheng about 10 years ago
Thomas,
Is your camera connect to Leginon through gatan.Gatan or dmsem.DMSEM ? You can tell from the camera name shown in Leginon interface.
This problem is worth fixing because it disorient the users.
Until I make a general fix, you can transpose this image before it is saved and displayed.
Look for pyscope folder on the computer controlling the camera. You will find gatan.py in there.
If you use gatan.py, find these lines
self.exposure_timestamp = (t1 + t0) / 2.0 return image
insert the following line before them
image = numpy.transpose(image)
RE: Image rotation and flip between leginon and DM for Ultrascan 4K - Added by Thomas Klose about 10 years ago
Hi Anchi,
The camera is listed as Gatan in the Leginon interface and our instrument.cfg has the Camera listed as gatan.Gatan. During the setup I did check that the orientation on the Flucam Viewer was the same as the one shown in DigitalMicrograph, I only discovered the mismatch when I was attempting to improve the alignment between two presets, which would move the image in the exact opposite direction of what I had clicked in the alignment window. I will try the fix today and report back.
RE: Image rotation and flip between leginon and DM for Ultrascan 4K - Added by Thomas Klose almost 10 years ago
Hi Anchi,
I finally got to test the workaround and numpy.transpose did the trick, although I do not quite understand why. I would have anticipated that the image needs to be rotated as well as flipped.
Thanks for your help,
Thomas
RE: Image rotation and flip between leginon and DM for Ultrascan 4K - Added by Anchi Cheng almost 10 years ago
Leginon displays images with origin at top left corner. Transpose represents a flip on the diagonal axis passing the origin.