radsum3d        Average 2D Radon transforms into 3D Radon transforms.
 
                (Also works for Fourier Radon transforms)

image format: SPIDER
                
USAGE:        radsum3d
        
        .Input (empty) 3D Radon transform: rad3d001
        [Enter the name of a 3D Radon transform to which the 2D projection
         transforms should be added (averaged)]
         
        .File name pattern for 2D projection transforms: rad2d00001
	[Typically enter the file name of the first projection transform.
	 In the example "00001" serves as a pattern only and is substituted
	 with the real numbers. Do not use * or [..] expression.]
         
        .Should the projections be added or substracted: +
        [Enter - if the projection transforms ahould be subtracted and
         + if they should be averaged into the transform. The subtraction
         can be interesting fot iterative projection alignment.]
         
        .Use equalized sampling or polar sampling: P
        [You can shose between polar sampling, and (E) a sampling that equalizes
         the sampling points by diluting them with the cos of the latitudinal
         coordinate.]
         
        .Are the radon transforms real or Fourier: R
        [Since there is no indication is the file if the Radon transforms
         are real valued or Fourier transformed it has to be indicated here.
         The 3D and 3D transforms both must have the same type 
         (Fourier or real)]

        .Set line value to 0 when counter is on 0 (Y/N=default): N
        [Enter Y if the values in the line should be set to 0 when the counter
         at the end of the line is on 0, meaning that there are not projection
         transforms averaged into this line. This can occur when the - option
         is used to subtract projection transforms. After multiple iterations
         numerical errors may leave small values in a line, even though they
         should be 0.]
         
         .Input selection document file or *: sel001
         [Optional, enter the name of a selection document file that tells
          the program which images to use and whic ones to leav out. 
          *Typically, this file has the file number as key, and in the first 
          column a 1 if the projection should be used and 0 if not. 
          *Alternatively the first column may contain any value, and the 
          decision if a projection is used or not depends on a threshold 
          (see below). This can be used in alignment procedures where one 
          can take the cross-correlation coefficient as collumn 1 and give 
          a threshold as a criterium for removing projection transforms that 
          show a cross-correlation coefficient below a certain threshold.
          *Second alternative: The document file contains a key followed by the
          image file number, followed by one or more numbers indicating the
          set membership(s) of the particle. This format was created for the
          use of new data partitioning methods under development.]

If a selection file was specified:
         .Column with image number, Set number to reconstruct: 0,0
         [If the document file is not a selection file, but contains the image
	  numbers insteadt provide a column number other than 0. If 
	  the document file contains multiple sets, enter the set that should be 
	  reconstructed. The document file created by hex3drm has multiple sets.]               
          
    if the column number and set number were 0(the normal situation):
         .Threshold for selection document file (def 0.5): 0.5
         [Enter a threshold value for the value from the selection document
          file. Below this value projections are rejected, above accepted.
          0.5 works well for the simple 0 / 1 index. If a 0 is entered other
          questions follow]
          
         If the threshold is specified as 0:
                 .Sigma to calculate the selection cutoff (def -0.2): -0.5
                [If no threshold was given, the program determined the 
                 sigma and average of the selection column. Specifying
                 0.5 her means that all images with a slection value of
                 less than average-0.5*sigma are rejected.]
                 
If no selection file was specified:

        .Enter file numbers (style: 1-100,120-134,137,150-1000): 1-10594
        [Enter the numbers of the files that should be averaged into the
         3D Redon transform. At this time it is not clear if there is
         a limit to the line length or if continuation lines a possible
         (probably not).]
         
        .Randomization with replacement (Y/N=default): N
        [Enter if you want to do a reconstruction using randomization with
         replacement. This can be used to obtain an approximation of the
         3D variance. Default is N]
         
         If Y was answered:
                 .Number of draws: 9000
                [Enter the number of projections that should be drawn randomly
                 from the available projection set.]
                
                .Name of statistics output doc file: statdoc001
                [This document file will have the information about which
                 porjections were drawn.]
                 
        .Angle set number in projection header (1=def, 2 or 3): 1
        [The spider image file contains 3 locations to store euler angle sets
         and x-y shifts (although the shift locations have been used also for
         other purposes in the later versions of SPIDER. Typically the valid
         Euler angles can be found in position 1. The purpose of multiple 
         location more redundancy for alignments. When 2D Radon trasnforms
         are aligned to 3D Radon transforms (or 2D polar Fouriers to 3D
         polar Fouriers which is the same), then the new angle can be saved
         in a position other than 1, and a reconstruction can be first 
         calculated to possibley verify the validity of the alignment, before
         overwriting  the default position.]
         
        .Symmetry to impose 0=none=def, 1 around z-axis, 4 icosahedral: 0
        [Enter 0 for asymmetrical particles, 1 for particles with proven
        symmetry around the z-axis, which must be well aligned, and 4 for
        icosahedral symmetry enforcement. Other symmetries are in the 
        works.]
        
Programs: radsum3d.py, put2drads, cputrmn_plus.f, putrmrealn.f, getsym.f 

Author: M. Radermacher