```edpiecepoint(1)             General Commands Manual            edpiecepoint(1)

NAME
edpiecepoint - edit a list of piece coordinates

SYNOPSIS
edpiecepoint  [options] [input_file] output_file

DESCRIPTION
This program allows one to "edit" a list of piece coordinates, or a
list of integer point coordinates, in three ways: 1) The set of Z val-
ues may be mapped, one-to-one, to any arbitrary new set of Z values;
and 2) The X, Y or Z coordinates of all pieces or points may be shifted
by a constant.  3) The overlap between pieces can be changed.  In addi-
tion, one can create a new piece list for single frame images or mon-
taged images.  The pieces can be ordered in rows, in columns, or even
progressing in Z first for each montage position.

The remapping of Z values is specified by a list of values (comma-sepa-
rated ranges, e.g. 0-3,5-7).  This list must have the same number of Z
values as in the input list of Z values.  The Z values in the input
list will be mapped one-to-one onto the new list.  Enter "/" to take
the input list without modification Enter numbers between -999 and -990
to delete points with a particular Z value; e.g. if the input list has
Z values from 0 to 9, entering 0-4,-999,5-8 will delete all points with
Z between 4.5 and 5.5, and shift the Z of points with Z greater then
5.5 down by 1.  If the input list has Z from 0-19, entering
0-9,-999--990 will remove all points with Z from 10 to 19.  Enter -1 to
replace each Z value with its negative.

When you create a new piece list, you control the overlap between
pieces by entering a spacing instead.  This spacing is the frame size
minus the overlap; e.g., for a size of 2048 and an overlap of 10%, one
would enter 2048 - 204 = 1844.  Spacing can be measured by taking the
difference between the coordinates of corresponding points in adjacent
pieces.  For example, if a feature is at an X coordinate of 1800 in one
piece and at 100 in the piece to the right, then the spacing in X is
1800 - 100 = 1700.  Enter a negative number for X spacing if pieces are
ordered from right to left, or a negative number for Y spacing if
pieces are ordered from top to bottom.  Enter / if you just have one
piece.

OPTIONS
Edpiecepoint uses the PIP package for input (see the manual page for
pip) and can still take sequential input interactively.  The follow-
ing options can be specified either as command line arguments (with the
-) or one per line in a command file or parameter file (without the -).
Options can be abbreviated to unique letters; the currently valid
abbreviations for short names are shown in parentheses.

-input (-i) OR -InputFile      File name
Input piece list or point file.  If this option is not entered
and -create is not entered, the first non-optional argument will
be used for an input file.

-output (-ou) OR -OutputFile   File name
Output piece list or point file.  If this option is not entered,
the second non-optional argument will be used if -create is not
entered; otherwise the first non-option argument will be used
for an output file.

-create (-cr) OR -CreateForSections      Integer
Number of sections to create a new piece list for

-pieces (-pi) OR -PiecesInXandY     Two integers
Number of pieces in X and Y in the newly created piece list

-spacing (-sp) OR -SpacingInXandY   Two integers
Spacing between the pieces in X and Y in the newly created piece
list.  Enter the negative of a spacing to have pieces coordi-
nates put out in inverse order, from high to low coordinates.
For how to determine the desired spacing, see above.

-columns (-co) OR -ColumnsOfPieces
Order pieces in a newly created piece list so that successive
pieces occur in columns (in Y) rather than in rows (in X).

-stacks (-st) OR -StacksOfPieces    Integer
Order pieces in a newly created piece list so that successive
pieces go through the entire set of Z values at each position in
X and Y.  Enter 1 to have pieces in order by Z, or -1 for pieces
in inverse order.  This option can be used together with the
-columns option.

-divide (-d) OR -DivideByBinning    Integer
This option can be used to make a new piece list that works with
binned images.  Rather than just dividing the existing coordi-
nates by the binning, the program determines a new overlap value
and makes sure that coordinates are regularly spaced apart.  To
do this, it needs the image sizes before and after binning,
entered with -size and -binned.

-overlap (-ov) OR -NewOverlapInXandY     Two integers
This option can be used to change the overlap between pieces in
a piece list.  Enter the new overlaps in X and Y, and enter the
size of the pieces with the -size option.

-size (-si) OR -SizeInXandY    Two integers
Size of pieces in X and Y.  This entry is required to adjust
overlap or to divide by binning; in the latter case enter the
full size of the unbinned images to which the input piece list
corresponds.

-binned (-b) OR -BinnedSizeInXandY       Two integers
New, binned size of pieces in X and Y (required to divide by
binning)

-new (-n) OR -NewZList    List of integer ranges
List of Z values to map old list to.  There must be as many val-
ues in this list as in the list of Z values to remap.  See notes
above on the contents of this list.

Amount to add to all coordinates in X, Y, and Z, after remapping

-param (-pa) OR -ParameterFile      Parameter file
Read parameter entries as keyword-value pairs from a parameter
file.

-help (-h) OR -usage
Print help output

-StandardInput
Read parameter entries from standard input.

INTERACTIVE INPUT
If there are no command-line arguments, Edpiecepoint takes sequential
input the old way, with the following entries:

Name of input piece or point list file, or Return if none

IF you enter "Return", then the program will create a new piece
list.  Then make the following 4 entries:

Number of sections (N) for which to make piece coordinates.  The Z
coordinates will initially run from 0 to N-1, and the lower left X
and Y coordinates will be 0.

Number of pieces in X and in Y (enter / for 1,1)

Spacing between pieces in X and in Y.  See above.

0 if pieces progress along rows in the image file, or 1 if they
progress along columns.

Name of output piece or point list file

New list of Z values.  See above.

Amounts to add to all X, Y, and Z coordinates.  These values will be
added after the remapping of Z values, if any.

EXAMPLES
Suppose you have a 3x3 montage of pieces of 2048x2048 with a 20% over-
lap, which is 410 pixels.  In this case the spacing is 2048 - 410 =
1638.  If pieces are taken in rows from the left to right, and from
bottom to top, namely in this order:
7  8  9
4  5  6
1  2  3

then the command is:
edpiecepoint -create 1 -pieces 3,3 -spacing 1638,1638 output.txt

If pieces are taken in columns from bottom to top, as SerialEM does, in
this order:
3  6  9
2  5  8
1  4  7

then the command is:
edpiecepoint -create 1 -pieces 3,3 -spacing 1638,1638 -columns
output.txt

If pieces are taken from left to right in rows but from the top down,
like this:
1  2  3
4  5  6
7  8  9

then the spacing in Y is negative, and the command is:
edpiecepoint -create 1 -pieces 3,3 -spacing 1638,-1638 output.txt

Suppose you start with a stack of images (say, 3) at each Z position
and the stacks are numbered like this: s11.mrc  s12.mrc  s13.mrc
s21.mrc  s22.mrc  s23.mrc s31.mrc  s32.mrc  s33.mrc

and stack those into a single stack with:
newstack s*.mrc allstack.mrc

Then the section numbers of in the stack of the images in the succes-
sive Z planes are:
1  4  7         2  5  8         3  6  9
10 13 16        11 14 17        12 15 18
19 22 25        20 23 26        21 24 27

If these images are from block-face imaging and are stacked in the
order they were taken, then the first plane of images needs to be at
the top of the volume to maintain handedness.  In this case the command
is:
edpiecepoint -crea 1 -piec 3,3 -spac 1638,-1638 -stac -1 output.txt

HISTORY
Written by David Mastronarde, 5/8/89

BUGS
Email bug reports to mast at colorado dot edu.

IMOD                                4.11.0                     edpiecepoint(1)
```