User Tools

Site Tools

Action disabled: revisions
This version (2022/03/01 15:13) was approved by shaikh.The Previously approved version (2021/02/18 16:24) is available.Diff


Centering : Utility for centering in 2D or 3D.


Usage in command line: input_stack_or_volume output_directory --mode=centering_mode --verbosity=verbosity_level --debug --threshsigma=threshold_sigma --applyshift stack_or_volume_to_be_centered --ndilation=number_of_dilations --nerosion=number_of_erosions --volradius=volume_radius --dimensions=number_of_dimensions --stem=output_volume_prefix --threshint=intermediate_threshold --pad=padding_factor

Typical usage

Left: uncentered binarized images, right: centered

The purpose of is to:

: center a stack of 2D images, or
: center a 3D reconstruction

1. General usage: input_stack_or_volume output_directory

2. Center a stack of 2D images using an autocorrelation function input_stack output_directory --threshsigma=threshold_sigma 

Images will be thresholded in units of standard deviations above the mean. Check the output stkmask.hdf to see if the threshold is reasonable.

3. Centering a stack by rotating each image by 180 degrees and aligning to itself: input_stack output_directory --mode=rt180

4. Center a binarized volume using an autocorrelation function: input_binary_volume output_directory --applyshift=volume_to_be_centered

Generate the input binary volume using, for example, An adaptive mask is fine also; it will be thresholded. The mask will be centered, and those shifts will be applied to the volume to be shifted.

5. Center a binarized volume by finding a box that encloses it and centering that box: input_binary_volume output_directory --mode=boundingbox --applyshift=volume_to_be_centered

As above, the input binary mask will be centered, and those shifts will be applied to the volume to be centered.

6. Center a volume by alignment to a Gaussian blob: volume_to_be_centered output_directory --mode=blob --volradius=volume_radius

If your volume to be centered isn't round, try the radius in the smallest dimension.


Main Parameters

Can be a 3D volume, possibly binarized, or a stack of 2D images
Directory where outputs will be written. (default required string)
Centering mode: acf, rt180, boundingbox, or blob. (default acf)
Binarization threshold in 2D acf mode, in units of standard deviation. (default 1.0)
In 3D acf or boundingbox mode, volume to which shifts will be applied. (default None)
In blob mode, radius of the Gaussian blob, in voxels, to which the input map will be aligned. (default None)

Advanced Parameters

Writes additional information to the screen (0..3). (default 1)
Writes additional outputs for debugging. (default False)
In case it is ambiguous whether the input is 2D or 3D (e.g., MRC format), enter 2 or 3. (default 3)
In acf (2D or 3d) or boundingbox mode, threshold at which intermediates will be binarized. (default 0.1)
In acf mode (2D or 3D), factor by which images will be padded. (default 2)
In 3D acf mode, stem for output filenames. (default acf)
In 2D acf mode, number of dilations (see for more information). (default 3)
Gray: uncentered map, violet: bounding box, melon: acf
In 2D acf mode, number of erosions (see for more information). (default 0)


In 2D acf mode, binarized images after centering
In 2D acf mode, input images after centering
In 2D acf mode, montage of mask, centered image, and masked image
In rt180 mode, input images after centering
In 3D acf mode, volume of interest after centering
In blob mode, volume of interest after centering
In boundingbox mode, volume of interest after centering
Shift parameters. Inputs will not be rotated.




Developer Notes

Author / Maintainer

Tapu Shaikh





See also


Beta:: Under evaluation and testing. Please let us know if there are any bugs.


There are no known bugs so far.

pipeline/utilities/sp_center_2d3d.txt ยท Last modified: 2022/03/01 15:13 by shaikh