em_map_utils.filled_cylinder

filled_cylinder.py

Author:

Ardan Patwardhan

Affiliation:

EMBL-EBI, Wellcome Genome Campus, CB10 1SD, UK

Date:

28/07/2025

Description:

Generate a 3D volume containing a filled cylinder.

Attributes

Functions

filled_cylinder([diameter, length, box_size, ...])

Generate a 3D volume containing a filled cylinder.

Module Contents

em_map_utils.filled_cylinder.filled_cylinder(diameter=50, length=100, box_size=(100, 100, 100), inside_value=1.0, outside_value=0.0, cent_coos=None, alignment_axis='i', dtype=np.float32)

Generate a 3D volume containing a filled cylinder.

Note: Coordinate system is (i,j,k) going from the slowest to fastest

varying axis.

Parameters:
  • diameter – Diameter of cylinder in voxels.

  • length – Length of cylinder in voxels.

  • box_size – Lengths of the sides of the 3D volume along the (i,j,k) axes.

  • inside_value – Map value inside and on the cylinder.

  • outside_value – Map value outside the cylinder.

  • cent_coos – Centre (i,j,k) coordinates of the cylinder.

  • alignment_axis – Long axis (‘i’, ‘j’ or ‘k’) of cylinder.

  • dtype – Data type of 3D volume. Note: it cannot be float64 for the current MRC format.

Returns:

3D numpy grid with filled cylinder.

em_map_utils.filled_cylinder.parser