Changing image format from real/imaginary to amplitude/phase format in EMAN2 is a straightforward procedure. To illustrate the process start with a test image and perform an inplace Fourier transform on it as follows:

   1 [someone@localhost] e2.py
   2 
   3 Welcome to EMAN2
   4 Prompt provided by IPython
   5 Enter '?' for ipython help
   6 
   7 In [3]:  e = EMData(32,32,32)
   8 
   9 In [4]:  e.process_inplace("testimage.axes")
  10 
  11 In [5]:  e.do_fft_inplace()

You now have an EMData object (e) in real/imaginary format. You can verify that the image is in this format by calling the function is_ri, for example try:

   1 In [6]:  e.is_ri()
   2 Out[6]:  True

To convert the image to amplitude/phase format simply do the following:

   1 In [7]:  e.ri2ap()
   2 
   3 In [8]:  e.is_ri()
   4 Out[8]:  False
   5 
   6 In [9]:  e.get(2,0,0)
   7 Out[9]:  62.0
   8 
   9 In [10]:  e.get(3,0,0)
  10 Out[10]:  3.1415927410125732

Note that it's relatively straightforward to access values from the EMData object (e) using the get function call, and that we have verified the EMData object is in amplitude/phase format using the function is_ri, as demonstrated above. Finally, you can convert back to to real/imaginary format by doing:

   1 In [11]:  e.ap2ri()
   2 
   3 In [12]:  e.is_ri()
   4 Out[12]:  True

EMAN2/Tutorials/ri2ap (last edited 2009-02-04 21:08:46 by DavidWoolford)