simple_skeleton

nighres.shape.simple_skeleton(input_image, shape_image_type='signed_distance', boundary_threshold=0.0, skeleton_threshold=2.0, topology_lut_dir=None, save_data=False, overwrite=False, output_dir=None, file_name=None)[source]

Simple Skeleton

Create a skeleton for a levelset surface or a probability map (loosely adapted from Bouix et al., 2006)

Parameters:
  • input_image (niimg) – Image containing structure-of-interest
  • shape_image_type (str) – Shape of the input image: either ‘signed_distance’ or ‘probability_map’.
  • boundary_threshold (float) – Boundary threshold (>0: inside, <0: outside)
  • skeleton_threshold (float) – Skeleton threshold (>0: inside, <0: outside)
  • topology_lut_dir (str) – Directory of LUT topology
  • save_data (bool, optional) – Save output data to file (default is False)
  • output_dir (str, optional) – Path to desired output directory, will be created if it doesn’t exist
  • file_name (str, optional) – Desired base name for output files with file extension (suffixes will be added)
Returns:

Dictionary collecting outputs under the following keys (suffix of output files in brackets)

  • medial (niimg): A 2D medial surface extracted from the shape (_ssk-med)
  • skeleton (niimg): The 1D skeleton extracted from the shape (_ssk-skel)

Return type:

dict

Notes

Original Java module by Pierre-Louis Bazin.