e2proc2d.py fftavg option

227 views
Skip to first unread message

Rui Zhang

unread,
Jan 10, 2014, 6:39:24 PM1/10/14
to em...@googlegroups.com
Hi, Steve,

I tried the command e2proc2d.py test.hed 1.hed --fftavg=test.tnf
If I use the EMAN1 "v2" viewer to open the resulting test.tnf file, it says "Error: Incomplete data read 0/512 blocks"
and the image looks like the one in the attachment.

Did I miss something here?

P.S. the eman1 command proc2d test.hed 1.hed fftavg=test.tnf works fine.

Thanks!

Rui
test.tnf

Steven Ludtke

unread,
Jan 10, 2014, 10:12:46 PM1/10/14
to em...@googlegroups.com
Hi Rui. The TNF file you sent is square, and not complex.  I just tried an equivalent e2proc2d.py command with the current CVS version of EMAN2, and it produced an appropriate TNF file (complex with 2 more pixels in x than y, as it should be).   What version are you using ?  It is possible it was broken at some point in the past...

----------------------------------------------------------------------------
Steven Ludtke, Ph.D.
Professor, Dept of Biochemistry and Mol. Biol.         (www.bcm.edu/biochem)
Co-Director National Center For Macromolecular Imaging        (ncmi.bcm.edu)
Co-Director CIBR Center                          (www.bcm.edu/research/cibr)
Baylor College of Medicine                             





--
--
----------------------------------------------------------------------------------------------
You received this message because you are subscribed to the Google
Groups "EMAN2" group.
To post to this group, send email to em...@googlegroups.com
To unsubscribe from this group, send email to eman2+un...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/eman2
 
---
You received this message because you are subscribed to the Google Groups "EMAN2" group.
To unsubscribe from this group and stop receiving emails from it, send an email to eman2+un...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
<test.tnf>

Rui Zhang

unread,
Jan 10, 2014, 10:35:59 PM1/10/14
to em...@googlegroups.com
Hi, Steve,

I am using eman2.05. 
Sorry, it was just a png image in my previous email. Please see the real TNF file in the attachment.

Rui
test2.tnf

Steven Ludtke

unread,
Jan 11, 2014, 12:34:40 AM1/11/14
to em...@googlegroups.com
Hi Rui. Sorry, I wasn't really paying attention to the first message. The only 2 formats we really support writing FFTs to are HDF and (pre 2.1) BDB. Even if the format supports it, there are a lot of annoying issues with varying FFT conventions, so we made a conscious decision not to support writing FFTs to disk in any broad way. You are correct, that it looks like TNF's should work, but clearly the files don't get written properly. 

<test2.tnf>

Rui Zhang

unread,
Jan 11, 2014, 3:07:42 AM1/11/14
to em...@googlegroups.com
Hi, Steve,

Thank you for clarifying that!
What I really want is to sum up a bunch of power spectra of aligned helical images.
Which eman2 function can I use at the python level?

Thanks!

Rui 

Steven Ludtke

unread,
Jan 11, 2014, 10:31:59 PM1/11/14
to em...@googlegroups.com
If they are aligned, then shouldn't you be doing a coherent average (or average in real-space) before computing the power-spectrum ?

This is the code from the --fftavg option, which works correctly (it's just the file-saving you were having issues with):

if not fftavg:
fftavg = EMData()
fftavg.set_size(nx+2, ny)
fftavg.set_complex(1)
fftavg.to_zero()
d.process_inplace("mask.ringmean")
d.process_inplace("normalize")
df = d.do_fft()
df.mult(df.get_ysize())
fftavg.add_incoherent(df)

Most of what the above code does should be pretty obvious. You can display the results easily in e2.py with:

display(image)

If you're writing your own script and want to bring up a GUI, it takes a notch or two more effort. You can use display() there too for a quick solution, but you'll have to close the display window before the script will continue. 

Also note that the script above assumes unaligned images, ie - the averaging is incoherent.

Rui Zhang

unread,
Jan 11, 2014, 11:29:45 PM1/11/14
to em...@googlegroups.com
Hi, Steve,

Thanks!
My particles are helical particles (microtubules) with 90% overlap, so averaging a few aligned overlapping particles in real space will cause the same noise pattern to repeat in my final average, this will leads to artificial layer lines. That's why I am sending this email : >
For this reason, sum of power spectra of aligned images  power spectrum of sum of aligned images.

Reply all
Reply to author
Forward
0 new messages