Skip to content

Add PaintModel module (MeshMixer-like model face labeling) - #1

Open
aabrown100-git wants to merge 8 commits into
SimVascular:mainfrom
aabrown100-git:main
Open

Add PaintModel module (MeshMixer-like model face labeling)#1
aabrown100-git wants to merge 8 commits into
SimVascular:mainfrom
aabrown100-git:main

Conversation

@aabrown100-git

@aabrown100-git aabrown100-git commented Jul 22, 2026

Copy link
Copy Markdown

Current situation

https://github.com/JolleyLab/SlicerHeart-Simvascular-Private/issues/22#issuecomment-5027649601

Release Notes

Adds Paint Model, a new scripted module for interactively painting,
grouping, and exporting face regions on surface models. The workflow —
auto-partition by dihedral angle, then merge, brush-paint, and edit groups
by hand — is inspired by Meshmixer's face-group tools.

Features

  • Auto-partitions polygons into face groups by dihedral-angle threshold,
    merging small groups into their largest shared-boundary neighbor.
  • Brush painting in the 3D view: S/D + drag to select/deselect;
    G expand to groups, I invert, N new group from selection, C clear.
  • Stable per-group coloring, with the active selection highlighted yellow.
  • Export to .vtp with a ModelFaceID cell array.

Video showing available features, in order

  • Automatic face detection
  • Brush select
  • Brush deselect
  • Expand selection to group
  • Invert selection
  • New group from selection
  • Clear selection
Screen.Recording.2026-07-23.at.11.03.03.AM.mov

7/30/26 Update: After making some performance optimizations (d4431b5), the interactivity of Brush select is much better than shown in the above video. Now, there is basically no perceptible latency.

Changes

  • PaintModel/ — new module (widget, logic, tests)
  • CMakeLists.txt — register the module
  • README.md, Docs/PaintModel.md — docs and tutorial

Documentation

Documentation is added in the extension README.md and docs/PaintModel.md.

Testing

PaintModel functionality was test using a local Slicer installation (Slicer 5.10.0 on 2026 MacBook Pro M5 Pro, MacOS Tahoe 26.5.2)

Code of Conduct & Contributing Guidelines

Extracted the face-group creation, brush-based selection, editing (expand,
invert, clear, new group from selection), color visualization, and .vtp
export tools that were built into the SurfaceToolbox 'Group faces' panel,
and turned them into their own standalone module, PaintModel, with a
dedicated always-visible panel.
@aabrown100-git

Copy link
Copy Markdown
Author

@lassoan Should I ask anyone to review/test it, or can I just merge it?

@aabrown100-git

Copy link
Copy Markdown
Author

@lassoan @alisonmarsden @ktbolt Just checking if we want anyone to review this PR.

@ktbolt

ktbolt commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

@aabrown100-git I not familiar with Slicer so I probably can't do much of a review ! However, a couple of comments.

Are developers not opening GitHub Issues for these new modules so other developers can comment on the proposed new additions ? iI seems that you have needed to use thus sort of Meshmixer capability for your research but it is not clear why you needed it and how you used it.

How will the output of this module be used by the other SImVascular modules ?

@aabrown100-git

Copy link
Copy Markdown
Author

@ktbolt The utility of this tool is briefly stated in the linked issue under Current Situation, but you're right there should be a dedicated issue on this. Originally, I created this tool to be part of a different Slicer extension.

I'm not exactly sure how this fits in with other SimVascular modules, but I think this tool should eventually live in the SimVascular Modeling module. I've reached out to members of the Slicer-SimVascular migration team to make sure they are aware of this.

@lassoan

lassoan commented Jul 30, 2026

Copy link
Copy Markdown
Collaborator

While the module could be enhanced and tailored to the needs of specific workflows, I think it is reasonable to add it to this extension as is, as an "Experimental" module (it could be a category in the top-level readme.md file).

A couple of improvements that could be considered (these are just ideas, prioritization should be driven by actual modeling workflow needs):

  • make the output array name editable
  • allow using geodesic distance instead of selection by sphere (using Dynamic Modeler module's "Select by points" tool)
  • show a table of output values and associated name, allow deleting, renaming
  • remove "Export vtp" option, as you can simply right-click and choose Export to file
  • allow defining region by markup points like in "Select by points"
  • allow defining region by drawing closed a curve on the surface (using Dynamic Modeler module's "Curve cut" tool)
  • allow defining regions by thresholding a point or cell array
  • operations on the selected table entry/entries: merge, split (based on connectedness), remove small islands, invert, etc.

@ktbolt

ktbolt commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

@aabrown100-git I was initially thinking that the capabilities of this tool should be added to the SimVascular Modeling module but now I'm wondering about how to best manage the complexity (GUI controls and core compute code) of SimVascular Modules.

When I worked on AVS we implemented modules to be as lean as possible, doing one thing, making them easier to maintain and test.

Maybe it would be good to consider the PaintModel as a filter that could feed into the SimVascular Modeling module. Some of the other SimVascular Modeling capabilities (e.g., surface smoothing) could be removed and replaced by a Slicer module that already does this.

@lassoan

lassoan commented Jul 30, 2026

Copy link
Copy Markdown
Collaborator

There can be multiple level of modules:

  • low level general-purpose tools that expose all options, very flexible, can be complex
  • high-level workflow modules that implement a complete workflow in a single module; they use various lower level modules

PaintModel is a low-level tool that can be used as is for experimenting; and it could be used in the future by workflow modules.

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