Differences between revisions 1 and 6 (spanning 5 versions)
Revision 1 as of 2008-02-12 23:06:04
Size: 199
Comment:
Revision 6 as of 2008-02-12 23:16:00
Size: 1050
Comment:
Deletions are marked like this. Additions are marked like this.
Line 1: Line 1:
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 a Fourier transform on it: 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:

{{{
[someone@localhost]$ e2.py

Welcome to EMAN2
Prompt provided by IPython
Enter '?' for ipython help

In [3]: e = EMData(32,32,32)

In [4]: e.process_inplace("testimage.axes")

In [5]: e.do_fft_inplace()

}}}

You now have an EMData object (e) in real/imaginary format. To convert the image to amplitude/phase format simply do the following:

{{{

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

In [7]: e.ri2ap()

In [8]: e.is_ri()
Out[8]: False

In [9]: e.get(2,0,0)
Out[9]: 62.0

In [10]: e.get(3,0,0)
Out[10]: 3.1415927410125732

}}}

Note that it's relatively straightforward to access values from the EMData object (e) using the get function call. Also, you can convert back to to real/imaginary format by doing:

{{{

In [11]: e.ap2ri()

In [12]: e.is_ri()
Out[12]: True

}}}

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:

[someone@localhost]$ e2.py

Welcome to EMAN2
Prompt provided by IPython
Enter '?' for ipython help

In [3]:  e = EMData(32,32,32)

In [4]:  e.process_inplace("testimage.axes")

In [5]:  e.do_fft_inplace()

You now have an EMData object (e) in real/imaginary format. To convert the image to amplitude/phase format simply do the following:

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

In [7]:  e.ri2ap()

In [8]:  e.is_ri()
Out[8]:  False

In [9]:  e.get(2,0,0)
Out[9]:  62.0

In [10]:  e.get(3,0,0)
Out[10]:  3.1415927410125732

Note that it's relatively straightforward to access values from the EMData object (e) using the get function call. Also, you can convert back to to real/imaginary format by doing:

In [11]:  e.ap2ri()

In [12]:  e.is_ri()
Out[12]:  True

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