Boulder Laboratory for 3-Dimensional Electron Microscopy of Cells

DENSMATCH(1)							   DENSMATCH(1)

NAME
  densmatch - Scale densities in one volume to match those in another

SYNOPSIS
  densmatch [-report] Reference_file File_to_scale [Output_file]

DESCRIPTION
  Densmatch scales the density values in one volume so that its mean
  and standard deviation match that of another volume.  To determine
  the mean and S.D. for each volume, it samples up to 100000 pixels in
  the central eighth of each volume (central half in X, Y, and Z).  It
  can write the scaled values either to a new file or back into the
  file of the volume being scaled.  THE LATTER WILL DESTROY THE
  ORIGINAL VALUES IN THAT FILE.
  
  Densmatch uses the PIP package for input (see the manual page for pip)
  and can still take sequential input interactively, but with no options.
  The following options can be specified either as command line arguments
  (with the -) or one per line in a command file or parameter file (without
  the -):

 -reference OR -ReferenceFile   File name
    Input file with reference volume (the one being matched to).  This file
    can be entered on the command line as the first non-option argument.

 -scaled OR -ScaledFile   File name
    Input file with volume to be scaled to match.  This file can be entered on
    the command line as the second non-option argument.

 -output OR -OutputFile   File name
    Output file for the scaled volume.  This file can be entered on the
    command line as the third non-option argument.  If this file is omitted,
    the program will write the scaled values back to the input file.

 -report OR -ReportOnly
    Report scaling factors without writing scaled data to file.  The program
    will report two numbers, a factor to multiply by then a constant to add;
    these numbers can be supplied to the -multadd option of Newstack.

 -xminmax OR -XMinAndMax   Two integers
    Starting and ending X coordinates of region to analyze for mean and SD in
    reference volume.  The default is NX/4, 3*NX/4, where NX is the size of
    the reference volume in X.  X, Y, and Z coordinates are numbered from 0.

 -yminmax OR -YMinAndMax   Two integers
    Starting and ending Y coordinates of region to analyze in reference
    volume.  The default is NY/4, 3*NY/4, where NY is the size of the
    reference volume in Y.

 -zminmax OR -ZMinAndMax   Two integers
    Starting and ending Z values of region to analyze in reference volume. 
    The default is NZ/4, 3*NZ/4, where NZ is the number of slices in the
    reference volume.

 -offset OR -OffsetRefToScaledXYZ   Three floats
    Displacement of the volume being scaled relative to the reference volume
    in X, Y, and Z; namely, the amount to add to a pixel coordinate in the
    reference volume to obtain the coordinate of the corresponding pixel in
    the file being scaled.

 -help OR -usage
    Print help output

  -StandardInput
     Read parameter entries from standard input.


  If there are no command-line arguments, Densmatch takes sequential input
  the old way, with the following entries:
  
  Name of the first volume, the one whose densities are being matched
  
  Name of the second volume, the one being scaled
  
  Name of an output file, or a blank line to have the scaled values
  written back into the second file.

HISTORY
  Written by David Mastronarde, November 1995
  Converted to PIP input, added reporting option, 8/23/04