to extract a frame from tif stack

666 views
Skip to first unread message

C.J.

unread,
Apr 27, 2017, 9:56:19 AM4/27/17
to em...@googlegroups.com
Hi Steve,

I have a tif file of 2 frame and I want to extract one frame and output as a singal file.
But I failed.
When I view the file with e2display.py.  The "Dim" is 3716x3216 and the "N" is 2.
When I tried to use e2proc2d to extract the frame as following, the "Dim" of new file is 3716x3216x2 and the "N" became 1.

e2proc2d.py t.tif t.mrc --first 0 --last 0
2 images, processing 0-0 stepping by 1
1 images

When I tried option "--threed2twod", the t.tif was not a 3D image.

e2proc2d.py t.tif t.mrc --first 0 --last 0 --threed2twod
Error: need 3D image to use this option

Would you help me with this problem? Thank you!

Best regards,
Jianhao

Steve Ludtke

unread,
Apr 28, 2017, 12:08:09 AM4/28/17
to em...@googlegroups.com
e2proc2d.py appends to the output file by default. It also distinguishes between X.mrc files in which stacks are 3-D and X.mrcs files where stacks are multiple images. Note that the files themselves are basically identical. The filename is the only distinguishing factor. Technically the recently defined MRC standard update does have a flag in the header indicating which of these things the file contains, but while EMAN supports this (I think), most software does not.

That is, if you run:

e2proc2d.py t.tif t.mrcs --first 0 --last 0

and t.mrcs does not exist, it will create it with a single image. If you run it a second time, it will add a copy of the image to the end of the file and there will be 2 images in the output.  If you don't want the appending behavior, add the --inplace option to the command line.

----------------------------------------------------------------------------
Steven Ludtke, Ph.D.
Professor, Dept. of Biochemistry and Mol. Biol.                Those who do
Co-Director National Center For Macromolecular Imaging            ARE
Baylor College of Medicine                                     The converse
slu...@bcm.edu  -or-  ste...@alumni.caltech.edu               also applies
http://ncmi.bcm.edu/~stevel

--
--
----------------------------------------------------------------------------------------------
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/d/optout.

C.J.

unread,
Apr 28, 2017, 1:08:27 AM4/28/17
to em...@googlegroups.com
Thank you, Steve. I did ignore the difference between mrc and mrcs.

regards,
Jianhao

To unsubscribe from this group, send email to eman2+unsubscribe@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+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--
--
----------------------------------------------------------------------------------------------
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+unsubscribe@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+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
Best regards!
C.J.

edoardo....@gmail.com

unread,
May 5, 2017, 4:04:25 AM5/5/17
to EMAN2
Dear Steven,

regarding a similar issue: could you please let me know the correct syntax for e2proc2d.py --ustacking option? I tried several combinations and either I get the file.mrcs used as input in the output (it didn't unstack the frames/images) or it does not preserve the rootname and outputs the single frames but with .mrcs as extension.

I am using EMAN 2.12 (GITHUB: Thu Mar 10 13:00:38 2016)
Your EMAN2 is running on: Linux-3.10.0-514.6.2.el7.x86_64-x86_64-with-centos-7.3.1611-Core 3.10.0-514.6.2.el7.x86_64
Your Python version is: 2.7.3

Many thanks in advance,

Edoardo

edoardo....@gmail.com

unread,
May 5, 2017, 4:05:35 AM5/5/17
to EMAN2
Sorry for the typo "--unstacking".

Edoardo

Steve Ludtke

unread,
May 5, 2017, 8:14:45 AM5/5/17
to em...@googlegroups.com
Hi Edoardo, 
you didn't say what you were actually trying to do?

.mrc and .mrcs files are identical internally, but are treated differently by EMAN2. This is a hack due to the fact that people create 2-D "MRC stacks" which are actually a single 3-D volume, but the file format doesn't have a (single widely implemented) way to distinguish internally between 3-D volumes and stacks of particles. 

If you use a file with the .mrcs option with ANY EMAN2 program it will be treated as a set of 2-D images. The same file with .mrc extension will be treated as a 3-D volume. Basically every other CryoEM format actually distinguishes between stacks of 2-D images and 3-D volumes (and a few actually support stacks of volumes without any obscene hacks). 

e2proc2d.py (and e2proc3d.py) are designed to work with files that contain sets of 2-D (or sets of 3-D) images. 

The --unstacking option is designed to take a file containing N images and output N files each containing a single image, eg -

e2proc2d.py file.mrcs out.mrcs --unstacking

will produce out-1.mrcs, out-2.mrcs, ...


----------------------------------------------------------------------------
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                             





edoardo....@gmail.com

unread,
May 5, 2017, 8:57:06 AM5/5/17
to EMAN2
Dear Steven,

I was trying to "unstack" in batch frames from movies and or class averages from a single .mrcs file. That worked perfectly.

Thanks a lot also for your kind explanation.

Cheers,

Edoardo
Reply all
Reply to author
Forward
0 new messages