susan.modules.CropProjection¶
- class susan.modules.CropProjection[source]¶
Bases:
objectProjection-cropping engine for 2-D subtomogram alignment.
Wraps the
susan_crop_projectionsbinary. Crops 2-D projection patches around each particle position into out_dir for subsequent 2-D alignment. Configure the attributes, then callextract().Attributes
- num_threads¶
Number of CPU threads to use. Default:
1.- Type:
int
- normalize_type¶
Per-patch normalisation. One of
'none','zero_mean','zero_mean_one_std'and'zero_mean_unit_var'. Default:'zero_mean_one_std'.- Type:
str
- invert_contrast¶
Invert the sign of the cropped projections. Default:
False.- Type:
bool
Methods
- get_args(out_dir, tomos_file, ptcls_in, box_size)[source]¶
Build the command-line argument string for
susan_crop_projections.- Parameters:
out_dir (str) – Output directory where cropped projection patches are written.
tomos_file (str) – Path to the
.tomostxttomograms file.ptcls_in (str) – Path to the input
.ptclsrawparticles file.box_size (int) – Patch size in pixels.
- Returns:
Space-separated argument string ready to be appended to the
susan_crop_projectionscommand.- Return type:
str
- extract(out_pfx, tomos_file, ptcls_in, box_size)[source]¶
Crop projection patches for all particles.
- Parameters:
out_pfx (str) – Output directory for the cropped patches.
tomos_file (str) – Path to the
.tomostxttomograms file.ptcls_in (str) – Path to the input
.ptclsrawparticles file.box_size (int) – Patch size in pixels.
- Raises:
RuntimeError – If the
susan_crop_projectionsbinary returns a non-zero exit code.