Wiki Page Content

proc2d

This program performs various processing operations on images and sets of images

proc2d <input file> <output file> [first=<n>] [last=<n>] [list=<list file>] [exclude=<list file>] [nobad] [inplace] [edgenorm] [norm[=<mean>,<sigma>]] [invert] [flip] [rot=<angle>] [trans=<dx>,<dy>] [center] [acfcenter] [scale=<sca>] [clip=<newsize x&y>] [shrink=<n>] [meanshrink=<n>] [apix=<A/pix>] [lp=<filt r>] [hp=<filt r>] [tlp=<filt r>] [rfilt=<type>[,<val1>[,<val2>[,<val3>]]]] [blfilt=<sigma1,sigma2,iter,localwidth>] [filefilt=<file>] [mask=<radius>] [imask=<radius>] [noisemask] [gaussmask] [calcsf=[<n>,]<output>] [mrc] [mrc8bit] [pif] [hdf] [png] [em] [spider] [spider-single] [spiderswap] [spiderswap-single] [pgm[=<low>,<hi>]] [sharphp=<pixels>] [norefs] [rotav] [average] [fftavg=<file name>] [split=n] [ctfsplit] [interlv=<file 2 interleave>] [sym=<Cn>] [plt[=<plt file>]] [setsfpairs] [addnoise=<level>] [randomize=<dr>,<da>,<flip>] [snrfilt=<SF file>] [wiener=<SF file>[,<amp sca>[,<amp cont>]]] [wienernoc=<SF file>] [selfcl[=<steps>][,<mode>]] [comment=<str>] [radon] [rfp] [mraprep] [phot] [rsub]

Parameters:

<input>

Input file

<output>

Output file. Appends to output file unless inplace specified

[first=<n>]

Specify the first image in the input to process (0 - n-1)

[last=<n>]

Specify the last image in the input to process

[list=<list file>]

Works only on the image numbers contained in <list file>

[exclude=<list file>]

Excludes image numbers in <list file>

[nobad]

Exclude particles with simga=0

[inplace]

Output overwrites input, USE SAME FILENAME, DO NOT 'clip' images.

[edgenorm]

Output is always normalized, this will set 0 to the circular edge value rather than the overall mean

[norm[=<mean>,<sigma>]]

Normalize the result

[invert]

Inverts the density

[flip]

Vertical flip of image (inverts handedness)

[rot=<angle>]

Rotate by an angle (degrees)

[trans=<dx>,<dy>]

Translate

[center]

Center image using center of mass

[acfcenter]

Center image using CCF with 180 deg rotation

[scale=<sca>]

Scale by specified scaling factor. Clip must also be specified to change the dimensions of the output map

[clip=<newsize x&y>]

Define the output image size (always square)

[shrink=<n>]

Reduce an image size by an integral scaling factor, uses median filter. Clip is not required.

[meanshrink=<n>]

Same as shrink, but takes the average instead of the median. Clip is not required.

[apix=<A/pix>]

Specify the Angstr/pixel for S scaling

[lp=<filt r>]

Gaussian lowpass filter, r in angstroms if apix defined, pixels if undef

[hp=<filt r>]

Arctan highpass filter, r in angstroms if apix defined, pixels if undef

[tlp=<filt r>]

Arctan lowpass filter, r in angstroms if apix defined, pixels if undef

[rfilt=<type>[,<val1>[,<val2>[,<val3>]]]]

Apply one of a variety of real-space filters

[blfilt=<sigma1,sigma2,iter,localwidth>]

Apply bilateral filtering

[filefilt=<file>]

Filter with a Fourier filter specified in a 2 column text file

[mask=<radius>]

Circular mask

[imask=<radius>]

Circular inner mask

[noisemask]

Fill the masked region with 1-sigma noise rather than zero

[gaussmask]

Make the mask a Gaussian falloff

[calcsf=[<n>,]<output>]

This will calculate a radial structure factor for the image and write it to the specified output file, must specify apix. Optionally divide into <n> angular bins

[mrc]

Output a set of MRC files rather than a single IMAGIC stack

[mrc8bit]

Output a set of 8-bit MRC files to conserve space

[pif]

Output to a PIF (Purdue Image Format) file

[hdf]

Output to a HDF5 (Hierarchical Data Format) file.

[png]

Output to a PNG (Portable Network Graphics) file

[em]

Output to a EM image file

[spider]

Output a Spider stack file rather than an IMAGIC stack

[spider-single]

Output in individual Spider files rather than an IMAGIC file

[spiderswap]

Output a spider stack file in byte-swapped order (ie - PC vs SGI)

[spiderswap-single]

Output in individual Spider files in swapped order rather than an IMAGIC file

[pgm[=<low>,<hi>]]

Output a set of PGM images rather than an IMAGIC stack

[sharphp=<pixels>]

A highpass with a sharp cutoff (beware artifacts)

[norefs]

Skip any input images which are marked as references (usually used with classes.*)

[rotav]

Each image is rotationally averaged

[average]

Averages all input images (without alignment) and writes a single (normalized) output image

[fftavg=<file name>]

Incoherent Fourier average of all images and write a single power spectrum image

[split=n]

Splits the input file into a set of n output files

[ctfsplit]

Splits the input file into output files with the same CTF parameters

[interlv=<file 2 interleave>]

Specifies a 2nd input file. Output will be 2 files interleaved.

[sym=<Cn>]

Apply an n-fold rotational symmetry to each image

[plt[=<plt file>]]

output the orientations in IMAGIC .plt file format

[setsfpairs]

Applies the radial structure factor of the 1st image to the 2nd, the 3rd to the 4th, etc

[addnoise=<level>]

Add flatband gaussian noise with defined standard deviation

[randomize=<dr>,<da>,<flip>]

This will randomly rotate and translate each particle

[snrfilt=<SF file>]

Filter the images by the estimated SNR in each image.

[wiener=<SF file>[,<amp sca>[,<amp cont>]]]

Wiener filter the images using the estimated SNR with CTF amplitude correction.

[wienernoc=<SF file>]

Wiener filter the images without CTF amplitude correction.

[selfcl[=<steps>][,<mode>]]

Output file will be a 180x180 self-common lines map for each image.

[comment=<str>] Sets the comment string in the output file (if supported

[comment=<str>] Sets the comment string in the output file (if supported)

[radon]

Do Radon transform

[rfp]

Experimental

[mraprep]

Experimental

[phot]

Experimental

[rsub]

Experimental

Usage:

proc2d 3244.img start.hed invert apix=5 lp=18

proc2d start.hed start.hed invert inplace

Description

This program is used to perform a variety of generic 2D image processing tasks. Like all of the EMAN programs, it will read any supported file format. By default it outputs to an Imagic file although there are options to change this. Note that, by default, images are appended to the end of the output file if it already exists. All images in one file MUST have the same size. ie - if you try to copy 50x50 images to the end of a file that already contains 100x100 images, an error will result. Note the 'first=' and 'last=' options allow a subset of the input file to be processed. The 'inplace' keyword may be used to cause output images to overwrite the input images rather than being appended to the end of the file.

Most of the processing is explained in sufficient detail above, but there are a few notes:

  • The scale operation does NOT resize the image in pixels. Generally you want to specify both scale and clip.
  • If apix is not specified, all filters are specified in pixels in Fourier space. If apix is specified, all filters are specified in Angstroms. ie - 'apix=4.5 lp=8' would filter the image using a Gaussian in Fourier space with a 1/e width of 1/8 reciprocal angstroms.
  • The 'center' option generally doesn't produce very good results on noisy images. Use the 'cenalignint' program instead.
  • You might notice that 'mask'ing an image often produces a mask that doesn't match the density just inside the mask very well. The 'edgemean' value normalizes the images so the mean value matches the edge of the image rather than the overall mean value of the image.
  • The self common-lines option takes two optional parameters. The first is the size of the self common-line image. For example, 180 would produce 180x180 maps, meaning a 2 degree spacing. Also note that these maps have been undiagonalized, meaning the normal diagonal line of 1's is along the x-axis. The mode determines how the common-lines are calculated: 0 will do real-space calculations, 1 will do amplitude-weighted Fourier phase-error common-lines scaled and inverted so higher is better, 2 will do amplitude-only Fourier common-lines
  • The real-space filter option can perform a variety of filters:
    • 0: x<val1 -> 0 (simple threshold)

    • 1: x<val1 -> 0, then normalize

    • 2: x<val1 -> 0, x>val1 -> 1

    • 3: x>val1 -> x 0<x<val1 -> 0 x<0 -> val2, then normalize

    • 4: x -> fabs(x)

    • 5: x towards zero by val1 set to zero if passes zero
    • 6: x!=0 ->1

    • 7: x<val1*maxval -> 0

    • 9: x -> (x+val1)*val2

    • 10: x -> sqrt(x)

    • 11: x -> exp(x/val1-val2)

    • 12: x -> 2*(val1-x)

    • 14: val1<=x<=val2 -> 1.0 else 0.0

    • 13: x>val1 -> val1, x<val2 -> val2, histogram tail chopper

    • 15: x -> log(x)

    • 16: x -> e^x

    • 17: x>mean+sigma*val1 or x<mean-sigma*val2 -> mean, histogram tail chopper

    • 20: median filter, val1 is size
    • 21: like 20, but takes std dev of box instead of median
    • 22: like 20, but takes max value
    • 50: Tries to remove linear gradients
    • 51: Vertical stripe filter to remove Zeiss artifacts
    • 60:Fill zeroes at the edges with nearest non-zero value
    • 61: Fill constant regions with zero
    • 62: Eliminate beamstop in diffraction images (sigma,x center,y center) negative sigma will do a radial subtract as well
    • 102: Eliminate x,y pixels from the edge of the image
    • 103: Map each value to the radius at that point (useful in proc3d as well)
    • 110: Iterative expansion of a binary mask, val1 = number of layers to expand, val2 = number of layers before starting Gaussian decay
    • 111: Iterative expansion of a multilevel mask file (see qsegment). Simultaneoulsy expands all levels and prevents overlap problems.
    • 113: Local gradient remover, subtracts the local average from each pixel, val1= size of box to average over

EMAN1/Programs/Proc2D (last edited 2008-11-26 04:42:30 by localhost)