SimVascular / SimVascular/svVascularize
Specifying number of nodes per unit length as opposed to nodes per vessel
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 19
- Forks
- 11
- Avg merge
- 1h 58m
- Merged PRs (30d)
- 19
Description
Problem
Currently, I am using the the _build_constrained_tissue_mesh function to constrain nodes from the exported mesh to the tree centerlines. However, I noticed that currently, you are only really only able to make out the nodes corresponding to the small terminal branches (i.e. there is a lot of empty space for the vessels that are much longer). Here is a screenshot of the exported tissue mesh in paraview, where I used a threshold filter to only show the constained nodes (as opposed to the entire mesh).
I would expect this to be problematic for the application of mapping the pressure values from 0D fluids to the node IDs that are sparse for long vessels.
Solution
Possibly an approach that specifies the number of nodes per unit length as opposed to nodes per vessel (current). At the lowest level, I anticipate that this would change the write_splines() function implementation to include something like:
num_points = max(2, int(round(branch_lengths[vessel] * nodes_per_unit_length)) + 1)
t = np.linspace(0, 1, num=num_points)
where nodes_per_unit_length may just use the old value "spline_sample_points" with the intent of specifying how many nodes should appear along a given unit length.
Rather than the current spacing that strictly constrains nodes per vessel:
t = np.linspace(0, 1, num=spline_sample_points)
I would propose implementing a getter function to return vessel length:
def get_lengths(data, branches):
To later be called in write_splines() function or even within the get_interpolated_sv_data(data) function definition in which you are already calling other getters and returns the input interp_xyzr you call in the write_splines() function.
Additional context
No response
Code of Conduct
- I agree to follow this project's Code of Conduct and Contributing Guidelines
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with write_splines() and get_interpolated_sv_data(), where spline_sample_points currently controls interpolation; inspect how branch_lengths and branches are represented before deciding where length calculation belongs. Verify that long and short vessels receive node counts proportional to length, with at least two points per vessel, and check the resulting constrained mesh node distribution.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- computer-graphics
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100