First time here? Checkout the FAQ!
x
0 votes
by (1.3k points)
Dear all,

I was wondering if there is an equivalent to GLGradient from carpentry (https://carpentry.medunigraz.at/examples/tutorials/tutorials.05_pre_post_processing.05_igbutils.run.html?highlight=glgradient#exercise-3-glgradient) to compute conduction velocity on a given mesh. I wasn't able to find it on the openCARP website.

Thanks!!

Cheers,

T

1 Answer

+1 vote
by (8.0k points)
selected by
 
Best answer
Hi!

Use "meshtool extract gradient". This works for .dat files as well as .igb files.

Best, Aurel
by (1.3k points)
Hi Aurel!

Thanks for your answer.

I tried now :

meshtool extract gradient -msh=path-to-my-mesh.pts  -idat=vm.igb -odat=gradient -ifmt=carp_txt

Where vm.igb is one beat of my simulation.

I get two files, one is the gradient.grad.igb and the other the gradient.gradmag.igb. The first one if I open with meshalyzer I can see that it shows the voltage gradient over time (mainly shown by the depolarization wave). The other one, which I thought might be the conduction velocity, is also a time-stack, which doesn't show any particular pattern but just noise. I would expect the CV file to be just 1 frame, and to show a particular pattern that can be expected from watching the voltage. On GLGradient one could define another option (--velocity) so one would get the velocity directly, but this extract gradient from meshtool doesn't seem to have it.
by (1.3k points)
edited by
Okay, I realize that I should do the gradient of the LAT :D

Thanks!
by (1.3k points)
This still doesn't seem to work :(

I have created my LATS file with igbapd:
igbapd -l -20 -O LAT_S1.dat  -s vm_S1.igb

since this also gives me the APD I extract the second column:
awk '{ print $2 }' LAT_S1.dat> LATS_S1_onecol.dat

The LATs on meshalyzer look good.

And now I run the extract gradient on the LATs:
meshtool extract gradient -msh=<path-to-my-mesh>.pts -idat=LATS_S1_onecol.dat-odat=CV

I get the CV.gradmag.dat and the CV.grad.vec. If I open the CV.gradmag.dat with meshalyzer on my mesh, it prints out a very weird 'zebra' pattern, that doesn't match with the expected result (from what one can observe in Vm). Is there something I am missing?
by (8.0k points)
I tried your approach myself and it works in general. You need a high temporal resolution in you vm.igb though (e.g. dt = 10 spacedt = 0.01).

Note that what you get when computing the gradient of LATs is the *inverse* conduction velocity, since it is the spatial derivative of a time field. It helps looking at the units: dt [ms] / dx [um], that is, change in activation time over change in space.

You can do something like the following to arrive at the final CV in [m/s]:

igbapd -l -20 -O LAT_S1.dat -s vm.igb
awk '{print $2}' LAT_S1.dat > LAT.dat
meshtool extract gradient -msh block_i -idat LAT.dat -odat iCV
awk '{v = $1; print (1.0/v)/1000.0}' iCV.gradmag.dat > CV.dat

Best, Aurel
by (1.3k points)
Cool! Thanks for your help Aurel! I guess the resolution is my problem here. I was running the simulations with dt=5 and spacedt=1. I will re-run with higher resolution!
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
MathJax.Hub.Config({ tex2jax: { inlineMath: [ ['$','$'], ["\\(","\\)"] ], config: ["MMLorHTML.js"], jax: ["input/TeX"], processEscapes: true } }); MathJax.Hub.Config({ "HTML-CSS": { linebreaks: { automatic: true } } });
...