shape_pca — SHAPESTAT model op

• Data kinds: shapeset → shapemodel

• Call: import fullseye as fs; fs.ledger.shape_pca(shapes, n_components: 'int' = 0, align: 'bool' = True) (to call the implementation directly, import shapestats; shapestats.shape_pca(shapes, n_components: 'int' = 0, align: 'bool' = True); from the registry, opsshapestat.get("shape_pca"))

Usage

Shape PCA (statistical shape model). → dict (shapemodel).

Returned dict: mean (N,3) / components (k, N*3) / variance (k,) / n_points / total_variance / aligned (K,N,3).

n_components=0 (default) means all min(K-1, N*3) components. With align=True, generalized_procrustes is applied first (taking PCA without aligning makes the 1st principal component "the difference in position", and the shape story disappears).

★ The variance is the sample variance (divided by K-1). With small K the eigenvalues come out systematically large. Until the number of individuals reaches 2 digits, look at the ratios rather than the eigenvalues themselves.

★★ align=True also removes "differences in size", so it eats the variance of modes close to size. shape_synth_family makes the 1st mode "stretching/shrinking along the long axis" and the 2nd "bending", with a weight ratio of 0.30 : 0.12, so the ground-truth variance ratio is 6.25. Measured (K=40, N=80, seed=7):

========================== ========== ======================

preprocessing var. ratio contribution (1st / 2nd)

========================== ========== ======================

align=False 6.981 0.8747 / 0.1253

GPA(scaling=False) 6.981 0.8747 / 0.1253

align=True (default) 2.565 0.7188 / 0.2803

========================== ========== ======================

Stretching closely resembles uniform enlargement, so the scale removal of Procrustes takes away more than half of it. Not a mistake but a consequence of the definition -- unless you decide first "whether size counts as a trait", the same data yields different principal components. If you want growth or differences in build to be part of the shape story, use align=False (or pass it through generalized_procrustes(scaling=False) and then align=False).

Detailed usage guide

• shape_statistics family guide

References (sample data, literature)

• Sample-data catalog (download URLs / licences) — 2-D uses skimage.data (BSD/public domain) plus synthetic images; 3-D lists download URLs for real data sources (Stanford, PDS, …).

• Operator provenance and references — the sources of the research/methods this op family came from.

• The canonical algorithm (author, year) and its uses are named in the family usage guide above.

Runnable examples (verified samples that actually call this op)

• shapestat_landmark_tour — py -3.11 examples/shapestat_landmark_tour.py

Ops the type connects to (they accept shapemodel as input)

shape_project · shape_reconstruct · shape_mahalanobis · shape_explained_variance · shape_synthesize

Same category (model)

shape_project · shape_reconstruct · shape_mahalanobis · shape_explained_variance · shape_synthesize


*Provenance: shapestats.py — SHAPESTAT operator registry. This per-op note is generated by tools/opdocs.py md (do not hand-edit).*

© 2026 Kazufumi Furuse — Fullseye operator documentation. Licensed under Apache-2.0.