alterheader(1)                                                  alterheader(1)



NAME
       alterheader - to alter header information in an MRC file

SYNOPSIS
       alterheader  [filename]

DESCRIPTION
       Alterheader allows one to alter header information in an MRC file with-
       out rewriting the file.  The program can be run interactively or with
       command-line arguments.  When run interactively, for each standard
       header entry selected by the user, the program prints the current val-
       ues and asks for new values, checking for legality in some cases.
       Other operations can be performed as described below.  Multiple changes
       can be made.  When run interactively, the header is not written to the
       file until you enter DONE to exit the program, so you can interrupt
       with Ctrl-C to discard changes.  The interactive mode is thus much
       safer to use, although inconvenient from scripts.  The interactive
       entries for the different options are not case sensitive but are shown
       below in their upper-case form.

       Even when running interactively, the file name can be entered on the
       command line; if not, the program will ask for it.  However, the addi-
       tion of any option argument on the command line makes the program
       require a filename as well and run without any interaction.

       The MRC header stores three pieces of information about size: the num-
       ber of pixels in X, Y, and Z, which is output as "columns, rows, sec-
       tions", the sample grid size, output as "grid x,y,z", and the cell
       size, which is not directly output in the standard printing of the
       header.  The pixel spacing in Angstroms is defined to be the ratio of
       the cell size to the sample size in each dimension.  Programs in IMOD
       generally try to keep the sample size the same as the image size, and
       to set the cell size to achieve an appropriate pixel spacing.


OPTIONS
       When run with command-line arguments, Alterheader uses the PIP package
       for input (see the manual page for pip).  The order in which options
       are entered is not preserved with PIP input.  Options are processed in
       the same order as they are listed in the brief summary of options when
       running interactively, namely: -org, -cel, -dat, -del, -map, -sam,
       -tlt, -firsttlt, -rottlt, -mmm, -rms, -fixpixel, -feipixel, -extrafix,
       -modefix, -invertorg, -setmmm, -real, -fft, -ispg, -4bit, -toggleorg,
       -gridfix, -title.

       The following options can be specified either as command line arguments
       (with the -) or one per line in a command file or parameter file (with-
       out the -).  Options can be abbreviated to unique letters; the cur-
       rently valid abbreviations for short names are shown in parentheses.


       -org (-o) OR -Origin      Three floats
              (Interactive ORG)  Change the origin in X, Y, Z.  In IMOD, the
              origin is defined as the coordinates of the origin relative to
              the lower-left corner of the first section in the file, in units
              scaled by the pixel size.  The origin is defined in the opposite
              way in UCSF Chimera; use INVERTORG/-invertorg to switch the sign
              of the origin values.

       -cel (-c) OR -CellSize    Three floats
              (Interactive CEL)  Change the cell size in X, Y, Z.  This will
              show up as a change in pixel spacing, as described above.

       -del (-d) OR -PixelSize   Three floats
              (Interactive DEL)  Change the pixel size in X, Y, Z to given
              values.  The program will change the cell size so that the ratio
              of cell to sample size will give the entered pixel size.

       -map (-ma) OR -MapIndexes      Three integers
              (Interactive MAP)  Set mapping from X, Y, Z to rows, columns,
              sections.  The only effect of this in IMOD is to reorder the
              sample grid and pixel spacing values by the given mapping.  Do
              not use it.

       -sam (-sa) OR -SampleSize      Three integers
              (Interactive SAM)  Set sampling in X, Y, Z.  See note above on
              IMOD conventions.

       -tlt (-tl) OR -TiltCurrent     Three floats
              (Interactive TLT)  Change current tilt angles to given alpha,
              beta, gamma.  These values will be used to apply a rotation to a
              model loaded into 3dmod along with the image.

       -firsttlt (-fir) OR -TiltOriginal   Three floats
              (Interactive TLT_ORIG)  Change original tilt angles.  These
              angles have no effect in IMOD.

       -rottlt (-ro) OR -RotateTilt   Three floats
              (Interactive TLT_ROT)  Rotate current tilt angles by the given
              alpha, beta, and gamma values, where the rotations are applied
              the order gamma (around Z), beta (around Y), alpha (around X).

       -mmm (-mm) OR -MinMaxMean
              (Interactive MMM)  Read the file to recompute the minimum, maxi-
              mum, and mean densities and the RMS density.

       -rms (-rm) OR -RootMeanSquare
              (Interactive RMS)  Print the current RMS value (root-mean-square
              deviation from the mean density) then do the same operation as
              MMM/-mmm.

       -fixpixel (-fix) OR -FixPixel
              (Interactive FIXPIXEL)  Set the cell and sample sizes the same
              as the image size, resulting in a pixel spacing of 1, 1, 1.

       -gridfix (-g) OR -FixGrid
              (Interactive FIXGRID)  Set the sample size the same as the image
              size and modify the cell size so as to preserve the pixel size.

       -feipixel (-fe) OR -FeiPixel   Integer
              (Interactive FEIPIXEL)  Set the pixel spacing in X, Y, Z from
              the value for the pixel size of the first section in an
              Agard/FEI-style extended header.  If the existing pixel spacing
              is not 1 but is equal to 2, 3, or 4, this will be assumed to
              represent a binning of the data, and the pixel size will be mul-
              tiplied by this value.  However, if the pixel size has already
              been transferred or the pixel spacing does not correspond to a
              small integer, the program will transfer the pixel size only if
              a positive number is entered for this option.  It will exit if 0
              or a negative nunber is entered for this option when running
              with command-line arguments, or if -1 is entered when running
              interactively.

       -extrafix (-e) OR -FixExtra
              (Interactive FIXEXTRA)  Change the flags in the header so that
              3dmod no longer interprets the extended header as having piece
              coordinates for a montage.

       -modefix (-mo) OR -FixMode
              (Interactive FIXMODE)  Change mode from 1 (signed 16-bit inte-
              ger) to 6 (unsigned) or from 6 to 1.  The program will warn if
              the current minimum and maximum densities indicate that there
              are values that will not be interpreted correctly after the
              change.

       -invertorg (-in) OR -InvertOrigin
              (Interactive INVERTORG)  Invert the signs of the X, Y, and Z
              origin values to switch the header between different definitions
              of the origin.  This operation will not change the flag about
              the origin inversion and will invert the origin values seen
              inside IMOD programs as well as those stored in the header.

       -toggleorg (-to) OR -ToggleOrigin
              (Interactive INVERTORG)  Invert the signs of the X, Y, and Z
              origin values stored in the file header without changing the
              values seen inside IMOD programs.  This will be done by setting
              the flag that determines whether values are inverted on output
              to the file or not.

       -setmmm (-se) OR -SetMinMaxMean     Three floats
              (Interactive SETMMM)  Set the minimum, maximum, and mean densi-
              ties directly with the given values.

       -real (-re) OR -RealMode
              (Interactive REAL)  Change a mode 4 FFT file to mode 2 and dou-
              ble the X size.

       -fft (-ff) OR -ComplexMode
              (Interactive FFT)  Change a mode 2 file to mode 4 and divide the
              X size by 2; this can be done only if the X size is two times an
              odd number.

       -4bit (-4) OR -Change4BitMode       Integer
              (Interactive 4BIT)  For a positive entry, change a mode 0 file
              to the 4-bit mode 101 and double the size in X that is stored in
              the header.  The header listing will look the same if the file
              was already recognized as containing 4-bit data packed into
              bytes.  For a negative entry, change a mode 101 file back to
              mode 0 and divide the X size by 2 (X size must be even).

       -ispg (-is) OR -SpaceGroup     Integer
              (Interactive ISPG)  Change the space group entry, which should
              be 0 for an image stack, 1 for an image volume, and 401 for a
              stack with multiple volumes.

       -title (-ti) OR -TitleToAdd    Text string
              Add the given string as a new label (title) after all other
              labels in the file.  This option is not equivalent to the inter-
              active LAB option, which provides much more flexibility.  If
              there are already 10 labels, the last one will be replaced.  Be
              sure to quote the whole string when running from the command
              line.

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

       -StandardInput
              Read parameter entries from standard input.

ADDITIONAL INTERACTIVE OPTIONS
       LAB - Delete a list of labels, or add a label.  You will see a numbered
       list of existing labels.  To delete some labels, enter a range (comma-
       separated list) of the numbers to delete.  To add a label, enter the
       negative of the label number after which you want the new label to
       appear.  Enter 0 to have the new label become the first one, or -9 to
       have it added after the last one.  Then enter the complete label (the
       date/time stamp will not be added).  If you need to program this opera-
       tion in a script, first delete the tenth label, if any, with entries
       "lab - 10 - 1 - lab -9 your_new_label".

       DAT - Change data type, which is defined as 0 for normal data, 1 for
       tilt series, 2 for stereo pairs, 3 for averaged data, 4 for averaged
       stereo pairs.  The only non-zero value that could be useful in IMOD is
       1; with this value you can set a starting angle and increment that will
       be accepted by the Tilt program instead of entering angles from a
       file.

       HELP - print a summary of these options.

       DONE - Write the modified header to the file and exit.

HISTORY
       Written by David Mastronarde 10/24/88; ported to SGI 12/7/94.
       Converted to PIP input, 10/15/14.


BUGS
       Email bug reports to mast at colorado dot edu.



IMOD                                 4.9.3                      alterheader(1)