What's the different meaning of mode in pif file?

128 views
Skip to first unread message

dawnsong

unread,
May 18, 2012, 8:04:45 AM5/18/12
to Auto3DEM
After I used EMAN1 to box out all the particles, and by bconvert from
BSoft to transform all the particle image stacks to pif files, I found
the mode is set as 9.

And Auto3dEM's imgstats can't read my image's pif, and complained with
"Invalid map mode 9 - mode must equal 6, 20, 40, or 46".

I want to try fixpif provided by Auto3DEM, but fixpif always failed in
my system RHEL5.5.
I don't know why. And howto fix the pif header's mode to 6 20 40 or 46
to make auto3dem run without errors any more.
Please help me, thanks.

dawnsong

unread,
May 18, 2012, 8:18:14 AM5/18/12
to Auto3DEM
And if I use fixpif to edit each particles's mode, the fixpif shutdown suddenly and the file size reach 5.7E!
Could you provide an pure-command line version of fixpif?
Or any other way to make sure the pif in Auto3dEM compatible with bsoft (1.8.1) converted version?

Thanks,

Xiaowei Song

Che-Yen Wang

unread,
May 18, 2012, 12:20:49 PM5/18/12
to auto...@googlegroups.com
Hi Xiaowei,

I also use EMAN to box particles and convert them into pif for data processing. The way I do it may be somewhat complicated, but it works without any problem. I am assuming that you save your box stack in .img/.hed format when you use boxer. The way I do it is:
use em2em to convert .img/.hed to .mrc  (in MULTIPLE_2D)
and use mrc2pif convert them into the pif stack.

You should be able to put this into a shell script which will save your time.

Best,
Joseph

On Fri, May 18, 2012 at 8:18 AM, dawnsong <dawnsong...@gmail.com> wrote:
And if I use fixpif to edit each particles's mode, the fixpif shutdown suddenly and the file size reach 5.7E!
Could you provide an pure-command line version of fixpif?
Or any other way to make sure the pif in Auto3dEM compatible with bsoft (1.8.1) converted version?

Thanks,

Xiaowei Song

On Fri, May 18, 2012 at 8:04 PM, dawnsong <dawnsong...@gmail.com> wrote:
After I used EMAN1 to box out all the particles, and by Hi

Giovanni Cardone

unread,
May 18, 2012, 1:10:01 PM5/18/12
to auto...@googlegroups.com
Hi Xiaowei,

in addition to the suggestion from Joseph, you can try to use another two-step approach:
1. use bconvert to convert all your stacks of particles to the mrc format (even if they already are so), but make sure that the output data format is integer by adding the option "-data int"
2. convert from mrc to pif using mrc2pif, which guarantees that the boxes are odd size. In the next version of the software I will add an option in autopp to perform this operation in batch mode.
If you still have problems with the conversion, using one of those two methods, just let me know.

As a side note, if you want to box particles in Robem, the conversion of micrographs from mrc to pif can still be done with bconvert, but using the option "-data short" (short integer format). If you have micrographs in dm3 format, in the soon coming version of AUTO3DEM there will be an internal program to do the conversion.

Regarding fixpif, I don't experience any problem on Linux Centos 5, which is close to RHEL 5.5. Probably it depends on the fact that more than one field needs to be fixed, in order for the file to be written properly. If send me an example, or just a procedure that reproduces the problem, I can dig into it.

Giovanni

Che-Yen Wang

unread,
May 18, 2012, 1:55:12 PM5/18/12
to auto...@googlegroups.com
Hi,

Comments on boxing particles by Robem if the micrograph is in .dm3 format.
I normally convert .dm3 to .mrc and then convert them to .pif;
however, I found there is a problem when converting micrograph from .mrc to .pif
which can be fixed by changing the source code.

Taking v4.01.12 as an example:
modify the source code of mrc2pif.f
at line 190, change jmode = 46 to jmode = 20
and recompile the program

Now, to convert .dm3 to .pif can be done by:
use proc2d to convert .dm3 to .mrc
use mrc2pif to convert .mrc to .pif 

Best,
Joseph

Giovanni Cardone

unread,
May 18, 2012, 2:06:03 PM5/18/12
to auto...@googlegroups.com
Hi Joseph,

thank you for the suggestion. Indeed we need to make mrc2pif able to support better different modes of the mrc files.
Regarding dm3 files, in the next version you will find a new routine, dm32pif, that aims to do the conversion in just one step, in batch mode, so to make conversion easier.

Giovanni

dawnsong

unread,
May 21, 2012, 2:30:02 AM5/21/12
to auto...@googlegroups.com
Thank you, Joseph and Giovanni,

I understand the key of what Giovanni means is to make mrc store integer values, am I correct?

Now it seems that MPICH2 lib not compatible with P3DR, I used mpich2 to compile EMAN1's mpi make3d, but failed to run P3DR, is there any config/compile parameters special required for P3DR?

Xiaowei


On Sat, May 19, 2012 at 2:06 AM, Giovanni Cardone <gcar...@ucsd.edu> wrote:
Joseph,

thank you for the suggestion. Indeed we need to make mrc2pif able to support better different modes of the mrc files.
Regarding dm3 files, in the next version you will find a new routine, dm32pif, that aims to do the conversion in just one step, in batch mode, so to make conversion easier.

Giovanni



--
Xiao-Wei Song
Ping Zhu's Lab,  National Laboratory of Biomacromolecules 
Institute of Biophysics, Chinese Academy of Sciences
15 Datun Road, Chaoyang District, Beijing, China 100101
Tel:  +86-10-64888353, E-mail: dawn...@moon.ibp.ac.cn

Giovanni Cardone

unread,
May 21, 2012, 1:22:14 PM5/21/12
to auto...@googlegroups.com
Hi Xiaowei,

in AUTO3DEM short integer (2 bytes) and integer (4 bytes) formats work better for micrographs and stacks of particles, respectively.

Regarding the library MPICH2, this is the one we always use in our Laboratory without problems. This library comes already compiled in many Linux distributions (we use CentOS), therefore we don't require any special configuration. If you can provide more information on how you compile the library and explain what do you mean when you say that the library is not compatible, I can try to help you.

Giovanni

dawnsong

unread,
May 21, 2012, 11:42:38 PM5/21/12
to auto...@googlegroups.com
Hi, Giovanni,

What I used to compile EMAN1 make3d of mpich2 is:
--enable-sharedlibs=gcc --enable-shared --enable-cxx

I feel very strange about P3DR not working, because for the demo data, parallel P3DR works fine, for my data, it does not. Maybe it is because the data I did not normalize or re-scale to a large integer range.

I would try to make the particles scale to integer.

Thanks.

Xiaowei


On Tue, May 22, 2012 at 1:22 AM, Giovanni Cardone <gcar...@ucsd.edu> wrote:
in AUTO3DEM short integer (2 bytes) and integer (4 bytes) formats work better for micrographs and stacks of particles, respectively.



dawnsong

unread,
May 22, 2012, 1:07:22 AM5/22/12
to auto...@googlegroups.com
Hi,  Joseph,

I also tried your modification method, but after the change, when I change mrc to pif, the file size seems only have an header without data in it, only 1024 bytes for pif. 
The mrc is got by proc2d raw.mrc raw.bin2.mrc shrink=2
My version is 4.01.12, I don't know why.
Any further hints?
Thank your!

Xiaowei

Che-Yen Wang

unread,
May 22, 2012, 3:09:08 AM5/22/12
to auto...@googlegroups.com
Hi Xiaowei,

My bad... it is a typo!


at line 190, change jmode = 46 to jmode = 2

It should be changed to 2 not 20!
I have tested it with shrink=2 and it works.
You can just go to the directory: convert and type 'make',
so you don't need to re-compile everything.
 
Best,
Joseph

dawnsong

unread,
May 22, 2012, 5:07:30 AM5/22/12
to auto...@googlegroups.com
Thank you, Joseph, it works now!

Xiaowei
Reply all
Reply to author
Forward
0 new messages