Contour Tools

Contour extraction and processing utilities.

Module Reference

Tools for creating and manipulating contours.

class physiomotion4d.contour_tools.ContourTools(log_level=20)[source]

Tools for creating and manipulating contours.

__init__(log_level=20)[source]

Initialize ContourTools.

Parameters:

log_level (int | str) – Logging level (default: logging.INFO)

extract_contours(labelmap_image)[source]

Make contours from a labelmap image.

Parameters:

labelmap_image (itk.image) – The labelmap image to create contours from

Returns:

The contours as a PyVista PolyData object

Return type:

pv.PolyData

transform_contours(contours, tfm, with_deformation_magnitude=False)[source]

Transform contours using a given transform.

Parameters:

tfm (itk.Transform) – The transform to use

Returns:

The transformed contours with deformation magnitude

Return type:

pv.PolyData

merge_meshes(meshes)[source]

Merge multiple fixed meshes into a single mesh.

Returns:

Merged mesh

Return type:

pv.PolyData

create_reference_image(mesh, spatial_resolution=0.5, buffer_factor=0.25, ptype=itk.F)[source]

Create a reference image from a mesh.

Return type:

Image

create_mask_from_mesh(mesh, reference_image)[source]
Return type:

itk.Image

create_labelmap_from_meshes(meshes, reference_image)[source]

Create a labelmap from a list of meshes.

Return type:

itk.Image

create_distance_map(mesh, reference_image, squared_distance=False, negative_inside=True, zero_inside=False, norm_to_max_distance=0.0)[source]
Return type:

itk.Image

create_deformation_field(points, point_displacements, reference_image, blur_sigma=2.5, ptype=itk.D)[source]

Create a displacement map from model points and displacements.

Return type:

Image

Navigation

Transform Tools | Utility Modules | nrrd_conversion | Test Tools