First time here? Checkout the FAQ!
x
0 votes
by (300 points)

I want to evenly select some points on the surface of my left atrium model at 1 cm intervals as stimulus points, just as stated in Frontiers | A Reproducible Protocol to Assess Arrhythmia Vulnerability in silico: Pacing at the End of the Effective Refractory Period (frontiersin.org)We tested inducibility of arrhythmic episodes by pacing from stimulus locations placed on the endocardial surface with inter-point distance of 1 cm, resulting in up to 227 evenly distributed points.

What should I do, thank you! My left atrium model is CARP format.

1 Answer

0 votes
by (230 points)

Hi Jerry Tom,

We normally extract the points on the surface mesh using vtk in Python. Here you can find an example to run the PEERP protocol. Inside the src folder, you can find a Python script getStimPoints.py, where you just need to set --mesh your_mesh_folder --tolerance 10000. I guess your mesh is already in microns, right? ;) 

Let me know if you have any further questions.

Patricia

by (300 points)
Dear Patricia:
Thank you very much for providing the source code, but I have encountered a problem that when I execute getStimPoints.py directly, I will get an error as follows:

  File "/home/z/reproducible_example/src/getStimPoints.py", line 137, in main
    stim_pts = vtk.util.numpy_support.vtk_to_numpy(clean.GetOutput().GetPoints().GetData())
                                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'GetData'

I find that the reason may be that the generated LA_endo_um.vtk is empty.
In the original file, it had 78,569 points, but in the new file, it has 0 points. I want to ask you why this is, thanks again for your help!
by (230 points)
Hi Jerry,
The code expects a bilayer mesh with the endocardium labelled with tags from 1-10, and then performs a threshold to extract it. If your input mesh is not a bilayer or has different tags, you can omit this step and extract the points directly after reading your mesh. Hope this solves the issue, otherwise let me know.
Best wishes,
Paty
by (300 points)
Dear Patricia:
Thank you very much for your prompt reply on Saturday morning. Your reply is very helpful to me, and I will keep it in mind in the future research.
I just spent an hour going through the code and found that the problem was in:

endo = vtk_thr(bilayer, 2, "CELLS", "elemTag", thr_range[1], thr_range[0])

In fact, the order of thr_range[1] and thr_range[0] is reversed, and the correct code should be:

endo = vtk_thr(bilayer, 2, "CELLS", "elemTag", thr_range[0], thr_range[1])

In addition, since `np.bool` was a deprecated alias for the builtin `bool`, this causes numpy_support.py in the vtk module to report an error. I add "np.bool = np.bool_" to the code, and now the file is working perfectly.
Thanks again for your help! It got me over a key hurdle.
Welcome to openCARP Q&A. Ask questions and receive answers from other members of the community. For best support, please use appropriate TAGS!
architecture, carputils, documentation, experiments, installation-containers-packages, limpet, slimfem, website, governance
...