get_base_block#

crispy.pruning.structures.get_base_block(ndim, return_cent_idx=False)[source]#

Generate a base block array for 2D or 3D skeleton structures.

Parameters:
  • ndim (int) – The number of dimensions (2 or 3).

  • return_cent_idx (bool, optional) – If True, also returns the central index of the block. Defaults to False.

Returns:

  • base_block (ndarray) – A binary array with a single central pixel set to 1.

  • cent_idx (tuple, optional) – The central index of the block, returned if return_cent_idx is True.