Size: 1217
Comment:
|
Size: 1271
Comment:
|
Deletions are marked like this. | Additions are marked like this. |
Line 19: | Line 19: |
''or try a = test_image_3d(2), a = test_image(0) etc - see'' | ''or try a = test_image_3d(2), a = test_image(0) etc - see the [[EMAN2/Galleries/Testimages|test image gallery]].' |
The following example shows various ways of adding and multiplying images. The given example uses 3D images but the functionality generalizes for 2D images.
Set up 2 identical images
or try a = test_image_3d(2), a = test_image(0) etc - see the test image gallery.'
Make e different to f
Add and multiply images
1 In [13]: g = f + e # add two images, the result is stored in g
2
3 In [14]: display(g) # observe g
4
5 In [15]: f.add(e) # Add the pixels of e into f directly
6
7 In [16]: f.mult(e) # Multiple the pixels in f by the pixels in e
8
9 In [17]: g = f * e # Multiple the pixels in f by the pixels in e and store the result in g