Differences between revisions 2 and 3
Revision 2 as of 2011-07-01 16:54:12
Size: 354
Editor: SteveLudtke
Comment:
Revision 3 as of 2011-07-06 14:28:29
Size: 3648
Editor: SteveLudtke
Comment:
Deletions are marked like this. Additions are marked like this.
Line 5: Line 5:
=== Introduction to the EMAN2 Commmand-Line ===
The first thing to note is that EMAN2 uses standard unix-style command-line arguments rather than EMAN1 style arguments. For example:
''proc2d abc.hed def.spi clip=64,64'' --> ''e2proc2d.py abc.hed def.spi --clip=64,64''

=== Basic Image Processing ===
In direct analog to EMAN1, EMAN2 has ''e2iminfo.py'', ''e2proc2d.py'', ''e2proc3d.py''. As with EMAN1, both of the ''proc'' commands can be used to convert among any of EMAN2's supported [[Eman2DataStorage|file formats]], simply by using the correct extension for the output file.
There is also an ''--outtype'' option to manually specify the output format.

It is important to understand how both programs deal with image stacks (a single file with multiple images). In EMAN1, only 2-D images could exist in stacks, simply
because there were no 3-D file formats that supported multiple 3-D volumes at the time. That is no longer true, and HDF and BDB both support stacks of volumes. However, with 2-D images, stacks are used extensively, and with 3-D, only rarely. As a
result ''e2proc2d.py'' and ''e2proc3d.py'' handle stacks differently by default. ''e2proc2d.py'' will append images to the output stack unless ''--inplace'' is specified. ''e2proc3d.py'' on the other hand will overwrite images by default, unless the ''--append'' option
is specified. Finally, ''e2proc2d.py'' is capable of treating a single 3-D image as a stack of 2-D images in various ways. so:
 * ''e2proc2d.py file2d.hdf file2d.hdf --mult=-1'' - would make an inverted copy of all of the images in file.hdf and append them to the end, doubling the size of the stack
 * ''e2proc3d.py file3d.hdf file3d.hdf --mult=-1'' - would invert all of the 3-D volumes in file3d.hdf in-place. The file would be the same size when complete

Beyond this, a number of options have changed. In both e2proc2d.py and e2proc3d.py, it is now possible to construct filter chains; that is, a sequence of filters or other ''processors'' to apply to the image(s). This is done via the ''--process'' directive in
either program. There are currently over 175 different ''processors'' in 10 different categories, such as filters, masks, thresholds, mathematical, etc. Any of these ''processors'' can be applied in sequence using the directive ''--process=procname:option=value:option=value''.
You can get a list of available processors using ''e2help.py processor'' or ''e2help.py processor -v 2'' for more detail. If you prefer to see them via a GUI, the ''e2filtertool.py'' program allows you to graphically construct and edit filter chains.

One other important distinction between ''proc3d'' and ''e2proc3d.py''. For certain options in EMAN1, rather than specifying ''proc3d <input> <output>'' you would actually specify ''proc3d <input> <input>''; for example, when computing a FSC between two 3-D maps. Unfortunately,
this lead to mistakes, where someone specified ''<infile> <infile>'', but then forgot the ''fsc'' option and ended up overwriting the second input file. To prevent this, in EMAN2, ''e2proc3d.py'' is '''always''' ''e2proc3d.py <infile> <outfile>''. When performing an FSC,
''<outfile>'' becomes the name of the output FSC text file, and the second input is specified with the FSC option.





Transitioning from EMAN1 to EMAN2 with command line tools

While the workflow is the correct choice for many users, we realize that some prefer to manipulate their data more directly. Many users who wish to use the command line are doing so because they are trying to update existing scripts currently using EMAN1.

Introduction to the EMAN2 Commmand-Line

The first thing to note is that EMAN2 uses standard unix-style command-line arguments rather than EMAN1 style arguments. For example: proc2d abc.hed def.spi clip=64,64 --> e2proc2d.py abc.hed def.spi --clip=64,64

Basic Image Processing

In direct analog to EMAN1, EMAN2 has e2iminfo.py, e2proc2d.py, e2proc3d.py. As with EMAN1, both of the proc commands can be used to convert among any of EMAN2's supported file formats, simply by using the correct extension for the output file. There is also an --outtype option to manually specify the output format.

It is important to understand how both programs deal with image stacks (a single file with multiple images). In EMAN1, only 2-D images could exist in stacks, simply because there were no 3-D file formats that supported multiple 3-D volumes at the time. That is no longer true, and HDF and BDB both support stacks of volumes. However, with 2-D images, stacks are used extensively, and with 3-D, only rarely. As a result e2proc2d.py and e2proc3d.py handle stacks differently by default. e2proc2d.py will append images to the output stack unless --inplace is specified. e2proc3d.py on the other hand will overwrite images by default, unless the --append option is specified. Finally, e2proc2d.py is capable of treating a single 3-D image as a stack of 2-D images in various ways. so:

  • e2proc2d.py file2d.hdf file2d.hdf --mult=-1 - would make an inverted copy of all of the images in file.hdf and append them to the end, doubling the size of the stack

  • e2proc3d.py file3d.hdf file3d.hdf --mult=-1 - would invert all of the 3-D volumes in file3d.hdf in-place. The file would be the same size when complete

Beyond this, a number of options have changed. In both e2proc2d.py and e2proc3d.py, it is now possible to construct filter chains; that is, a sequence of filters or other processors to apply to the image(s). This is done via the --process directive in either program. There are currently over 175 different processors in 10 different categories, such as filters, masks, thresholds, mathematical, etc. Any of these processors can be applied in sequence using the directive --process=procname:option=value:option=value. You can get a list of available processors using e2help.py processor or e2help.py processor -v 2 for more detail. If you prefer to see them via a GUI, the e2filtertool.py program allows you to graphically construct and edit filter chains.

One other important distinction between proc3d and e2proc3d.py. For certain options in EMAN1, rather than specifying proc3d <input> <output> you would actually specify proc3d <input> <input>; for example, when computing a FSC between two 3-D maps. Unfortunately, this lead to mistakes, where someone specified <infile> <infile>, but then forgot the fsc option and ended up overwriting the second input file. To prevent this, in EMAN2, e2proc3d.py is always e2proc3d.py <infile> <outfile>. When performing an FSC, <outfile> becomes the name of the output FSC text file, and the second input is specified with the FSC option.

UNDER CONSTRUCTION

EMAN2/Eman1Transition/CommandLine (last edited 2015-03-06 03:49:27 by MichaelBell)