Skip to content

ShapeWorks Python API

ShapeWorks Python API

Biharmonic = <WarpMethod.Biharmonic: 1> module-attribute

Members:

Laplacian

Biharmonic

ContourDomain = <DomainType.ContourDomain: 2> module-attribute

Members:

MeshDomain

ImageDomain

ContourDomain

ImageDomain = <DomainType.ImageDomain: 0> module-attribute

Members:

MeshDomain

ImageDomain

ContourDomain

Laplacian = <WarpMethod.Laplacian: 0> module-attribute

Members:

Laplacian

Biharmonic

Linear = <InterpolationType.Linear: 0> module-attribute

Members:

Linear

NearestNeighbor

MeshDomain = <DomainType.MeshDomain: 1> module-attribute

Members:

MeshDomain

ImageDomain

ContourDomain

NearestNeighbor = <InterpolationType.NearestNeighbor: 1> module-attribute

Members:

Linear

NearestNeighbor

Pi = 3.141592653589793 module-attribute

Convert a string or number to a floating point number, if possible.

X = <Axis.X: 0> module-attribute

Members:

invalid

X

Y

Z

Y = <Axis.Y: 1> module-attribute

Members:

invalid

X

Y

Z

Z = <Axis.Z: 2> module-attribute

Members:

invalid

X

Y

Z

invalid = <Axis.invalid: -1> module-attribute

Members:

invalid

X

Y

Z

Analyze

Bases: pybind11_builtins.pybind11_object

create_shape_from_points() method descriptor

create_shape_from_points(self: shapeworks_py.Analyze, arg0: shapeworks_py.Particles) -> shapeworks_py.Shape

get_mean_shape() method descriptor

get_mean_shape(self: shapeworks_py.Analyze) -> shapeworks_py.Mesh

get_mean_shape_points() method descriptor

get_mean_shape_points(self: shapeworks_py.Analyze) -> typing.Annotated[numpy.typing.NDArray[numpy.float64], "[m, 1]"]

get_median_shape() method descriptor

get_median_shape(self: shapeworks_py.Analyze) -> shapeworks_py.Mesh

get_median_shape_points() method descriptor

get_median_shape_points(self: shapeworks_py.Analyze) -> typing.Annotated[numpy.typing.NDArray[numpy.float64], "[m, 1]"]

get_mode_shape() method descriptor

get_mode_shape(self: shapeworks_py.Analyze, arg0: typing.SupportsInt, arg1: typing.SupportsFloat) -> shapeworks_py.Shape

get_num_modes() method descriptor

get_num_modes(self: shapeworks_py.Analyze) -> int

get_num_particles() method descriptor

get_num_particles(self: shapeworks_py.Analyze) -> int

get_num_subjects() method descriptor

get_num_subjects(self: shapeworks_py.Analyze) -> int

get_shape_points() method descriptor

get_shape_points(self: shapeworks_py.Analyze, arg0: typing.SupportsInt, arg1: typing.SupportsFloat) -> shapeworks_py.Particles

get_shapes() method descriptor

get_shapes(self: shapeworks_py.Analyze) -> list[shapeworks_py.Shape]

get_subject_features() method descriptor

get_subject_features(self: shapeworks_py.Analyze, arg0: typing.SupportsInt, arg1: str) -> typing.Annotated[numpy.typing.NDArray[numpy.float64], "[m, 1]"]

groups_active() method descriptor

groups_active(self: shapeworks_py.Analyze) -> bool

run_offline_analysis() method descriptor

run_offline_analysis(self: shapeworks_py.Analyze, arg0: str, arg1: typing.SupportsFloat, arg2: typing.SupportsFloat) -> None

Axis

Bases: pybind11_builtins.pybind11_object

Members:

invalid

X

Y

Z

X = <Axis.X: 0> class-attribute

Members:

invalid

X

Y

Z

Y = <Axis.Y: 1> class-attribute

Members:

invalid

X

Y

Z

Z = <Axis.Z: 2> class-attribute

Members:

invalid

X

Y

Z

invalid = <Axis.invalid: -1> class-attribute

Members:

invalid

X

Y

Z

name property

name(self: object, /) -> str

value property

DomainType

Bases: pybind11_builtins.pybind11_object

Members:

MeshDomain

ImageDomain

ContourDomain

ContourDomain = <DomainType.ContourDomain: 2> class-attribute

Members:

MeshDomain

ImageDomain

ContourDomain

ImageDomain = <DomainType.ImageDomain: 0> class-attribute

Members:

MeshDomain

ImageDomain

ContourDomain

MeshDomain = <DomainType.MeshDomain: 1> class-attribute

Members:

MeshDomain

ImageDomain

ContourDomain

name property

name(self: object, /) -> str

value property

Groom

Bases: pybind11_builtins.pybind11_object

run() method descriptor

run(self: shapeworks_py.Groom) -> bool

Image

Bases: pybind11_builtins.pybind11_object

antialias() method descriptor

antialias(self: shapeworks_py.Image, iterations: typing.SupportsInt = 50, maxRMSErr: typing.SupportsFloat = 0.009999999776482582, layers: typing.SupportsInt = 3) -> shapeworks_py.Image

antialiases binary volumes (layers is set to 3 when not specified)

applyCurvatureFilter() method descriptor

applyCurvatureFilter(self: shapeworks_py.Image, iterations: typing.SupportsInt = 10) -> shapeworks_py.Image

denoises an image using curvature driven flow using curvature flow image filter

applyGradientFilter() method descriptor

applyGradientFilter(self: shapeworks_py.Image) -> shapeworks_py.Image

computes gradient magnitude at each pixel using gradient magnitude filter

applyIntensityFilter() method descriptor

applyIntensityFilter(self: shapeworks_py.Image, min: typing.SupportsFloat = 0.0, max: typing.SupportsFloat = 0.0) -> shapeworks_py.Image

applies intensity windowing image filter

applySigmoidFilter() method descriptor

applySigmoidFilter(self: shapeworks_py.Image, alpha: typing.SupportsFloat = 10.0, beta: typing.SupportsFloat = 10.0) -> shapeworks_py.Image

computes sigmoid function pixel-wise using sigmoid image filter

applyTPLevelSetFilter() method descriptor

applyTPLevelSetFilter(self: shapeworks_py.Image, featureImage: shapeworks_py.Image, scaling: typing.SupportsFloat = 20.0) -> shapeworks_py.Image

segments structures in image using topology preserving geodesic active contour level set filter

applyTransform() method descriptor

applyTransform(args, *kwargs) Overloaded function.

  1. applyTransform(self: shapeworks_py.Image, transform: typing.Annotated[numpy.typing.ArrayLike, numpy.float64, "[4, 4]"], interp: shapeworks_py.InterpolationType = , meshTransform: bool = False) -> shapeworks_py.Image

applies the given transformation to the image by using the specified resampling filter (Linear or NearestNeighbor)

  1. applyTransform(self: shapeworks_py.Image, transform: shapeworks_py.WarpTransform, interp: shapeworks_py.InterpolationType = ) -> shapeworks_py.Image

applies the given warp transformation to the image using the specified resampling filter (Linear or NearestNeighbor)

  1. applyTransform(self: shapeworks_py.Image, transform: typing.Annotated[numpy.typing.ArrayLike, numpy.float64, "[4, 4]"], origin: collections.abc.Sequence[typing.SupportsFloat], dims: collections.abc.Sequence[typing.SupportsInt], spacing: collections.abc.Sequence[typing.SupportsFloat], direction: typing.Annotated[numpy.typing.ArrayLike, numpy.float64, "[3, 3]"], interp: shapeworks_py.InterpolationType = , meshTransform: bool = False) -> shapeworks_py.Image

applies the given transformation to the image by using resampling filter with new origin, dims, spacing, and sampling along given direction axes (a 3x3 row-major matrix) using the specified interpolation method (Linear or NearestNeighbor)

assign() method descriptor

assign(self: shapeworks_py.Image, arg0: numpy.ndarray) -> shapeworks_py.Image

Initialize an image from a numpy array (must be dtype float32). Transfers ownership of the array without copying. If a copy is desired, construct using Image(np.array(arr)).

binarize() method descriptor

binarize(self: shapeworks_py.Image, minVal: typing.SupportsFloat = 0.0, maxVal: typing.SupportsFloat = 3.4028234663852886e+38, innerVal: typing.SupportsFloat = 1.0, outerVal: typing.SupportsFloat = 0.0) -> shapeworks_py.Image

sets portion of image greater than min and less than or equal to max to the specified value

center() method descriptor

center(self: shapeworks_py.Image) -> numpy.ndarray

physical coordinates of center of this image

centerOfMass() method descriptor

centerOfMass(self: shapeworks_py.Image, minVal: typing.SupportsFloat = 0.0, maxVal: typing.SupportsFloat = 1.0) -> numpy.ndarray

returns average physical coordinate of pixels in range (minval, maxval]

clip() method descriptor

clip(args, *kwargs) Overloaded function.

  1. clip(self: shapeworks_py.Image, o: collections.abc.Sequence[typing.SupportsFloat], p1: collections.abc.Sequence[typing.SupportsFloat], p2: collections.abc.Sequence[typing.SupportsFloat], val: typing.SupportsFloat = 0.0) -> shapeworks_py.Image

sets values on the back side of cutting plane (containing three non-colinear points) to val (default 0.0)

  1. clip(self: shapeworks_py.Image, n: collections.abc.Sequence[typing.SupportsFloat], q: collections.abc.Sequence[typing.SupportsFloat], val: typing.SupportsFloat = 0.0) -> shapeworks_py.Image

sets values on the back side of cutting plane (normal n containing point p) to val (default 0.0)

closeHoles() method descriptor

closeHoles(self: shapeworks_py.Image, foreground: typing.SupportsFloat = 0.0) -> shapeworks_py.Image

closes holes in a volume defined by values larger than specified value

compare() method descriptor

compare(args, *kwargs) Overloaded function.

  1. compare(self: shapeworks_py.Image, other: shapeworks_py.Image, verifyall: bool = True, tolerance: typing.SupportsFloat = 0.0, precision: typing.SupportsFloat = 1e-06) -> bool

compares two images

  1. compare(self: shapeworks_py.Image, other: shapeworks_py.Image, verifyall: bool = True, tolerance: typing.SupportsFloat = 0.0, precision: typing.SupportsFloat = 1e-12) -> bool

compares two images

computeDT() method descriptor

computeDT(self: shapeworks_py.Image, isovalue: typing.SupportsFloat = 0.0) -> shapeworks_py.Image

computes signed distance transform volume from an image at the specified isovalue

coordsys() method descriptor

coordsys(self: shapeworks_py.Image) -> typing.Annotated[numpy.typing.NDArray[numpy.float64], "[3, 3]"]

return 3x3 coordinate system in which this image lives in physical space

copy() method descriptor

copy(self: shapeworks_py.Image) -> shapeworks_py.Image

createCenterOfMassTransform() method descriptor

createCenterOfMassTransform(self: shapeworks_py.Image) -> typing.Annotated[numpy.typing.NDArray[numpy.float64], "[m, n]"]

creates a transform that translates center of mass to center of image

createRigidRegistrationTransform() method descriptor

createRigidRegistrationTransform(self: shapeworks_py.Image, target: shapeworks_py.Image, isoValue: typing.SupportsFloat = 0.0, iterations: typing.SupportsInt = 20) -> typing.Annotated[numpy.typing.NDArray[numpy.float64], "[m, n]"]

creates transform to target image using iterative closest point (ICP) registration; images MUST be distance transforms; isovalue is used to create meshes from these distance transform images, which are then passed to ICP for the given number of iterations

crop() method descriptor

crop(self: shapeworks_py.Image, region: shapeworks::PhysicalRegion, padding: typing.SupportsInt = 0) -> shapeworks_py.Image

crops the image down to the given (physical) region, with optional padding

dims() method descriptor

dims(self: shapeworks_py.Image) -> numpy.ndarray

logical dimensions of the image

evaluate() method descriptor

evaluate(self: shapeworks_py.Image, pt: collections.abc.Sequence[typing.SupportsFloat]) -> float

evaluate the image at any given point in space

extractLabel() method descriptor

extractLabel(self: shapeworks_py.Image, label: typing.SupportsFloat = 1.0) -> shapeworks_py.Image

extracts/isolates a specific pixel label from a given multi-label volume and outputs the corresponding binary image

fitRegion() method descriptor

fitRegion(self: shapeworks_py.Image, region: shapeworks::PhysicalRegion, value: typing.SupportsFloat = 0) -> shapeworks_py.Image

crops or pads the image to fit a region with optional padding value

gaussianBlur() method descriptor

gaussianBlur(self: shapeworks_py.Image, sigma: typing.SupportsFloat = 0.0) -> shapeworks_py.Image

applies gaussian blur

getDICOMSeriesUIDs() staticmethod

getDICOMSeriesUIDs(pathname: str) -> list[str]

return the list of DICOM series UIDs found in the given directory

isolate() method descriptor

isolate(self: shapeworks_py.Image, minimum_size: typing.SupportsInt = 0) -> shapeworks_py.Image

isolate the largest object (minimum_size=0), or keep every connected component with at least minimum_size voxels

logicalBoundingBox() method descriptor

logicalBoundingBox(self: shapeworks_py.Image) -> shapeworks::IndexRegion

returns the index coordinates of this image's region

logicalToPhysical() method descriptor

logicalToPhysical(args, *kwargs) Overloaded function.

  1. logicalToPhysical(self: shapeworks_py.Image, region: shapeworks::IndexRegion) -> shapeworks::PhysicalRegion

converts from a logical region (index coordinates) to a physical region

  1. logicalToPhysical(self: shapeworks_py.Image, c: collections.abc.Sequence[typing.SupportsInt]) -> numpy.ndarray

converts a logical (index) coordinate to physical space

max() method descriptor

max(self: shapeworks_py.Image) -> float

maximum of image

mean() method descriptor

mean(self: shapeworks_py.Image) -> float

mean of image

min() method descriptor

min(self: shapeworks_py.Image) -> float

minimum of image

origin() method descriptor

origin(self: shapeworks_py.Image) -> numpy.ndarray

physical coordinates of image origin

pad() method descriptor

pad(args, *kwargs) Overloaded function.

  1. pad(self: shapeworks_py.Image, pad: typing.SupportsInt, value: typing.SupportsFloat = 0.0) -> shapeworks_py.Image

pads an image by same number of pixels in all directions with constant value

  1. pad(self: shapeworks_py.Image, padx: typing.SupportsInt, pady: typing.SupportsInt, padz: typing.SupportsInt, value: typing.SupportsFloat = 0.0) -> shapeworks_py.Image

pads an image by desired number of pixels in each direction with constant value

  1. pad(self: shapeworks_py.Image, region: shapeworks::IndexRegion, value: typing.SupportsFloat = 0.0) -> shapeworks_py.Image

pads an image to include the given region with constant value

physicalBoundingBox() method descriptor

physicalBoundingBox(self: shapeworks_py.Image, isovalue: typing.SupportsFloat = 1.0) -> shapeworks::PhysicalRegion

returns region of physical space occupied by the region of data <= the given isoValue

physicalToLogical() method descriptor

physicalToLogical(args, *kwargs) Overloaded function.

  1. physicalToLogical(self: shapeworks_py.Image, region: shapeworks::PhysicalRegion) -> shapeworks::IndexRegion

converts from a physical region to a logical region (index coordinates)

  1. physicalToLogical(self: shapeworks_py.Image, p: collections.abc.Sequence[typing.SupportsFloat]) -> numpy.ndarray

converts a physical coordinate to a logical (index) space

physicalboundingBox() method descriptor

physicalboundingBox(self: shapeworks_py.Image) -> shapeworks::PhysicalRegion

returns region of physical space occupied by this image

recenter() method descriptor

recenter(self: shapeworks_py.Image) -> shapeworks_py.Image

recenters an image by changing its origin in the image header to the physical coordinates of the center of the image

reflect() method descriptor

reflect(self: shapeworks_py.Image, axis: shapeworks_py.Axis) -> shapeworks_py.Image

reflect image with respect to logical image center and the specified axis

resample() method descriptor

resample(args, *kwargs) Overloaded function.

  1. resample(self: shapeworks_py.Image, transform: typing.Annotated[numpy.typing.ArrayLike, numpy.float64, "[4, 4]"], origin: collections.abc.Sequence[typing.SupportsFloat], dims: collections.abc.Sequence[typing.SupportsInt], spacing: collections.abc.Sequence[typing.SupportsFloat], direction: typing.Annotated[numpy.typing.ArrayLike, numpy.float64, "[3, 3]"], interp: shapeworks_py.InterpolationType = ) -> shapeworks_py.Image

resamples by applying transform then sampling from given origin along direction axes at spacing physical units per pixel for dims pixels using specified interpolator

  1. resample(self: shapeworks_py.Image, physicalSpacing: collections.abc.Sequence[typing.SupportsFloat], interp: shapeworks_py.InterpolationType = ) -> shapeworks_py.Image

resamples image using new physical spacing, updating logical dims to keep all image data for this spacing

  1. resample(self: shapeworks_py.Image, isoSpacing: typing.SupportsFloat = 1.0, interp: shapeworks_py.InterpolationType = ) -> shapeworks_py.Image

isotropically resamples image using giving isospacing

resize() method descriptor

resize(self: shapeworks_py.Image, logicalDims: collections.abc.Sequence[typing.SupportsInt], interp: shapeworks_py.InterpolationType = ) -> shapeworks_py.Image

change logical dims (computes new physical spacing)

rotate() method descriptor

rotate(args, *kwargs) Overloaded function.

  1. rotate(self: shapeworks_py.Image, angle: typing.SupportsFloat, axis: itk::Vector) -> shapeworks_py.Image

rotate around center (not origin) using axis (default z-axis) by angle (in radians)

  1. rotate(self: shapeworks_py.Image, angle: typing.SupportsFloat, axis: shapeworks_py.Axis) -> shapeworks_py.Image

rotate around center (not origin) using axis (default z-axis) by angle (in radians)

  1. rotate(self: shapeworks_py.Image, angle: typing.SupportsFloat, axis: collections.abc.Sequence[typing.SupportsFloat]) -> shapeworks_py.Image

rotate around center (not origin) using axis (default z-axis) by angle (in radians)

scale() method descriptor

scale(self: shapeworks_py.Image, scale_vec: collections.abc.Sequence[typing.SupportsFloat]) -> shapeworks_py.Image

scale image by scale_vec around center (not origin)

setCoordsys() method descriptor

setCoordsys(self: shapeworks_py.Image, coordsys: typing.Annotated[numpy.typing.ArrayLike, numpy.float64, "[3, 3]"] = [1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0]) -> shapeworks_py.Image

sets the orientation of this image

setOrigin() method descriptor

setOrigin(self: shapeworks_py.Image, origin: collections.abc.Sequence[typing.SupportsFloat] = [0.0, 0.0, 0.0]) -> shapeworks_py.Image

sets the image origin in physical space to the given value

setSpacing() method descriptor

setSpacing(self: shapeworks_py.Image, spacing: collections.abc.Sequence[typing.SupportsFloat] = [1.0, 1.0, 1.0]) -> shapeworks_py.Image

set image spacing, the size of each pixel

size() method descriptor

size(self: shapeworks_py.Image) -> numpy.ndarray

physical dimensions of the image (dims * spacing)

spacing() method descriptor

spacing(self: shapeworks_py.Image) -> numpy.ndarray

physical spacing of the image

std() method descriptor

std(self: shapeworks_py.Image) -> float

standard deviation of image

toArray() method descriptor

toArray(self: shapeworks_py.Image, copy: bool = False, for_viewing: bool = False) -> numpy.ndarray

returns raw array of image data, directly sharing data by default, copying if specified. NOTE: many Image operations reallocate image array, so while the array returned from this function is writable, it is best used immediately for Python operations; use for_viewing argument to get array in column-major ('F') order ('sw2vtkImage' already does this).

toMesh() method descriptor

toMesh(self: shapeworks_py.Image, isovalue: typing.SupportsFloat) -> shapeworks::Mesh

converts image to mesh at specified isovalue

topologyPreservingSmooth() method descriptor

topologyPreservingSmooth(self: shapeworks_py.Image, scaling: typing.SupportsFloat = 20.0, sigmoidAlpha: typing.SupportsFloat = 10.5, sigmoidBeta: typing.SupportsFloat = 10.0) -> shapeworks_py.Image

creates a feature image (by applying gradient then sigmoid filters), then passes it to the TPLevelSet filter [curvature flow filter is often applied to the image before this filter]

translate() method descriptor

translate(self: shapeworks_py.Image, v: collections.abc.Sequence[typing.SupportsFloat]) -> shapeworks_py.Image

translates image

write() method descriptor

write(self: shapeworks_py.Image, filename: str, compressed: bool = True) -> shapeworks_py.Image

writes the current image (determines type by its extension)

ImageUtils

Bases: pybind11_builtins.pybind11_object

boundingBox() staticmethod

boundingBox(args, *kwargs) Overloaded function.

  1. boundingBox(filenames: collections.abc.Sequence[str], isoValue: typing.SupportsFloat = 1.0) -> shapeworks_py.PhysicalRegion

compute largest bounding box surrounding the specified isovalue of the specified set of filenames

  1. boundingBox(images: collections.abc.Sequence[shapeworks_py.Image], isoValue: typing.SupportsFloat = 1.0) -> shapeworks_py.PhysicalRegion

compute largest bounding box surrounding the specified isovalue of the specified set of images

createWarpTransform() staticmethod

createWarpTransform(source_landmarks: str, target_landmarks: str, stride: typing.SupportsInt = 1) -> shapeworks_py.WarpTransform

computes a warp transform from the source to the target landmarks (in the given files) using every stride points

IndexRegion

Bases: pybind11_builtins.pybind11_object

max property

max point of region

min property

min point of region

origin() method descriptor

origin(self: shapeworks_py.IndexRegion) -> numpy.ndarray

return origin of region

pad() method descriptor

pad(self: shapeworks_py.IndexRegion, padding: typing.SupportsInt) -> shapeworks_py.IndexRegion

grows or shrinks the region by the specified amount

size() method descriptor

size(self: shapeworks_py.IndexRegion) -> numpy.ndarray

return size of region

valid() method descriptor

valid(self: shapeworks_py.IndexRegion) -> bool

ensure if region is valid

InterpolationType

Bases: pybind11_builtins.pybind11_object

Members:

Linear

NearestNeighbor

Linear = <InterpolationType.Linear: 0> class-attribute

Members:

Linear

NearestNeighbor

NearestNeighbor = <InterpolationType.NearestNeighbor: 1> class-attribute

Members:

Linear

NearestNeighbor

name property

name(self: object, /) -> str

value property

Mesh

Bases: pybind11_builtins.pybind11_object

Affine = <AlignmentType.Affine: 2> class-attribute

Members:

Rigid

Similarity

Affine

Butterfly = <SubdivisionType.Butterfly: 0> class-attribute

Members:

Butterfly

Loop

Face = <FieldType.Face: 1> class-attribute

Members:

Point

Face

Gaussian = <CurvatureType.Gaussian: 1> class-attribute

Members:

Principal

Gaussian

Mean

Loop = <SubdivisionType.Loop: 1> class-attribute

Members:

Butterfly

Loop

Mean = <CurvatureType.Mean: 2> class-attribute

Members:

Principal

Gaussian

Mean

Point = <FieldType.Point: 0> class-attribute

Members:

Point

Face

PointToCell = <DistanceMethod.PointToCell: 1> class-attribute

Members:

PointToPoint

PointToCell

PointToPoint = <DistanceMethod.PointToPoint: 0> class-attribute

Members:

PointToPoint

PointToCell

Principal = <CurvatureType.Principal: 0> class-attribute

Members:

Principal

Gaussian

Mean

Rigid = <AlignmentType.Rigid: 0> class-attribute

Members:

Rigid

Similarity

Affine

Similarity = <AlignmentType.Similarity: 1> class-attribute

Members:

Rigid

Similarity

Affine

AlignmentType

Bases: pybind11_builtins.pybind11_object

Members:

Rigid

Similarity

Affine

Affine = <AlignmentType.Affine: 2> class-attribute

Members:

Rigid

Similarity

Affine

Rigid = <AlignmentType.Rigid: 0> class-attribute

Members:

Rigid

Similarity

Affine

Similarity = <AlignmentType.Similarity: 1> class-attribute

Members:

Rigid

Similarity

Affine

name property

name(self: object, /) -> str

value property

CurvatureType

Bases: pybind11_builtins.pybind11_object

Members:

Principal

Gaussian

Mean

Gaussian = <CurvatureType.Gaussian: 1> class-attribute

Members:

Principal

Gaussian

Mean

Mean = <CurvatureType.Mean: 2> class-attribute

Members:

Principal

Gaussian

Mean

Principal = <CurvatureType.Principal: 0> class-attribute

Members:

Principal

Gaussian

Mean

name property

name(self: object, /) -> str

value property

DistanceMethod

Bases: pybind11_builtins.pybind11_object

Members:

PointToPoint

PointToCell

PointToCell = <DistanceMethod.PointToCell: 1> class-attribute

Members:

PointToPoint

PointToCell

PointToPoint = <DistanceMethod.PointToPoint: 0> class-attribute

Members:

PointToPoint

PointToCell

name property

name(self: object, /) -> str

value property

FieldType

Bases: pybind11_builtins.pybind11_object

Members:

Point

Face

Face = <FieldType.Face: 1> class-attribute

Members:

Point

Face

Point = <FieldType.Point: 0> class-attribute

Members:

Point

Face

name property

name(self: object, /) -> str

value property

SubdivisionType

Bases: pybind11_builtins.pybind11_object

Members:

Butterfly

Loop

Butterfly = <SubdivisionType.Butterfly: 0> class-attribute

Members:

Butterfly

Loop

Loop = <SubdivisionType.Loop: 1> class-attribute

Members:

Butterfly

Loop

name property

name(self: object, /) -> str

value property

applySubdivisionFilter() method descriptor

applySubdivisionFilter(self: shapeworks_py.Mesh, type: shapeworks_py.Mesh.SubdivisionType = , subdivision: typing.SupportsInt = 1) -> shapeworks_py.Mesh

applies subdivision filter (butterfly (default) or loop)

applyTransform() method descriptor

applyTransform(self: shapeworks_py.Mesh, transform: typing.Annotated[numpy.typing.ArrayLike, numpy.float64, "[4, 4]"], imageTransform: bool = False) -> shapeworks_py.Mesh

applies the given transformation to the mesh

boundingBox() method descriptor

boundingBox(self: shapeworks_py.Mesh) -> shapeworks_py.PhysicalRegion

computes bounding box of current mesh

center() method descriptor

center(self: shapeworks_py.Mesh) -> numpy.ndarray

center of mesh

centerOfMass() method descriptor

centerOfMass(self: shapeworks_py.Mesh) -> numpy.ndarray

center of mass of mesh

clip() method descriptor

clip(args, *kwargs) Overloaded function.

  1. clip(self: shapeworks_py.Mesh, point: collections.abc.Sequence[typing.SupportsFloat], normal: collections.abc.Sequence[typing.SupportsFloat]) -> shapeworks_py.Mesh

clips a mesh using a cutting plane

  1. clip(self: shapeworks_py.Mesh, o: collections.abc.Sequence[typing.SupportsFloat], p1: collections.abc.Sequence[typing.SupportsFloat], p2: collections.abc.Sequence[typing.SupportsFloat]) -> shapeworks_py.Mesh

clips a mesh using a cutting plane

clipClosedSurface() method descriptor

clipClosedSurface(self: shapeworks_py.Mesh, point: collections.abc.Sequence[typing.SupportsFloat], normal: collections.abc.Sequence[typing.SupportsFloat]) -> shapeworks_py.Mesh

clips a mesh using a cutting plane resulting in a closed surface

closestPoint() method descriptor

closestPoint(self: shapeworks_py.Mesh, point: collections.abc.Sequence[typing.SupportsFloat]) -> tuple

returns closest point to given point on mesh

closestPointId() method descriptor

closestPointId(self: shapeworks_py.Mesh, point: collections.abc.Sequence[typing.SupportsFloat]) -> int

returns closest point id in this mesh to the given point in space

compareField() method descriptor

compareField(self: shapeworks_py.Mesh, other_mesh: shapeworks_py.Mesh, name1: str, name2: str = '', eps: typing.SupportsFloat = -1.0) -> bool

compares two meshes based on fields

computeNormals() method descriptor

computeNormals(self: shapeworks_py.Mesh) -> shapeworks_py.Mesh

computes and adds oriented point and cell normals

computeThickness() method descriptor

computeThickness(self: shapeworks_py.Mesh, ct: shapeworks_py.Image, dt: shapeworks_py.Image = None, maxDist: typing.SupportsFloat = 10000, medianRadius: typing.SupportsFloat = 5.0, distanceMesh: str = '') -> shapeworks_py.Mesh

Computes cortical thickness

copy() method descriptor

copy(self: shapeworks_py.Mesh) -> shapeworks_py.Mesh

coverage() method descriptor

coverage(self: shapeworks_py.Mesh, otherMesh: shapeworks_py.Mesh, allowBackIntersections: bool = True, angleThreshold: typing.SupportsFloat = 0, backSearchRadius: typing.SupportsFloat = 0) -> shapeworks_py.Mesh

determines coverage between current mesh and another mesh (e.g. acetabular cup / femoral head)

createTransform() method descriptor

createTransform(self: shapeworks_py.Mesh, target: shapeworks_py.Mesh, align: shapeworks_py.Mesh.AlignmentType = , iterations: typing.SupportsInt = 10) -> typing.Annotated[numpy.typing.NDArray[numpy.float64], "[4, 4]"]

creates a transform using specified AlignmentType (Mesh.Rigid, Mesh.Similarity, Mesh.Affine) for specified number of iterations (default alignment: Similarity, default iterations: 10)

curvature() method descriptor

curvature(self: shapeworks_py.Mesh, type: shapeworks_py.Mesh.CurvatureType = ) -> numpy.ndarray

computes and adds curvature (principal (default) or gaussian or mean)

distance() method descriptor

distance(self: shapeworks_py.Mesh, target: shapeworks_py.Mesh, method: shapeworks_py.Mesh.DistanceMethod = ) -> tuple

computes closest distance from vertices of this mesh to target mesh, returning the distances and the indices of faces or vertices in the target mesh that contain the closest points; the distances are also stored on this mesh as a 'distance' point field

extractLargestComponent() method descriptor

extractLargestComponent(self: shapeworks_py.Mesh) -> shapeworks_py.Mesh

extract the largest connected component from the mesh

faces() method descriptor

faces(self: shapeworks_py.Mesh) -> typing.Annotated[numpy.typing.NDArray[numpy.int32], "[m, n]"]

matrix with number of faces with indices of the three points from which each face is composed

fillHoles() method descriptor

fillHoles(self: shapeworks_py.Mesh, hole_size: typing.SupportsFloat = 1000) -> shapeworks_py.Mesh

finds holes in a mesh and closes them

fixElement() method descriptor

fixElement(self: shapeworks_py.Mesh) -> shapeworks_py.Mesh

fix element winding of mesh

geodesicDistance() method descriptor

geodesicDistance(args, *kwargs) Overloaded function.

  1. geodesicDistance(self: shapeworks_py.Mesh, source: typing.SupportsInt, target: typing.SupportsInt) -> float

computes geodesic distance between two vertices (specified by their indices) on mesh

  1. geodesicDistance(self: shapeworks_py.Mesh, landmark: collections.abc.Sequence[typing.SupportsFloat]) -> numpy.ndarray

computes geodesic distance between a point (landmark) and each vertex on mesh

  1. geodesicDistance(self: shapeworks_py.Mesh, curve: collections.abc.Sequence[collections.abc.Sequence[typing.SupportsFloat]]) -> numpy.ndarray

computes geodesic distance between a set of points (curve) and all vertices on mesh

getFace() method descriptor

getFace(self: shapeworks_py.Mesh, id: typing.SupportsInt) -> numpy.ndarray

return indices of the three points with which the face at the given index is composed

getField() method descriptor

getField(self: shapeworks_py.Mesh, name: str, type: shapeworks_py.Mesh.FieldType) -> numpy.ndarray

gets the field

getFieldNames() method descriptor

getFieldNames(self: shapeworks_py.Mesh) -> list[str]

print all field names in mesh

getFieldValue() method descriptor

getFieldValue(self: shapeworks_py.Mesh, idx: str, name: typing.SupportsInt) -> float

gets the value at the given index of field

getMultiFieldValue() method descriptor

getMultiFieldValue(self: shapeworks_py.Mesh, idx: str, name: typing.SupportsInt) -> typing.Annotated[numpy.typing.NDArray[numpy.float64], "[m, 1]"]

gets the vector value at the given index of field

getPoint() method descriptor

getPoint(self: shapeworks_py.Mesh, id: typing.SupportsInt) -> numpy.ndarray

(x,y,z) coordinates of vertex at given index

interpolateFieldAtPoint() method descriptor

interpolateFieldAtPoint(self: shapeworks_py.Mesh, field: str, point: collections.abc.Sequence[typing.SupportsFloat]) -> float

Interpolate the feature at the location using barycentric coordinate

interpolate_scalars_to_mesh() method descriptor

interpolate_scalars_to_mesh(self: shapeworks_py.Mesh, name: str, positions: typing.Annotated[numpy.typing.ArrayLike, numpy.float64, "[m, 1]"], scalar_values: typing.Annotated[numpy.typing.ArrayLike, numpy.float64, "[m, 1]"]) -> None

Interpolate scalars to mesh

invertNormals() method descriptor

invertNormals(self: shapeworks_py.Mesh) -> shapeworks_py.Mesh

handle flipping normals

numFaces() method descriptor

numFaces(self: shapeworks_py.Mesh) -> int

number of faces

numPoints() method descriptor

numPoints(self: shapeworks_py.Mesh) -> int

number of points

points() method descriptor

points(self: shapeworks_py.Mesh) -> typing.Annotated[numpy.typing.NDArray[numpy.float64], "[m, n]"]

matrix with number of points with (x,y,z) coordinates of each point

probeVolume() method descriptor

probeVolume(self: shapeworks_py.Mesh, image: shapeworks_py.Image) -> shapeworks_py.Mesh

samples image data values at point locations specified by image

reflect() method descriptor

reflect(self: shapeworks_py.Mesh, axis: shapeworks_py.Axis, origin: collections.abc.Sequence[typing.SupportsFloat] = [0.0, 0.0, 0.0]) -> shapeworks_py.Mesh

reflect meshes with respect to a specified center and specific axis

remesh() method descriptor

remesh(self: shapeworks_py.Mesh, numVertices: typing.SupportsInt, adaptivity: typing.SupportsFloat) -> shapeworks_py.Mesh

applies remeshing using approximated centroidal voronoi diagrams for a given number of vertices and adaptivity

remeshPercent() method descriptor

remeshPercent(self: shapeworks_py.Mesh, percentage: typing.SupportsFloat, adaptivity: typing.SupportsFloat) -> shapeworks_py.Mesh

applies remeshing using approximated centroidal voronoi diagrams for a given percentage of vertices and adaptivity

rotate() method descriptor

rotate(self: shapeworks_py.Mesh, angle: typing.SupportsFloat, axis: shapeworks_py.Axis) -> shapeworks_py.Mesh

rotate using axis by angle (in degrees)

scale() method descriptor

scale(self: shapeworks_py.Mesh, v: collections.abc.Sequence[typing.SupportsFloat]) -> shapeworks_py.Mesh

scale mesh

setField() method descriptor

setField(self: shapeworks_py.Mesh, name: str, array: numpy.ndarray, type: shapeworks_py.Mesh.FieldType = ) -> shapeworks_py.Mesh

sets the given field for points with array (type defaults to Point)

setFieldValue() method descriptor

setFieldValue(self: shapeworks_py.Mesh, idx: str, value: typing.SupportsInt, name: typing.SupportsFloat = '') -> None

sets the given index of field to value

smooth() method descriptor

smooth(self: shapeworks_py.Mesh, iterations: typing.SupportsInt = 0, relaxation: typing.SupportsFloat = 0.0) -> shapeworks_py.Mesh

applies laplacian smoothing

smoothSinc() method descriptor

smoothSinc(self: shapeworks_py.Mesh, iterations: typing.SupportsInt = 0, passband: typing.SupportsFloat = 0.0) -> shapeworks_py.Mesh

applies windowed sinc smoothing

toDistanceTransform() method descriptor

toDistanceTransform(self: shapeworks_py.Mesh, region: shapeworks_py.PhysicalRegion = { min: [1e+09, 1e+09, 1e+09], max: [-1e+09, -1e+09, -1e+09] }, spacing: collections.abc.Sequence[typing.SupportsFloat] = [1.0, 1.0, 1.0], padding: collections.abc.Sequence[typing.SupportsInt] = [1, 1, 1]) -> shapeworks_py.Image

converts specified region to distance transform image with specified spacing and padding (default: unit spacing and 1 pixel of padding)

toImage() method descriptor

toImage(self: shapeworks_py.Mesh, region: shapeworks_py.PhysicalRegion = { min: [1e+09, 1e+09, 1e+09], max: [-1e+09, -1e+09, -1e+09] }, spacing: collections.abc.Sequence[typing.SupportsFloat] = [1.0, 1.0, 1.0]) -> shapeworks_py.Image

rasterize specified region to create binary image of desired dims (default: unit spacing)

translate() method descriptor

translate(self: shapeworks_py.Mesh, v: collections.abc.Sequence[typing.SupportsFloat]) -> shapeworks_py.Mesh

translates mesh

write() method descriptor

write(self: shapeworks_py.Mesh, pathname: str, binaryFile: bool = False) -> shapeworks_py.Mesh

writes mesh, format specified by filename extension

MeshUtils

Bases: pybind11_builtins.pybind11_object

boundaryLoopExtractor() staticmethod

boundaryLoopExtractor(mesh: shapeworks_py.Mesh) -> shapeworks_py.Mesh

for a mesh extracts the boundary loop and export the boundary loop as a contour .vtp file

boundingBox() staticmethod

boundingBox(args, *kwargs) Overloaded function.

  1. boundingBox(filenames: collections.abc.Sequence[str], center: bool = False) -> shapeworks_py.PhysicalRegion

calculate bounding box incrementally for meshes

  1. boundingBox(meshes: collections.abc.Sequence[shapeworks_py.Mesh], center: bool = False) -> shapeworks_py.PhysicalRegion

calculate bounding box incrementally for meshes

computeMeanNormals() staticmethod

computeMeanNormals(args, *kwargs) Overloaded function.

  1. computeMeanNormals(filenames: collections.abc.Sequence[str], autoGenerateNormals: bool = True) -> numpy.ndarray

computes average normals for each point in given set of meshes

  1. computeMeanNormals(meshes: collections.abc.Sequence[shapeworks_py.Mesh]) -> numpy.ndarray

computes average normals for each point in given set of meshes

findReferenceMesh() staticmethod

findReferenceMesh(meshes: collections.abc.Sequence[shapeworks_py.Mesh], random_subset: typing.SupportsInt = -1) -> int

find reference mesh from a set of meshes

generateNormals() staticmethod

generateNormals(meshes: collections.abc.Sequence[shapeworks_py.Mesh], forceRegen: bool = False) -> None

generates and adds normals for points and faces for each mesh in given set of meshes

sharedBoundaryExtractor() staticmethod

sharedBoundaryExtractor(mesh_l: shapeworks_py.Mesh, mesh_r: shapeworks_py.Mesh, tol: typing.SupportsFloat = 0.001) -> tuple

extract the shared boundary for the given left and right meshes and save the individual meshes

MeshWarper

Bases: pybind11_builtins.pybind11_object

buildMesh() method descriptor

buildMesh(self: shapeworks_py.MeshWarper, particles: typing.Annotated[numpy.typing.ArrayLike, numpy.float64, "[m, n]"]) -> shapeworks_py.Mesh

Build the mesh from particle positions (matrix [Nx3])

extractLandmarks() method descriptor

extractLandmarks(self: shapeworks_py.MeshWarper, warped_mesh: shapeworks_py.Mesh) -> typing.Annotated[numpy.typing.NDArray[numpy.float64], "[m, n]"]

Extract the landmarks from the warped mesh and return the landmarks (matrix [Nx3])

generateWarp() method descriptor

generateWarp(args, *kwargs) Overloaded function.

  1. generateWarp(self: shapeworks_py.MeshWarper, reference_mesh: shapeworks_py.Mesh, reference_particles: typing.Annotated[numpy.typing.ArrayLike, numpy.float64, "[m, n]"]) -> bool

Assign the reference mesh/particles (matrix [Nx3]) and pre-compute the warping

  1. generateWarp(self: shapeworks_py.MeshWarper, reference_mesh: shapeworks_py.Mesh, reference_particles: typing.Annotated[numpy.typing.ArrayLike, numpy.float64, "[m, n]"], landmarks: typing.Annotated[numpy.typing.ArrayLike, numpy.float64, "[m, n]"]) -> bool

Assign the reference mesh/particles (matrix [Nx3]) and landmarks (matrix [Nx3]) and pre-compute the warping

getGoodParticlesIndices() method descriptor

getGoodParticlesIndices(self: shapeworks_py.MeshWarper) -> list[int]

Return the indexes of good particles.

getLandmarksMap() method descriptor

getLandmarksMap(self: shapeworks_py.MeshWarper) -> dict[int, int]

Return the map of landmarks to vertices.

getNumWarpVertices() method descriptor

getNumWarpVertices(self: shapeworks_py.MeshWarper) -> int

Return the number of vertices in the warped mesh.

getReferenceMesh() method descriptor

getReferenceMesh(self: shapeworks_py.MeshWarper) -> shapeworks_py.Mesh

Return the mesh used for warping.

getReferenceParticles() method descriptor

getReferenceParticles(self: shapeworks_py.MeshWarper) -> typing.Annotated[numpy.typing.NDArray[numpy.float64], "[m, n]"]

Return the particles used for warping.

getWarpMatrix() method descriptor

getWarpMatrix(self: shapeworks_py.MeshWarper) -> typing.Annotated[numpy.typing.NDArray[numpy.float64], "[m, n]"]

Return the warping matrix (Vertices = Warp * Control).

getWarpMethod() method descriptor

getWarpMethod(self: shapeworks_py.MeshWarper) -> shapeworks_py.WarpMethod

Return the current warp method.

hasBadParticles() method descriptor

hasBadParticles(self: shapeworks_py.MeshWarper) -> bool

Return true if warping has removed any bad particle(s).

prepareMesh() staticmethod

prepareMesh(mesh: shapeworks_py.Mesh) -> shapeworks_py.Mesh

Return the prepared mesh used for warping (before vertices were inserted).

setWarpMethod() method descriptor

setWarpMethod(self: shapeworks_py.MeshWarper, method: shapeworks_py.WarpMethod) -> None

Set the warp method (WarpMethod.Laplacian or WarpMethod.Biharmonic)

MorphologicalDeviationScore

Bases: pybind11_builtins.pybind11_object

GetMorphoDevScore() method descriptor

GetMorphoDevScore(self: shapeworks_py.MorphologicalDeviationScore, X: typing.Annotated[numpy.typing.ArrayLike, numpy.float64, "[m, n]"]) -> typing.Annotated[numpy.typing.NDArray[numpy.float64], "[m, 1]"]

Compute Mahalanobis-based deviation score for test samples.

Parameters

X : numpy.ndarray Matrix of test samples (n_samples x n_features)

Returns

numpy.ndarray Vector of Mahalanobis distances for each sample.

GetPCACoefficients() method descriptor

GetPCACoefficients(self: shapeworks_py.MorphologicalDeviationScore, X: typing.Annotated[numpy.typing.ArrayLike, numpy.float64, "[m, n]"]) -> typing.Annotated[numpy.typing.NDArray[numpy.float64], "[m, n]"]

Project samples onto the fitted PCA basis.

Parameters

X : numpy.ndarray Matrix of samples (n_samples x n_features)

Returns

numpy.ndarray Matrix of PCA coefficients with shape (n_samples, rank).

GetRetainedVarianceRatio() method descriptor

GetRetainedVarianceRatio(self: shapeworks_py.MorphologicalDeviationScore) -> float

Get the retained variance ratio used to choose PPCA components.

Returns

float The current retained variance ratio.

SetControlShapes() method descriptor

SetControlShapes(self: shapeworks_py.MorphologicalDeviationScore, X: typing.Annotated[numpy.typing.ArrayLike, numpy.float64, "[m, n]"]) -> bool

Fit PPCA model on control shapes.

Parameters

X : numpy.ndarray Matrix of control shapes (n_samples x n_features)

Returns

bool True if fitting was successful, False otherwise.

SetRetainedVarianceRatio() method descriptor

SetRetainedVarianceRatio(self: shapeworks_py.MorphologicalDeviationScore, ratio: typing.SupportsFloat) -> None

Set the retained variance ratio used to choose PPCA components.

Parameters

ratio : float Target cumulative variance ratio in the interval (0, 1].

Optimize

Bases: pybind11_builtins.pybind11_object

GetParticleSystem() method descriptor

GetParticleSystem(self: shapeworks_py.Optimize) -> typing.Annotated[numpy.typing.NDArray[numpy.float64], "[m, n]"]

LoadParameterFile() method descriptor

LoadParameterFile(self: shapeworks_py.Optimize, arg0: str) -> bool

Run() method descriptor

Run(self: shapeworks_py.Optimize) -> bool

SetIterationCallbackFunction() method descriptor

SetIterationCallbackFunction(self: shapeworks_py.Optimize, arg0: collections.abc.Callable[[], None]) -> None

SetUpOptimize() method descriptor

SetUpOptimize(self: shapeworks_py.Optimize, projectFile: shapeworks::Project) -> bool

Parameters

Bases: pybind11_builtins.pybind11_object

as_map() method descriptor

as_map(self: shapeworks_py.Parameters) -> dict[str, str]

get underlying map

get() method descriptor

get(self: shapeworks_py.Parameters, key: str, default: str = '') -> str

get a parameter based on a key, return default if it doesn't exist

key_exists() method descriptor

key_exists(self: shapeworks_py.Parameters, key: str) -> bool

return if a key exists or not

remove_entry() method descriptor

remove_entry(self: shapeworks_py.Parameters, key: str) -> None

remove an entry

reset_parameters() method descriptor

reset_parameters(self: shapeworks_py.Parameters) -> None

reset parameters to blank

set() method descriptor

set(args, *kwargs) Overloaded function.

  1. set(self: shapeworks_py.Parameters, key: str, Variant: shapeworks::Variant) -> None

set a parameter based on a key

  1. set(self: shapeworks_py.Parameters, key: str, value: str) -> None

set a parameter based on a key

ParticleShapeStatistics

Bases: pybind11_builtins.pybind11_object

PCA() method descriptor

PCA(args, *kwargs) Overloaded function.

  1. PCA(self: shapeworks_py.ParticleShapeStatistics, particleSystem: shapeworks_py.ParticleSystem, domainsPerShape: typing.SupportsInt = 1) -> int

calculates the eigen values and eigen vectors of the data

  1. PCA(self: shapeworks_py.ParticleShapeStatistics, project: shapeworks::Project) -> int

calculates the eigen values and eigen vectors of the data from a project

eigenValues() method descriptor

eigenValues(self: shapeworks_py.ParticleShapeStatistics) -> list[float]

return the eigen values

eigenVectors() method descriptor

eigenVectors(self: shapeworks_py.ParticleShapeStatistics) -> typing.Annotated[numpy.typing.NDArray[numpy.float64], "[m, n]"]

returns the eigenvectors

getMean() method descriptor

getMean(self: shapeworks_py.ParticleShapeStatistics) -> typing.Annotated[numpy.typing.NDArray[numpy.float64], "[m, 1]"]

returns the mean shape particles

numDims() method descriptor

numDims(self: shapeworks_py.ParticleShapeStatistics) -> int

returns the number of features of the particle system

pcaLoadings() method descriptor

pcaLoadings(self: shapeworks_py.ParticleShapeStatistics) -> typing.Annotated[numpy.typing.NDArray[numpy.float64], "[m, n]"]

returns the coefficients of the linear combination of the original variables from which the principal components are constructed

percentVarByMode() method descriptor

percentVarByMode(self: shapeworks_py.ParticleShapeStatistics) -> list[float]

return the variance accounted for by the principal components

principalComponentProjections() method descriptor

principalComponentProjections(self: shapeworks_py.ParticleShapeStatistics) -> int

projects the original data on the calculated principal components

projectNewSample() method descriptor

projectNewSample(self: shapeworks_py.ParticleShapeStatistics, newSample: typing.Annotated[numpy.typing.ArrayLike, numpy.float64, "[m, 1]"]) -> typing.Annotated[numpy.typing.NDArray[numpy.float64], "[m, 1]"]

project a new sample into the PCA space

sampleSize() method descriptor

sampleSize(self: shapeworks_py.ParticleShapeStatistics) -> int

returns the sample size of the particle system

ParticleSystem

Bases: pybind11_builtins.pybind11_object

D() method descriptor

D(self: shapeworks_py.ParticleSystem) -> int

EvaluationCompare() method descriptor

EvaluationCompare(self: shapeworks_py.ParticleSystem, arg0: shapeworks_py.ParticleSystem) -> bool

ExactCompare() method descriptor

ExactCompare(self: shapeworks_py.ParticleSystem, arg0: shapeworks_py.ParticleSystem) -> bool

N() method descriptor

N(self: shapeworks_py.ParticleSystem) -> int

Particles() method descriptor

Particles(self: shapeworks_py.ParticleSystem) -> typing.Annotated[numpy.typing.NDArray[numpy.float64], "[m, n]"]

Paths() method descriptor

Paths(self: shapeworks_py.ParticleSystem) -> list[str]

ShapeAsPointSet() method descriptor

ShapeAsPointSet(self: shapeworks_py.ParticleSystem, id_shape: typing.SupportsInt) -> typing.Annotated[numpy.typing.NDArray[numpy.float64], "[m, n]"]

Return the particle pointset [Nx3] of the specified shape

Particles

Bases: pybind11_builtins.pybind11_object

get_combined_global_particles() method descriptor

get_combined_global_particles(self: shapeworks_py.Particles) -> typing.Annotated[numpy.typing.NDArray[numpy.float64], "[m, 1]"]

combined world particles across all domains as a flat vector

get_combined_local_particles() method descriptor

get_combined_local_particles(self: shapeworks_py.Particles) -> typing.Annotated[numpy.typing.NDArray[numpy.float64], "[m, 1]"]

combined local particles across all domains as a flat vector

get_number_of_domains() method descriptor

get_number_of_domains(self: shapeworks_py.Particles) -> int

get_total_number_of_particles() method descriptor

get_total_number_of_particles(self: shapeworks_py.Particles) -> int

PhysicalRegion

Bases: pybind11_builtins.pybind11_object

max property

max point of region

min property

min point of region

expand() method descriptor

expand(args, *kwargs) Overloaded function.

  1. expand(self: shapeworks_py.PhysicalRegion, other: shapeworks_py.PhysicalRegion) -> shapeworks_py.PhysicalRegion

expand this region up to the largest portions of both

  1. expand(self: shapeworks_py.PhysicalRegion, point: itk::Point) -> shapeworks_py.PhysicalRegion

expand this region to include this point

origin() method descriptor

origin(self: shapeworks_py.PhysicalRegion) -> numpy.ndarray

return origin of region

pad() method descriptor

pad(self: shapeworks_py.PhysicalRegion, padding: typing.SupportsFloat) -> shapeworks_py.PhysicalRegion

grows or shrinks the region by the specified amount

shrink() method descriptor

shrink(self: shapeworks_py.PhysicalRegion, other: shapeworks_py.PhysicalRegion) -> shapeworks_py.PhysicalRegion

shrink this region down to the smallest portions of both

size() method descriptor

size(self: shapeworks_py.PhysicalRegion) -> numpy.ndarray

return size of region

to_string() method descriptor

to_string(self: shapeworks_py.PhysicalRegion) -> str

returns a string representation of this region

valid() method descriptor

valid(self: shapeworks_py.PhysicalRegion) -> bool

ensure if region is valid

Project

Bases: pybind11_builtins.pybind11_object

clear_parameters() method descriptor

clear_parameters(self: shapeworks_py.Project, name: str) -> None

get_domain_names() method descriptor

get_domain_names(self: shapeworks_py.Project) -> list[str]

Return the domain names (e.g. femur, pelvis, etc)

get_feature_names() method descriptor

get_feature_names(self: shapeworks_py.Project) -> list[str]

get_filename() method descriptor

get_filename(self: shapeworks_py.Project) -> str

Return the filename

get_groomed_domain_types() method descriptor

get_groomed_domain_types(self: shapeworks_py.Project) -> list[shapeworks_py.DomainType]

Return the groomed domain types

get_groomed_present() method descriptor

get_groomed_present(self: shapeworks_py.Project) -> bool

Return if groomed files are present

get_group_names() method descriptor

get_group_names(self: shapeworks_py.Project) -> list[str]

get_group_values() method descriptor

get_group_values(self: shapeworks_py.Project, group_names: str) -> list[str]

get_headers() method descriptor

get_headers(self: shapeworks_py.Project) -> list[str]

Return the headers of the subject sheet

get_images_present() method descriptor

get_images_present(self: shapeworks_py.Project) -> bool

get_number_of_domains_per_subject() method descriptor

get_number_of_domains_per_subject(self: shapeworks_py.Project) -> int

Return the number of domains

get_number_of_subjects() method descriptor

get_number_of_subjects(self: shapeworks_py.Project) -> int

Return the number of subjects in the project

get_original_domain_types() method descriptor

get_original_domain_types(self: shapeworks_py.Project) -> list[shapeworks_py.DomainType]

Return the original domain types

get_originals_present() method descriptor

get_originals_present(self: shapeworks_py.Project) -> bool

Return if original files are present

get_parameters() method descriptor

get_parameters(self: shapeworks_py.Project, name: str, domain_name: str = '') -> shapeworks::Parameters

get_particles_present() method descriptor

get_particles_present(self: shapeworks_py.Project) -> bool

Return if particle files are present

get_project_path() method descriptor

get_project_path(self: shapeworks_py.Project) -> str

Return the project path

get_string_column() method descriptor

get_string_column(self: shapeworks_py.Project, name: str) -> list[str]

Return a column by name

get_subjects() method descriptor

get_subjects(self: shapeworks_py.Project) -> list[shapeworks::Subject]

Return the list of Subjects

get_supported_version() method descriptor

get_supported_version(self: shapeworks_py.Project) -> int

get_version() method descriptor

get_version(self: shapeworks_py.Project) -> int

load() method descriptor

load(self: shapeworks_py.Project, filename: str) -> bool

Load from XLSX file

save() method descriptor

save(self: shapeworks_py.Project, filename: str = '') -> None

Save to XLSX file

set_filename() method descriptor

set_filename(self: shapeworks_py.Project, filename: str) -> None

Set project filename

set_groomed_domain_types() method descriptor

set_groomed_domain_types(self: shapeworks_py.Project, types: collections.abc.Sequence[shapeworks_py.DomainType]) -> None

Set the groomed domain types

set_original_domain_types() method descriptor

set_original_domain_types(self: shapeworks_py.Project, types: collections.abc.Sequence[shapeworks_py.DomainType]) -> None

Set the original domain types

set_parameters() method descriptor

set_parameters(self: shapeworks_py.Project, name: str, params: shapeworks::Parameters, domain_name: str = '') -> None

set_subjects() method descriptor

set_subjects(self: shapeworks_py.Project, subjects: collections.abc.Sequence[shapeworks::Subject]) -> None

store_subjects() method descriptor

store_subjects(self: shapeworks_py.Project) -> None

ReconstructSurface_RBFSSparseTransform

Bases: pybind11_builtins.pybind11_object

meanSurface() method descriptor

meanSurface(self: shapeworks_py.ReconstructSurface_RBFSSparseTransform, distanceTransformFiles: collections.abc.Sequence[str], localPointsFiles: collections.abc.Sequence[str], worldPointsFiles: collections.abc.Sequence[str]) -> None

samplesAlongPCAModes() method descriptor

samplesAlongPCAModes(self: shapeworks_py.ReconstructSurface_RBFSSparseTransform, worldPointsFiles: collections.abc.Sequence[str]) -> None

setDoProcrustes() method descriptor

setDoProcrustes(self: shapeworks_py.ReconstructSurface_RBFSSparseTransform, doProcrustes: bool) -> None

setDoProcrustesScaling() method descriptor

setDoProcrustesScaling(self: shapeworks_py.ReconstructSurface_RBFSSparseTransform, doProcrustesScaling: bool) -> None

setEnableOutput() method descriptor

setEnableOutput(self: shapeworks_py.ReconstructSurface_RBFSSparseTransform, enableOutput: bool) -> None

setMaxAngleDegrees() method descriptor

setMaxAngleDegrees(self: shapeworks_py.ReconstructSurface_RBFSSparseTransform, maxAngleDegrees: typing.SupportsFloat) -> None

setMaxStdDev() method descriptor

setMaxStdDev(self: shapeworks_py.ReconstructSurface_RBFSSparseTransform, maxStdDev: typing.SupportsFloat) -> None

setMaxVarianceCaptured() method descriptor

setMaxVarianceCaptured(self: shapeworks_py.ReconstructSurface_RBFSSparseTransform, maxVarianceCaptured: typing.SupportsFloat) -> None

setMeanBeforeWarp() method descriptor

setMeanBeforeWarp(self: shapeworks_py.ReconstructSurface_RBFSSparseTransform, meanBeforeWarp: bool) -> None

setModeIndex() method descriptor

setModeIndex(self: shapeworks_py.ReconstructSurface_RBFSSparseTransform, modeIndex: typing.SupportsInt) -> None

setNumOfClusters() method descriptor

setNumOfClusters(self: shapeworks_py.ReconstructSurface_RBFSSparseTransform, numOfClusters: typing.SupportsInt) -> None

setNumOfModes() method descriptor

setNumOfModes(self: shapeworks_py.ReconstructSurface_RBFSSparseTransform, numOfModes: typing.SupportsInt) -> None

setNumOfParticles() method descriptor

setNumOfParticles(self: shapeworks_py.ReconstructSurface_RBFSSparseTransform, numOfParticles: typing.SupportsInt) -> None

setNumOfSamplesPerMode() method descriptor

setNumOfSamplesPerMode(self: shapeworks_py.ReconstructSurface_RBFSSparseTransform, numOfSamplesPerMode: typing.SupportsInt) -> None

setOutPath() method descriptor

setOutPath(self: shapeworks_py.ReconstructSurface_RBFSSparseTransform, path: str) -> None

setOutPrefix() method descriptor

setOutPrefix(self: shapeworks_py.ReconstructSurface_RBFSSparseTransform, prefix: str) -> None

surface() method descriptor

surface(self: shapeworks_py.ReconstructSurface_RBFSSparseTransform, localPointsFiles: collections.abc.Sequence[str]) -> None

ReconstructSurface_ThinPlateSplineTransform

Bases: pybind11_builtins.pybind11_object

meanSurface() method descriptor

meanSurface(self: shapeworks_py.ReconstructSurface_ThinPlateSplineTransform, distanceTransformFiles: collections.abc.Sequence[str], localPointsFiles: collections.abc.Sequence[str], worldPointsFiles: collections.abc.Sequence[str]) -> None

samplesAlongPCAModes() method descriptor

samplesAlongPCAModes(self: shapeworks_py.ReconstructSurface_ThinPlateSplineTransform, worldPointsFiles: collections.abc.Sequence[str]) -> None

setDoProcrustes() method descriptor

setDoProcrustes(self: shapeworks_py.ReconstructSurface_ThinPlateSplineTransform, doProcrustes: bool) -> None

setDoProcrustesScaling() method descriptor

setDoProcrustesScaling(self: shapeworks_py.ReconstructSurface_ThinPlateSplineTransform, doProcrustesScaling: bool) -> None

setEnableOutput() method descriptor

setEnableOutput(self: shapeworks_py.ReconstructSurface_ThinPlateSplineTransform, enableOutput: bool) -> None

setMaxAngleDegrees() method descriptor

setMaxAngleDegrees(self: shapeworks_py.ReconstructSurface_ThinPlateSplineTransform, maxAngleDegrees: typing.SupportsFloat) -> None

setMaxStdDev() method descriptor

setMaxStdDev(self: shapeworks_py.ReconstructSurface_ThinPlateSplineTransform, maxStdDev: typing.SupportsFloat) -> None

setMaxVarianceCaptured() method descriptor

setMaxVarianceCaptured(self: shapeworks_py.ReconstructSurface_ThinPlateSplineTransform, maxVarianceCaptured: typing.SupportsFloat) -> None

setMeanBeforeWarp() method descriptor

setMeanBeforeWarp(self: shapeworks_py.ReconstructSurface_ThinPlateSplineTransform, meanBeforeWarp: bool) -> None

setModeIndex() method descriptor

setModeIndex(self: shapeworks_py.ReconstructSurface_ThinPlateSplineTransform, modeIndex: typing.SupportsInt) -> None

setNumOfClusters() method descriptor

setNumOfClusters(self: shapeworks_py.ReconstructSurface_ThinPlateSplineTransform, numOfClusters: typing.SupportsInt) -> None

setNumOfModes() method descriptor

setNumOfModes(self: shapeworks_py.ReconstructSurface_ThinPlateSplineTransform, numOfModes: typing.SupportsInt) -> None

setNumOfParticles() method descriptor

setNumOfParticles(self: shapeworks_py.ReconstructSurface_ThinPlateSplineTransform, numOfParticles: typing.SupportsInt) -> None

setNumOfSamplesPerMode() method descriptor

setNumOfSamplesPerMode(self: shapeworks_py.ReconstructSurface_ThinPlateSplineTransform, numOfSamplesPerMode: typing.SupportsInt) -> None

setOutPath() method descriptor

setOutPath(self: shapeworks_py.ReconstructSurface_ThinPlateSplineTransform, path: str) -> None

setOutPrefix() method descriptor

setOutPrefix(self: shapeworks_py.ReconstructSurface_ThinPlateSplineTransform, prefix: str) -> None

surface() method descriptor

surface(self: shapeworks_py.ReconstructSurface_ThinPlateSplineTransform, localPointsFiles: collections.abc.Sequence[str]) -> None

Shape

Bases: pybind11_builtins.pybind11_object

get_display_name() method descriptor

get_display_name(self: shapeworks_py.Shape) -> str

get_id() method descriptor

get_id(self: shapeworks_py.Shape) -> int

get_particles() method descriptor

get_particles(self: shapeworks_py.Shape) -> shapeworks_py.Particles

returns the particles for this shape

ShapeEvaluation

Bases: pybind11_builtins.pybind11_object

ComputeCompactness() staticmethod

ComputeCompactness(particleSystem: shapeworks_py.ParticleSystem, nModes: typing.SupportsInt, saveTo: str = '') -> float

Computes the compactness measure for a particle system

ComputeFullCompactness() staticmethod

ComputeFullCompactness(particleSystem: shapeworks_py.ParticleSystem, progress_callback: collections.abc.Callable[[typing.SupportsFloat], None] = None) -> typing.Annotated[numpy.typing.NDArray[numpy.float64], "[m, 1]"]

Computes the compactness measure for a particle system, all modes

ComputeFullGeneralization() staticmethod

ComputeFullGeneralization(particleSystem: shapeworks_py.ParticleSystem, progress_callback: collections.abc.Callable[[typing.SupportsFloat], None] = None, check_abort: collections.abc.Callable[[], bool] = None, surface_distance_mode: bool = False) -> typing.Annotated[numpy.typing.NDArray[numpy.float64], "[m, 1]"]

Computes the generalization measure for a particle system, all modes

ComputeFullSpecificity() staticmethod

ComputeFullSpecificity(particleSystem: shapeworks_py.ParticleSystem, progress_callback: collections.abc.Callable[[typing.SupportsFloat], None] = None, check_abort: collections.abc.Callable[[], bool] = None, surface_distance_mode: bool = False) -> typing.Annotated[numpy.typing.NDArray[numpy.float64], "[m, 1]"]

Computes the specificity measure for a particle system, all modes

ComputeGeneralization() staticmethod

ComputeGeneralization(particleSystem: shapeworks_py.ParticleSystem, nModes: typing.SupportsInt, saveTo: str = '', surface_distance_mode: bool = False) -> float

Computes the generalization measure for a particle system

ComputeSpecificity() staticmethod

ComputeSpecificity(particleSystem: shapeworks_py.ParticleSystem, nModes: typing.SupportsInt, saveTo: str = '', surface_distance_mode: bool = False) -> float

Computes the specificity measure for a particle system

Subject

Bases: pybind11_builtins.pybind11_object

get_constraints_filenames() method descriptor

get_constraints_filenames(self: shapeworks_py.Subject) -> list[str]

Get the constraints filenames (one per domain)

get_display_name() method descriptor

get_display_name(self: shapeworks_py.Subject) -> str

Get the display name

get_extra_values() method descriptor

get_extra_values(self: shapeworks_py.Subject) -> dict[str, str]

Get extra values (extra columns we don't interpret)

get_feature_filenames() method descriptor

get_feature_filenames(self: shapeworks_py.Subject) -> dict[str, str]

Get the feature map filenames

get_groomed_clipped_mesh() method descriptor

get_groomed_clipped_mesh(self: shapeworks_py.Subject, domain_id: typing.SupportsInt = 0) -> shapeworks_py.Mesh

Get the mesh clipped by constraints

get_groomed_filenames() method descriptor

get_groomed_filenames(self: shapeworks_py.Subject) -> list[str]

Get groomed filenames

get_groomed_transforms() method descriptor

get_groomed_transforms(self: shapeworks_py.Subject) -> list[list[float]]

Get the groomed transforms (one vector per domain)

get_group_value() method descriptor

get_group_value(self: shapeworks_py.Subject, group_name: str) -> str

Get a specific group value

get_group_values() method descriptor

get_group_values(self: shapeworks_py.Subject) -> tsl::ordered_map, std::__1::allocator\>, std::__1::basic_string\, std::__1::allocator\>, std::__1::hash\, std::__1::allocator\>>, std::__1::equal_to\, std::__1::allocator\>>, std::__1::allocator\, std::__1::allocator\>, std::__1::basic_string\, std::__1::allocator\>>>, std::__1::deque\, std::__1::allocator\>, std::__1::basic_string\, std::__1::allocator\>>, std::__1::allocator\, std::__1::allocator\>, std::__1::basic_string\, std::__1::allocator\>>>>, unsigned int>

Get the group values map

get_landmarks_filenames() method descriptor

get_landmarks_filenames(self: shapeworks_py.Subject) -> list[str]

Get the landmarks filenames (one per domain)

get_local_particle_filenames() method descriptor

get_local_particle_filenames(self: shapeworks_py.Subject) -> list[str]

Get local particle filenames

get_number_of_domains() method descriptor

get_number_of_domains(self: shapeworks_py.Subject) -> int

Get the number of domains

get_original_filenames() method descriptor

get_original_filenames(self: shapeworks_py.Subject) -> list[str]

Get original filenames

get_procrustes_transforms() method descriptor

get_procrustes_transforms(self: shapeworks_py.Subject) -> list[list[float]]

Get the procrustes transforms (one vector per domain)

get_world_particle_filenames() method descriptor

get_world_particle_filenames(self: shapeworks_py.Subject) -> list[str]

Get the world particle filenames

set_constraints_filenames() method descriptor

set_constraints_filenames(self: shapeworks_py.Subject, filenames: collections.abc.Sequence[str]) -> None

Set the constraint filenames (one per domain)

set_display_name() method descriptor

set_display_name(self: shapeworks_py.Subject, display_name: str) -> None

Set the display name

set_excluded() method descriptor

set_excluded(self: shapeworks_py.Subject, excluded: bool) -> None

Set excluded

set_extra_values() method descriptor

set_extra_values(self: shapeworks_py.Subject, extra_values: collections.abc.Mapping[str, str]) -> None

Set extra values

set_feature_filenames() method descriptor

set_feature_filenames(self: shapeworks_py.Subject, filenames: collections.abc.Mapping[str, str]) -> None

Set the feature map filenames

set_fixed() method descriptor

set_fixed(self: shapeworks_py.Subject, fixed: bool) -> None

Set fixed

set_groomed_filenames() method descriptor

set_groomed_filenames(self: shapeworks_py.Subject, filenames: collections.abc.Sequence[str]) -> None

Set groomed filenames

set_groomed_transforms() method descriptor

set_groomed_transforms(self: shapeworks_py.Subject, transforms: collections.abc.Sequence[collections.abc.Sequence[typing.SupportsFloat]]) -> None

Set the groomed transforms (one vector per domain)

set_group_values() method descriptor

set_group_values(self: shapeworks_py.Subject, Set group values mapgroup_values: collections.abc.Mapping[str, str]) -> None

set_landmarks_filenames() method descriptor

set_landmarks_filenames(self: shapeworks_py.Subject, filenames: collections.abc.Sequence[str]) -> None

Set the landmarks filenames (one per domain)

set_local_particle_filenames() method descriptor

set_local_particle_filenames(self: shapeworks_py.Subject, filenames: collections.abc.Sequence[str]) -> None

Set local particle filenames (one per domain)

set_number_of_domains() method descriptor

set_number_of_domains(self: shapeworks_py.Subject, number_of_domains: typing.SupportsInt) -> None

Set the number of domains

set_original_filenames() method descriptor

set_original_filenames(self: shapeworks_py.Subject, filenames: collections.abc.Sequence[str]) -> None

Set original filenames (one per domain)

set_procrustes_transforms() method descriptor

set_procrustes_transforms(self: shapeworks_py.Subject, transforms: collections.abc.Sequence[collections.abc.Sequence[typing.SupportsFloat]]) -> None

Set the procrustes transforms (one vector per domain)

set_world_particle_filenames() method descriptor

set_world_particle_filenames(self: shapeworks_py.Subject, filenames: collections.abc.Sequence[str]) -> None

Set the world particle filenames

Variant

Bases: pybind11_builtins.pybind11_object

as_str() method descriptor

as_str(self: shapeworks_py.Variant) -> str

Return the variant string content

VectorImage

Bases: pybind11_builtins.pybind11_object

evaluate() method descriptor

evaluate(self: shapeworks_py.VectorImage, pt: collections.abc.Sequence[typing.SupportsFloat]) -> list[float]

evaluate the vector image at any given point in space

WarpMethod

Bases: pybind11_builtins.pybind11_object

Members:

Laplacian

Biharmonic

Biharmonic = <WarpMethod.Biharmonic: 1> class-attribute

Members:

Laplacian

Biharmonic

Laplacian = <WarpMethod.Laplacian: 0> class-attribute

Members:

Laplacian

Biharmonic

name property

name(self: object, /) -> str

value property

WarpTransform

Bases: pybind11_builtins.pybind11_object

axis_is_valid() builtin

axis_is_valid(axis: collections.abc.Sequence[typing.SupportsFloat]) -> bool

ensure an axis is valid

degToRad() builtin

degToRad(deg: typing.SupportsFloat) -> float

convert degrees to radians

mean() builtin

mean(arg0: numpy.ndarray) -> float

incrementally compute (single-component) mean of field

range() builtin

range(arg0: numpy.ndarray) -> list[float]

compute (single-component) range of field

seed() builtin

seed(seed: typing.SupportsInt = 1784653900016739) -> None

sets the seed for random number generation (internal use)

set_progress_callback() builtin

set_progress_callback(callback: typing_extensions.CapsuleType) -> None

sets up a progress callback

setup_console_logging() builtin

setup_console_logging(show_progress: bool = True, xml_status: bool = False) -> None

sets up console logging options

stddev() builtin

stddev(arg0: numpy.ndarray) -> float

compute (single-component) standard deviation of field

toAxis() builtin

toAxis(str: str) -> shapeworks_py.Axis

convert to axis