1 Introduction

Statistical Shape Modeling (SSM) is a widespread method used to analyze shape variation across 3D anatomical samples within a population. These analyses are crucial in detecting common morphological pathologies and advancing the understanding of different diseases by studying the form-function relationships between anatomies [2, 5,6,7,8, 13, 16,17,18, 21]. While building SSMs, certain biomedical and clinical applications require a focus on specific anatomical regions of interest (ROIs) to tailor the analysis to precise morphological features (e.g. [1,2,3,4, 11, 14,15,16]). Such applications might require excluding certain surface aspects, modeling certain regions in isolation, or a mix of these. ROI definition without altering the input shape has been achieved using constraints, mathematical delimiters that restrict model construction to certain surface areas [11]. Our approach focuses on redesigning the constraint application method to improve its functionality, flexibility, and efficiency during SSM construction.

To construct such SSMs, two distinct families of shape representations can be used to allow for statistical analysis, deformation fields and landmarks. Whereas the former encodes implicit transformations between cohort samples and a pre-defined (or learned) atlas, the latter uses explicit landmark points spread on shape surfaces that correspond across the population [19, 20]. We focus on the latter approach given its extensive use due to its simplicity, computational efficiency, and interpretability for statistical analysis [19, 22]. Although landmarks used to be manually placed on specific anatomical features of interest, the modern convention uses dense automatically-placed landmarks obtained through computational methods, such as minimum description length (MDL) [12], and particle-based shape modeling (PSM) [9, 10]). We utilize PSM, an efficient and robust entropy-based optimization method that creates a system of dense landmarks or particles, which conform to all population shape surfaces while maintaining correspondence across them.

A previous attempt to constrain PSM particle distributions uses geometric primitives in the form of spheres or cutting planes to exclude regions [11]. This exclusion is achieved by projecting virtual particles onto these geometric primitives (represented as parametric constraints), relying on the entropy objective to repel landmark particles away from these areas. Such an approach has the advantage of not altering input surfaces, which can otherwise distort morphology or necessitate manual expert-driven reprocessing of data. However, it falters when arbitrary regions of interest cannot be expressed via geometric primitives, limiting the topologies to be modeled. It also exhibits poor scaling due to it requiring an additional set of projected virtual particles per constraint. Thereby, to address these shortcomings in the existing literature, we propose the use of the quadratic penalty method in the optimization to allow the simultaneous and scalable application of cutting-plane, spheres, other primitive constraints, as well as a proposed method of defining arbitrary surface constraints, or free-form constraints (FFCs). This method provides both flexibility in the definition of constraints to define ROIs and scalability with large-scale or heavily constrained populations without the need to reprocess data.

2 Method

The aforementioned automatic landmark placement methods take in a population of \(I-\) shapes \(\mathcal {S} = \{\textbf{S}_i\}_{i=1}^I\) (binary segmentations, meshes, or n-dimensional contours), and obtain particles \(\mathbf {\mathcal {P}}= \{\textbf{P}_i\}_{i=1}^I\) where the \(i-\)th shape point distribution model (PDM) is denoted by \(J-\)particles \(\textbf{P}_i = [\textbf{p}_{i,1}, \textbf{p}_{i,2}, \cdots , \textbf{p}_{i,J}]\), where \(\textbf{p}_{i,j} \in \mathbb {R}^3\). Such particles are obtained by optimizing an objective \(f(\mathbf {\mathcal {P}})\), which give

$$\begin{aligned} f(\mathbf {\mathcal {P}}) = H(\mathbf {\mathcal {P}}) - \sum _{j=1}^J H(\textbf{P}_i), \end{aligned}$$
(1)

where H is an estimation of the differential entropy. The particles enable quantifying subtle differences and computing shape statistics (e.g., by performing the principal component analysis (PCA) on corresponding particles) by providing a population-specific anatomical mapping across the given cohort.

We constrain each shape \(\textbf{S}_i\) by \(M_i-\)inequality constraints in the form \(g_{i,m}(\textbf{p}) \le 0\), where \(g_{i,m}(\textbf{p})\) is a differentiable function. These parametric constraints can be in the form of cutting planes or spheres as showcased in [11] (by using the equations of planes or spheres), other parametric delimiters, or free-form constraints, which allow arbitrary surface region definition. These constraints limit the distribution of particles to regions that satisfy the inequality, a region more easily demarcated using parametric constraints in some anatomies, and/or free-form surface-painting in others.

In this section, we describe the use of a quadratic penalty method to allow efficient and simultaneous enforcement of an arbitrary number of parametric constraints, and the use of signed mesh vector fields to build free-form constraints that allow arbitrary surface region isolation. We will also showcase a friendly graphical interface to define these constraints.

2.1 Quadratic Penalty for Efficient Constrained PDM Construction

We define an extended objective function to express this constrained optimization problem in an unconstrained form. For each constraint function in the form \(g_{i,m}(\textbf{p}) \le 0\), we add a quadratic penalty term \(g_{i,m}^+(\textbf{p}) = \max (0, g_{i,m}(\textbf{p}))\) to the optimization objective, yielding

$$\begin{aligned} F(\mathbf {\mathcal {P}}) = f(\mathbf {\mathcal {P}}) + \sum _{i=1}^I \sum _{m=1}^{M_i} \sum _{j=1}^J g_{i,m}^+(\textbf{p}_{i,j}). \end{aligned}$$
(2)

We optimize this objective function using a Gauss-Seidel gradient descent scheme, with the second term preventing particles from violating constraints, hence restricting their movement exclusively to feasible regions. This method scales linearly with respect to the number of particles per shape, whereas the virtual particle model [11] scales quadratically.

2.2 Free-Form Constraints

We express free-form constraints in the same form \(g_{i,m}(\textbf{p}) \le 0\) for each shape \(\textbf{S}_i\) by attributing a distance and gradient field onto each vertex of a mesh \(\textbf{M}_i\). Any feasible region on the surface of \(\textbf{M}_i\) can be delineated by a set of surface boundaries \(\mathcal {B}_i =[\textbf{B}_{i,1}, \textbf{B}_{i,2}, \cdots , \textbf{B}_{i,B}]\), which are represented as vertex loops on the mesh surface. A distance field query for a particle \(\textbf{p}\), denoted \(\textbf{M}^d_i(\textbf{p})\), provides the signed geodesic distance to the closest constraint boundary \(\textbf{B}_{i,*}\) from the projection of \(\textbf{p}\) onto \(M_i\), illustrated in Fig. 1 (b). Similarly, a gradient field query, denoted \(\textbf{M}^g_i(\textbf{p})\), would provide the gradient direction, shown in Fig. 1 (c). Ultimately, the mesh \(\textbf{M}_i\) together with its fields \(\textbf{M}^d_i\) and \(\textbf{M}^g_i\), can approximate the distance and first-order gradients over near-surface points, effectively simulating a differentiable function \(g_{i,m}(\textbf{p})\). When integrated into the aforementioned penalty method 2.1, this approach can enforce arbitrary surface constraints.

Fig. 1.
figure 1

(a) Constrained particle distribution on a sphere, where yellow illustrates the feasible region of the constrained area where particles are allowed to be distributed, the gray is the infeasible region where if particles were to be there, they would be violating the constraint. (b) Distance field \(\textbf{M}^d_i(\textbf{p})\) of signed geodesic distances to the surface of every mesh vertex. (c) Gradient field \(\textbf{M}^g_i(\textbf{p})\) on the mesh surface at every mesh vertex represented using white arrows and the blue surface as the feasible region. (Color figure online)

2.3 Graphical Interface Tool

We include a graphical interface tool that can define cutting planes and FFCs and can roughly propagate these to all shapes in the population. Cutting planes are defined by prompting 3 points that the user can pick that are on the shape surface, and can be copy-pasted into all other shapes. FFCs are defined using a “painting” tool that can define included and excluded areas with an adjustable brush size. This tool allows precise and arbitrarily customizable definition of constraints. An FFC on a single shape can be propagated to others using deformation parameters computed from image registration. This functionality is also included. All the graphical interface functionality is illustrated in Fig. 2.

Fig. 2.
figure 2

(a) The constraint panel shows the constraints that have been defined and the tools to define the constraints. (b) Cutting-plane constraints are defined by ctrl-clicking 3 points on the shape surface. (c) Constraints can be flipped or applied to all other shapes via the right-click menu. (d) FFCs are defined with a painting tool with different brush sizes and options to customize included and excluded areas. We show how the painting of excluded areas of different sizes applied to a segmentation of a left atrium.

3 Results

We demonstrate our results by integrating our method into an open-source implementation of the particle-based shape modeling (PSM) framework, ShapeWorks [9], and produce SSMs from three datasets. The first is a synthetic dataset of ellipsoids that vary between values of 10, 20, 30, and 40, in each of their three major axes, totaling 64 ellipsoids. These ellipsoids are constrained by a free-form boundary that divides each ellipsoid into upper and lower halves by a full period of a sine wave projected onto the surface, providing a challenging but uniformly delimited population of shapes. Figure 3 shows a few examples and the modes of variation from the SSM. The constraints have the desired effect, and the modes of variation meet expectations as they mimic the variation in the three major axes.

Fig. 3.
figure 3

(a) Sample ellipsoids from the dataset with feasible regions in yellow and restricted regions in grey. (b) The first three modes of variation in the dataset, which show the variation in corresponding major axes. (Color figure online)

The second is a dataset of 25 computerized tomography (CT) femurs, where the region of interest is the proximal femur sans the lesser trochanter (femoral head, neck, and greater trochanter). For each shape, we use a cutting plane constraint to exclude the shaft and a free-form constraint to exclude the lesser trochanter. Figure 4 illustrates a few examples and the first two modes of variation. We observe that a cutting plane allows a more straightforward exclusion of the shaft whilst the FFC precisely excludes the lesser trochanter. The constraints restrict the movement of particles to the feasible region as expected, and the modes of variation meet expectation as well.

Fig. 4.
figure 4

(a) Example of defined constraints. The feasible region is shown in yellow and the constrained region in grey. (b) The first two modes of variation in the dataset. Notice that particles are excluded from the lesser trochanter. (Color figure online)

The third dataset comprises 21 segmentation of left atria models obtained from MRIs. The pulmonary veins represent the area of greatest variation both in anatomical structure (e.g. number of veins, common veins, etc.) as well as greatest variability in segmentation by expert observers (e.g. length into vein to segment). While the position of veins may be important from a shape modeling perspective, their exact shape is not particularly relevant to LA shape morphology. Thus, we paint a free-form constraint exclusion area around the veins. Figure 5 showcases some examples of the shape and the first three modes of variation. The models meet expectations.

Fig. 5.
figure 5

(a) Example of defined constraints where the left atrium (in yellow) segmentations have the pulmonary veins excluded (in grey). (b) The first three modes of variation in the dataset. Notice how the pulmonary vein areas remain hollow. (Color figure online)

4 Conclusion

We demonstrate a flexible and more scalable approach to define regions of interest in fully-groomed shapes for landmark-based statistical shape modeling by allowing arbitrary definition of surface constraints via FFCs and incorporating mixed constraint types into the optimization. This significantly improves the usability of PSM methods, obviating the need for reprocessing datasets. Future work includes the automatic propagation of constraints to the entire cohort given manual definitions on certain representative shapes.