Conversation
Generalize the capsule-chain stent SDF from a single shared radius (pill shape) to an arbitrary radius profile along the centerline: capsule_sdf, smin_sdf_capsule_contact_sculpt and compute_sdf_contact_displacements now accept the stent radius either as a scalar (unchanged behavior) or as a per-vertex array of shape (V,), linearly interpolated along each capsule segment (a chain of tapered capsules). This enables flared (funnel or trumpet shaped) ends, tapers, and other variable-radius stents. The per-segment distance/direction computation shared by the two SDF functions is factored into a common helper. A new cap_height_fraction parameter (default 1.0 = the original spherical caps) flattens the capsule end caps into half ellipsoids whose axial semi-axis is the given fraction of the local radius, implemented by scaling up the axial overshoot in each segment's closest-point computation. Flattened caps let a radius profile express concave features - a wide capsule's spherical end cap would otherwise bulge a full radius deep into a neighboring narrow region and wash the narrowing out - and keep a flared end from inflating a large ball into the vessel beyond the stent end. New geometry helpers build per-vertex radius profiles for a stent axis: stent_radius_profile (from arbitrary (position, radius) control points) and flared_stent_radius_profile (smoothstep flare at one end), both exported from svmorph.core. stent_bounding_box accepts a per-vertex radius array (its maximum is used for culling). All defaults preserve the previous behavior exactly; existing call sites are unchanged. Adds unit tests for radius interpolation, scalar/array equivalence, cap shapes, concave (dumbbell) profile preservation, and the profile helpers. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
New command line options for the variable-radius SDFStent deployment: --flare-R, --flare-length and --flare-end deploy a stent with a flared (funnel/trumpet shaped) end whose radius transitions from the target radius to the flare radius with a smoothstep profile; --cap-height-fraction flattens the capsule end caps into half ellipsoids (recommended ~0.35 for flared or concave profiles; the default 1.0 keeps the classic spherical caps). During deployment the whole radius profile is expanded proportionally with the nominal radius, so the flared end reaches the flare radius exactly when the body reaches the target radius. Documented in the README with a usage example. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
88a73c2 to
7aaaa5d
Compare
|
Hi @lassoan , I took a closer look at the behavior of this flared-stent extension, I have two questions:
(vanilla stent, flared stent with spherical end cap, flared stent with half ellipsoid end cap, final surface) |
Good point, I agree that it could be useful to expose an option on the CLI to make both ends flared. The full radius array can only be specified via the library API (this is what the Slicer module uses). I only added GUI to the Slicer module, I don't intend to modify the GUI in the svMorph package.
Depending on the point density and cap height indeed the field can be wavy. I always provided a combination of these that avoid waves, but I can change the algorithm to avoid the waves even if the profile is specified with a sparse point set. I'll push updates to this branch soon. |




Current situation
The SDFStent capsule-chain SDF uses a single shared radius, so deployed stents are always
uniform-radius "pills". Simulating flared (funnel/trumpet) stent ends - or other
variable-radius devices - is not possible. No tracking issue; developed for and already
exercised by the SlicerSimVascular extension
(https://github.com/lassoan/SlicerSimVascular/tree/flared-stent).
Release Notes
capsule_sdf,smin_sdf_capsule_contact_sculptandcompute_sdf_contact_displacementsnow accept the stent radius as a per-vertex array (linearly interpolated along each
capsule segment) in addition to a scalar, enabling arbitrary radius profiles along the
centerline (flared ends, tapers, local narrowings).
cap_height_fractionparameter flattens capsule end caps into half ellipsoids;this lets concave profiles deploy without wide capsules' spherical caps filling in
neighboring narrow regions, and keeps a flared end from inflating a ball beyond the stent.
svmorph.core:stent_radius_profile(control points) andflared_stent_radius_profile(smoothstep flare).deploy_stentoptions:--flare-R,--flare-length,--flare-end,--cap-height-fraction.spherical caps); existing call sites are unchanged.
Documentation
All new/changed functions have NumPy-style docstrings; a flared-stent
deployment example is added to README with parameter explanations.
Testing
New
tests/test_deformation.pycovers scalar/array radius equivalence, per-segment radiusinterpolation, spherical vs. flattened cap geometry, and preservation of a concave
(dumbbell) profile;
tests/test_geometry.pyextended for the profile helpers. Full suitepasses (35 passed).
Code of Conduct & Contributing Guidelines