tif2mrc(1)                                                          tif2mrc(1)



NAME
       tif2mrc - Make a MRC file from tiff image files.

SYNOPSIS
       tif2mrc [-g | -u | -d] [-b file] <tiff files...> <MRC file>

DESCRIPTION
       tif2mrc takes a series of tiff files and converts them into an MRC
       stack.  tif2mrc can also convert a single multi-page tiff file to an
       MRC stack.

       Only grayscale and color image files are supported.  Grayscale images
       must be 8 or 16 bit grayscale.  Color images must be either 24 bit with
       pixels stored as red-green-blue triplets, or 8-bit with an embedded
       colormap.  Colormapped 8-bit images will be converted to 24 bit RGB
       images, since this is the kind of color MRC file that IMOD defines.

       Images need not all be the same size.  The x and y dimensions of the
       stack are set from the x and y size of the first image, unless the -o
       option is used to set the output size.  Images that are larger than the
       output size will be cropped around all four sides, and images that are
       smaller will be placed in the center of the output area and surrounded
       with gray.

       Most of the options have to do with the treatment of unsigned 16-bit
       numbers.  The standard MRC file mode for holding 16-bit integers is
       mode 1, which holds signed (positive and negative) values and has a
       range from -32768 to 32767.  Unsigned integers, with a range from 0 to
       65535, can be stored in file mode 6, which is a nonstandard mode.  If
       the tiff file has a tag indicating that it contains unsigned integers,
       then by default the program will preserve these values in a file of
       mode 6.  You can alter this behavior and store the numbers as signed
       values (mode 1) in three ways: 1) with the -u option to subtract 32768,
       which will preserve the dynamic range of the values; 2) with the -d
       option to divide by 2, which will throw away one bit of precision but
       keep the numbers positive; or 3) with the -s option to force the num-
       bers to be saved unmodified in mode 1, which will be fine as long as
       there are no values above 32767.  Finally, if the tiff file lacks a tag
       indicating that it is unsigned but the numbers do range above 32767,
       you can preserve unsigned integers and force output into a file of mode
       6 with the -k option.

   Options
       -g     This option will convert 24-bit color images to 8-bit grayscale
              in the MRC stack.

       -u     With this option, the program will convert 16-bit numbers from
              unsigned to signed integers by subtracting 32768.  Use this
              option if the tiff files have positive numbers ranging above
              32767, you want an output file of mode 1, and you do not want to
              lose any of the dynamic range of the numbers.

       -d     With this option, the program will treat 16-bit numbers as
              unsigned integers and divide them by two.  The resulting numbers
              will range between 0 and 32767.  Use this option if the tiff
              files have positive numbers ranging above 32767, you want an
              output file of mode 1, you want the numbers to remain positive,
              and you do not mind losing one bit of precision.

       -s     With this option, the program will treat numbers as signed inte-
              gers and just store them in a file of mode 1.  Use this option
              if an unsigned integer file contains values under 32768 and you
              want a file of mode 1.  The program will print the minimum and
              maximum values in the output file.  If the min is near -32768
              and the max is near 32767, this option was chosen incorrectly.

       -k     With this option, the program will treat numbers as unsigned and
              output data into a file of mode 6 even if there is no tag indi-
              cating the data are unsigned.

       -f     If only one input file is given and it is a multi-page tiff
              file, the program will convert all of the pages in the file into
              sections in an MRC file.  Use this option to make the program
              ignore the multiple pages and read only the first image.

       -o <#,#>
              Set the size of the output to the given dimensions in X and Y.
              This option has no effect for multi-page input files.

       -b file
              This option loads a background file in tiff format.  If a back-
              ground file is loaded its values are subtracted from the values
              in the rest of the files.  The background file must have the
              same data type as the images from which it is being subtracted
              (8-bit or 16-bit grayscale).

FILES
       If the output file already exists, it will be made a backup file by
       adding ~ to its name.

AUTHORS
       Jim Kremer and David Mastronarde

SEE ALSO
       tomrc(1), raw2mrc

BUGS
       If a standard tiff library is not installed, images must be uncom-
       pressed and must consist of strips rather than tiles, and colormap
       files cannot be read.

       Email bug reports to mast at colorado dot edu.



BL3DEMC                             3.11.2                          tif2mrc(1)