Name
- sxcopyfromtif: Convert raw image (in tif or mrc format) file into hdf or any other format (SPIDER etc ) for EM image processing
Usage
Usage in command lines:
- sxcopyfromtif.py tifdir micdir --inx=tif --foc=f --ext=spi --cst=1 pixel_size=2 --sca_a=1 --sca_b=1 --step=63.5 --mag=40 --MPI
Usage in python programming:
- sxcopyfromtif((indir, outdir=None, input_extension="tif", film_or_CCD="f", output_extension="hdf", contrast_invert=1, Pixel_size=1, scanner_param_a=1,scanner_param_b=1, scan_step=63.5, magnification=40, MPI=False)
Input
- tifdir
- directory in which files to be converted are put
Output
- micdir
- directory in which converted files are saved
Options
- --inx
- input file extension. It is tif by default.
- --foc
- film or CCD . If foc=f the intensity of film will be converted into optical density(OD).
- --ext
- output file extension.
- --cst
- invert contrast or not. cst=-1 will invert the contrast of converted files.
- --Pixel_size
- The Pixel_size of the final dimension-adjusted image. When it is set as negative integer number, the program will simply use non-gridding method to reduce the image dimensions integer times.
- --sca_a
- parameter a for OD ( linear ) transformation.
- --sca_b
- parameter b for OD ( linear ) transformation.
- --step
scanning step size. Use 1000 `Å` as unit.
- --mag
- magnification of the image, use k as unit. For example, 40,000 magnification is input as 40.
Description
- This command converts raw image files( scanned films and CCD frames, could be saved in tif or mrc format) to hdf format files or other formats.
- The converted files are allowed to keep the raw file (tif file) root name, assigned a prefix mic_, and user-defined extention.
- The two scanners are all calibrated using Kodak photographic tablet No.3 . The OD ranges from .05 to 3.05.
- The actual first linear parameter is always less than zero. User has to check the local scanner to find these two parameters.
- The number of raw image is taken as the micrograph number or (ID).
- . sca_a set as 1 scanned by the scanner in Pawel's Lab
`OD=-1.883*log_(10)((I-1)/(2^16-1))+0.0669`
- sca_a set as 2 scanned by the scanner in Dowhan's Lab
`OD=-1.609*log_(10)((I-1)/(2^16-1))+0.012`
Pixel_size of raw image can be calculated from scanning step size `"Step"`, and magnification if the image`"mag"` is recorded by film.
`"Pixel_size_raw"="Step"/"Mag"`
- If the image is recorded by CCD, the Step should be camera scan step size.
`"Pixel_size"="Step"/"Mag"*"decimation"`
- The image dimension adjustment is achieved by using gridding algorithm,which allows user to do non-interger scaling ratio.However, gridding method requires 2 times padding of the original image. Hence the image size in core for processing will be increased to 4 times of those directly converted images. (For exmaple, a normal scanned film in SPIDER format has size 478 M bytes .Padding will increase the image size to 1.92 G bytes.) So it would be good for the user to check the memory of proccessors of the computers before using this option. In case of insufficient memory, simply set the Pixel_size as the decimation value, and put negative sign to denote non-gridding algorithm. The program will switch back to conventional size reduction method, and use DECIMATE value instored in pixel_size to reduce image integer times.
Method
Reference
None
Author / Maintainer
Zhong Huang
.See also image_decimate, resample
Keywords
- category 1
- APPLICATIONS
Files
sxcopyfromtif.py, applications.py
Maturity
- stable
- works for most people, has been tested; test cases/examples available.
Bugs
None. It is perfect.