Skip to content

Reconstruction using weighted backprojection

FriedrichFoerster edited this page Jun 24, 2020 · 6 revisions

Reconstruction using weighted backprojection using reconstructTomogram.py

In PyTom reconstructions are performed using backprojection. The algorithm can use different interpolation kernels. By default we use a 3rd order spline.

Reconstruct a tomogram using reconstructTomogram.py In our tutorial data-set you will find a directory reconstructTomo where you can perform reconstruction of a full tomogram by weighted backprojection. Projections will be aligned and weighted during this step so that the data you start with are unaligned and unweighted projections. Essentially raw projections only sorted according to the tilt angle. Running this script will generate a full tomogram.em file, either 2x binned (4x downscaled) (512,512,128) or in original size (2048,2048,512). The reconstructTomo.sh is essentially the only script you have to run to obtain the aligned, weighted projections and the 2x binned tomogram.

reconstructTomogram.py --tiltSeriesPath ../projections/ \ 
						--tiltSeriesPrefix tomo01_sorted \
					 	--firstIndex 1 \
					 	--lastIndex 41 \
					 	--referenceIndex 21 \
					 	--markerFile ../projections/markfile_temp.mark \
					 	--referenceMarkerIndex 1 \
					 	--projectionTargets ./alignedProjections/tomo01 \
					 	--projectionBinning 4 \
					 	--lowpassFilter 0.5 \
					 	--tomogramFile tomogram.em \
					 	--fileType em \
					 	--tomogramSizeX 512 \
					 	--tomogramSizeY 512 \
					 	--tomogramSizeZ 128 \
					 	--reconstructionCenterX 0 \
					 	--reconstructionCenterY 0 \
					 	--reconstructionCenterZ 0 

In order to get acquainted with the parameters of reconstructTomogram.py, simply run reconstructTomogram.py --help In detail the provided parameters for reconstruction are:

  • tiltSeriesPath: Relative or absolute path to tilt series EM
  • tiltSeriesPrefix: Prefix of projections before running index (projections in EM or MRC format)
  • firstIndex: Index of first projection
  • lastIndex: Index of last projection
  • tltFile: tltFile (from SerialEM) containing tilt angles (optional)
  • prexgFile: prexgFile containing pre-shifts from IMOD - instead of markerFile (optional)
  • preBin: pre-Binning in IMOD prior to marker determination (optional)
  • referenceIndex: Index of reference projection used for alignment
  • markerFile: Name of EM markerfile or IMOD wimp File containing marker coordinates (in EM format or IMOD wimp format)
  • referenceMarkerIndex: Index of reference marker to set up coordinate system
  • expectedRotationAngle: approximately known tilt axis determines handedness of reconstruction (optional)
  • projectionTargets: Relative or absolute path to the aligned projections that will be generated + file prefix
  • fineAlignFile: Relative or absolute path to the file with fineAlign parameters (type should be *.dat)
  • projectionBinning: Binning of projections during read (factor!)
  • lowpassFilter: Lowpass filter (after binning)
  • tomogramFile: Relative or absolute path to final tomogram (no tomogram written if not specified)
  • fileType: File type (can be EM or MRC - no tomogram written if not specified)
  • tomogramSizeX: Size of tomogram in x (no tomogram written if not specified)
  • tomogramSizeY: Size of tomogram in y (no tomogram written if not specified)
  • tomogramSizeZ: Size of tomogram in z (no tomogram written if not specified)
  • reconstructionCenterX: Center where tomogram will be reconstructed (no tomogram written if not specified)
  • reconstructionCenterY: Center where tomogram will be reconstructed (no tomogram written if not specified)
  • reconstructionCenterZ: Center where tomogram will be reconstructed (no tomogram written if not specified)
  • weightingType: type of weighting. -1: r-weighting (default), 0: no weighting.
  • noOutputImages: When specified, not output images are saved (optional)
  • verbose: verbose mode All further steps shown in the tutorial are based on particles detected within this tomogram.

Reconstruct using reconstructWB.py

If your tilt series is already aligned you can also reconstruct volume with reconstructWB.py. While this script is mostly designed for reconstructing sets of subtomograms (Subtomogram reconstruction), it can also be used to reconstruct larger volumes. For example,
pytom reconstructWB.py --tomogram MyTomogram.em --projectionDirectory MyProjectionDirectory/ --size 512,512,128 
would reconstruct a 512x512x128 voxel volume from the projections located in MyProjectionDirectory/.

In detail the options are:

  • -t, --tomogram: Reconstruct a tomogram. Specify name of tomogam here. You do not need a particle list for that! (optional - if not a particle list)
  • -p, --particleList: XML particle list. (optional - if not a full tomogram)
  • projectionList: XML projection list. (optional - alternatively you provide the projection directory)
  • --projectionDirectory: Directory containing the projections. (optional)
  • -w, --applyWeighting: If projections are not weighted, apply weighting before. If omitted, no weighting. (optional)
  • -s, --size: Size of particle cube / tomogram.
  • -b, --coordinateBinning: Binning factor of coordinates. If particle coordinates are determined in binned volume (with respect to projections) this binning factor needs to be specified. (optional)
  • -o, --recOffset: Cropping offset of the binned tomogram. (optional)
  • --projBinning: Bin projections BEFORE reconstruction. 1 is no binning, 2 will merge two voxels to one, 3 -> 1, 4 ->1 ... (optional)
  • -m, --metafile: Supply a metafile to get tiltangles. (optional)
  • -n, --numProcesses: Supply a metafile to get tiltangles. (optional)
  • -a, --alignResultFile: Supply an alignResultFile. (optional)
  • --particlePolishResultFile: Supply a particle polish result file. (optional)