Skip to content

Variable radius stent - #4

Open
lassoan wants to merge 2 commits into
SimVascular:mainfrom
lassoan:variable-radius-stent
Open

lassoan wants to merge 2 commits into
SimVascular:mainfrom
lassoan:variable-radius-stent

Conversation

@lassoan

@lassoan lassoan commented Sep 10, 2026 •

Copy link
Copy Markdown

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_sculpt and compute_sdf_contact_displacements
    now 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).
  • New cap_height_fraction parameter 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.
  • New profile helpers in svmorph.core: stent_radius_profile (control points) and
    flared_stent_radius_profile (smoothstep flare).
  • New deploy_stent options: --flare-R, --flare-length, --flare-end,
    --cap-height-fraction.
  • Not breaking: all defaults reproduce the previous behavior exactly (scalar radius,
    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.py covers scalar/array radius equivalence, per-segment radius
interpolation, spherical vs. flattened cap geometry, and preservation of a concave
(dumbbell) profile; tests/test_geometry.py extended for the profile helpers. Full suite
passes (35 passed).

Code of Conduct & Contributing Guidelines

lassoan and others added 2 commits September 10, 2026 08:28
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>
@jeffbli

jeffbli commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

Hi @lassoan , I took a closer look at the behavior of this flared-stent extension, I have two questions:

  1. It seems like the current CLI only supports flaring one end of the stent at a time, and the full capability of specifying a variable radius profile is not yet available in the CLI or the GUI? I think the user may usually want to model a flared stent is flared at both ends?
  2. More importantly: I tried the current one-end flare functionality on an example geometry and rendered the resulting stent SDF to visualize it. I noticed that the current half ellipsoid based construction results in a wavey artifact throughout the stent SDF itself, which in turn results in the expanded surface also having a wavey surface?

(vanilla stent, flared stent with spherical end cap, flared stent with half ellipsoid end cap, final surface)
Screenshot 2026-09-11 at 12 14 55 AM
Screenshot 2026-09-11 at 12 15 02 AM
Screenshot 2026-09-11 at 12 15 08 AM
Screenshot 2026-09-11 at 12 42 20 AM

@lassoan

lassoan commented Sep 11, 2026

Copy link
Copy Markdown
Author

It seems like the current CLI only supports flaring one end of the stent at a time, and the full capability of specifying a variable radius profile is not yet available in the CLI or the GUI? I think the user may usually want to model a flared stent is flared at both ends?

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.

More importantly: I tried the current one-end flare functionality on an example geometry and rendered the resulting stent SDF to visualize it. I noticed that the current half ellipsoid based construction results in a wavey artifact throughout the stent SDF itself, which in turn results in the expanded surface also having a wavey surface?

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants