1D Modeling VTK Export Option

Provides a system for patient-specific cardiovascular modeling and simulation.
POST REPLY
User avatar
Sohrab Tehrani
Posts: 17
Joined: Sun May 03, 2020 4:53 pm

1D Modeling VTK Export Option

Post by Sohrab Tehrani » Sun Feb 28, 2021 10:57 pm

Dear SimVascular Team,

I have a question regarding the exportation of the 1D modeling outputs as .VTK files. I know that we can change this option directly from solver.in file and the solver will automatically write the modeling outputs as VTK format which can be subsequently used in paraview for animation creation.

Now, assume that we have solved the 1D governing equations for the same geometry, with the same boundary conditions and material properties, but with some other solver. Now we have Area, Flow, and Pressure as a function of x,t for all segments as text files and I would like to convert those results to VTK format and visualize my results in paraview using the SimVascular VTK export option. Is that possible to do so?

I appreciate your help in advance
Sohrab

User avatar
Martin Pfaller
Posts: 59
Joined: Tue Oct 01, 2019 10:23 am

Re: 1D Modeling VTK Export Option

Post by Martin Pfaller » Mon Mar 01, 2021 6:21 pm

Hi Sohrab,

Unfortunately, the conversion you're talking about happens inside svOneDSolver, so it won't work with your solver.

I'm currently including a method to export 1D results to the centerline .vtp. You can check it out in my fork of SimVascular:

https://github.com/mrp089/SimVascular/b ... ts/post.py

If that suits your purpose, you could take my code and include a small function to read your results in the same format to do the same export.

Let me know if you have more questions!

Out of curiosity, what 1D solver are you using?

Martin

User avatar
Sohrab Tehrani
Posts: 17
Joined: Sun May 03, 2020 4:53 pm

Re: 1D Modeling VTK Export Option

Post by Sohrab Tehrani » Wed Mar 10, 2021 11:17 am

Hello Martin,

Thanks for your response. I'll look at your code and will let you know if I could run it. I use Nektar1D solver. Another question:
In the "solver.in" file that SimVascular automatically generates to run the 1D solver, we need to specify the inlet and outlet area of each segment in the SEGMENT CARD. However, assume that for one of the segments in our arterial tree, I need to specify the cross-sectional areas at each spatial position x during that segment (instead of just specifying the inlet and outlet areas). In other words, I need to specify the shape of the vessel. How I can do this inside SimVascular and how should I modify the "solver.in" file to take that into account?

Thanks so much for your response.
Sohrab

User avatar
Martin Pfaller
Posts: 59
Joined: Tue Oct 01, 2019 10:23 am

Re: 1D Modeling VTK Export Option

Post by Martin Pfaller » Wed Mar 10, 2021 6:25 pm

Hi Sohrab,

You can specify the number of sampling points within a branch in SimVascular. That will sample the area at points inside the branch and not just at the inlet and outlet. This will translate to several 1D segments per vessel branch

If you're using the GUI, inside the "SV 1D Simulation" plugin you can set the option "Number of segments per branch" to >1.

If you're using the Python, you can set the parameters seg_min_num (Min number of sub-segments in a vessel master-segment) and seg_size (Sub-segment size in a vessel-master segment). If you set seg_min_num = -1 you get a 1D segment for every segment of the centerline (very fine).

Best
Martin

User avatar
Sohrab Tehrani
Posts: 17
Joined: Sun May 03, 2020 4:53 pm

Re: 1D Modeling VTK Export Option

Post by Sohrab Tehrani » Wed Mar 10, 2021 8:24 pm

Hello Martin

Thanks for your response. Unfortunately, I cannot find the option "Number of segments per branch" inside the "SV 1D Simulation" plugin. Should I update my SimVasular?

Best,
Sohrab

User avatar
Martin Pfaller
Posts: 59
Joined: Tue Oct 01, 2019 10:23 am

Re: 1D Modeling VTK Export Option

Post by Martin Pfaller » Thu Mar 11, 2021 7:21 pm

Yes

User avatar
Mohammad Sarabian
Posts: 4
Joined: Mon Mar 23, 2020 3:48 pm

Re: 1D Modeling VTK Export Option

Post by Mohammad Sarabian » Fri Apr 02, 2021 11:43 am

Thanks Martin,

It worked. I have another question regarding the exportation of the 1D modeling outputs as .VTK files. Currently, if we set to export the data files as .VTK file, SimVascular maps the flow variables on the straight tubes. In other words, it maps the 1D simulation outputs on an arterial network that consists of several straight tubes and doesn't map them on the actual centerlines that have curvature and tortuosity. How can I change that to map them on the centerlines with curvature rather than straight tubes. This is important for me for the flow visualization.

Thanks so much for your response in advance.
Best,
Sohrab

User avatar
Martin Pfaller
Posts: 59
Joined: Tue Oct 01, 2019 10:23 am

Re: 1D Modeling VTK Export Option

Post by Martin Pfaller » Wed Apr 07, 2021 8:47 am

Hi Sohrab,

I'm glad it worked! We are currently implementing what you're looking for. I'll let you know once we have merged that feature into SimVascular!

Martin

User avatar
Martin Pfaller
Posts: 59
Joined: Tue Oct 01, 2019 10:23 am

Re: 1D Modeling VTK Export Option

Post by Martin Pfaller » Fri Apr 09, 2021 9:01 am

We now included your feature in SimVascular. We're still experimenting it, but you can go ahead and pull the current master. Please let us know how it works!

POST REPLY