Contents
Transforming Images (Applying Rotation, Translation, Scale and Mirroring)
What follows is a very simply demonstration of using the Transform object to transform EMData (image) objects. A very thorough explanation of using the Transform is presented in Using the EMAN2 Transform class and you are encouraged to at least be aware of that page's existence.
Using EMData.transform
The first example here is a 3D example.
1 [someone@localhost]# e2.py
2
3 Welcome to EMAN2
4 Prompt provided by IPython
5 Enter '?' for ipython help
6
7
8 In [3]: e = test_image_3d() # 3D test image
9
10 In [4]: t = Transform({"type":"eman","az":45,"alt":90})
11
12 In [5]: t.set_trans(1,-2,5)
13
14 In [6]: t.set_scale(2.0)
15
16 In [7]: e.transform(t)
17
18 In [8]: display(e)
This second example is a 2D example.
Using the Processor Framework
You can use the processor framework to process an EMData object in and out of place. This can be useful when you wish to operate on a copy of the original image, as opposed to altering it.