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

In the tutorials on ECG and extracellular potentials, meshalyzer is called and the block geometry is rendered. In a separate meshalyzer call, the "ecg.pts" geometry is called. My question is whether it is possible to add the ecg points to the block geometry in order to visualize the location of the electrodes with respect to the medium?

When I attempt this, I get a segmentation fault and meshalyzer crashes or I get the message that it is incompatible.

Thank you a lot and great tutorial!

Lore

1 Answer

0 votes
by (110 points)

Hello Lore,

Sorry for the delayed answer. We have checked and are aware of this issue. At the moment it is not possible to show both in meshalyzer without creating auxiliary meshes and extra files. If you want more information on this you can check the meshalyzer manual which is in its repository. However, we are working on a solution to create all the files needed automatically. You can follow this issue here: https://git.opencarp.org/openCARP/openCARP/issues/67

Regards

Mark

by (630 points)
Hello Mark

If I am correct, this feature should be implemented now. I think the tutorial and the documentation is however not updated yet. Could you please provide a bit more information to the sentence:

Usage: from carputils.carpio import txt
txt.write(<output.pts_t>, <recvPhie.igb>, ptsf='<recvSites.pts>') # kwargs notation is needed

What are the different necessary arguments exactly?

Thanks for your response


Lore
by (110 points)
Hello Lore,

For this feature to work make sure you have downloaded the latest version of openCARP. To create the aux grid use the feature as follows:

ECG_outputpoints = os.path.join(CALLER_DIR, 'ecg.pts')
ECG_data = os.path.join(CALLER_DIR, job.ID, 'phie_recovery.igb')
aux = os.path.join(CALLER_DIR, job.ID, 'ecg.pts_t')
txt.write(aux, ECG_data, ptsf=ECG_outputpoints)

It is also implemented in tutorial 07_extracellular in the visualization section of the run.py .
If you want to know more about the kwargs notation for the txt class, the fastest way is to check the source code: https://git.opencarp.org/openCARP/carputils/blob/master/carputils/carpio/txt.py

In response to your original question: To visualize everything in meshalyzer you can open the tissue mesh, use readIGB for the tissue data, and then use the read aux grid. This should load the geometry and also the corresponding data.
Use the AUX Tab in meshalyzer. Use the "Highlight" field to specify the point you want to plot and click plot to show the time series.  

Greetings
Mark
by (630 points)
Hi Mark

When I try to do as you said (and as is shown in the tutorial), I get an error:

Writing file: /home/u0132269/Prog/openCARP/lore/2021-05-31_block_s1s2_bidomain_dur_5.0/ecg.pts_t
Reading file: /home/u0132269/Prog/openCARP/lore/ecg.pts
#-----------------------------------------------------------------------------------------------------------------------------------------------
-------
#                                                                 Launching Meshalyzer
#-----------------------------------------------------------------------------------------------------------------------------------------------
-------

/home/u0132269/Software/meshalyzer/meshalyzer \
  /home/u0132269/Prog/openCARP/lore/ecg.pts \
  2021-05-31_block_s1s2_bidomain_dur_5.0/phie_recovery.igb \
  /home/u0132269/Prog/openCARP/lore/2021-05-31_block_s1s2_bidomain_dur_5.0/ecg.pts_t

Error: could not open /home/u0132269/Prog/openCARP/lore/ecg.elem for reading! Reason:
No such file or directory
/home/u0132269/Software/meshalyzer/meshalyzer failed with error code -11

Also, when I try to run Meshalyzer and just click on "add aux grid" and then select 'ecg.pts_t' file, meshalyzer tries to read in 'ecg.pts_t.pts' so I get an error... When I read in my mesh and then try to add this aux grid, I get a segmentation fault and meshalyzer crashes.

Thanks in advance for your help!

Lore
by (110 points)
Hello Lore,

so I reran the tutorial using the newest version of openCARP and for me it works. My guess is that you are working on your own project in the case of this last question. Most likely your file is not formatted correctly. Have you checked that your ecg.pts_t file has all the necessary information on all points you want to observe? You can crosscheck it with the file ecg.pts_t from the tutorial 07.

Greetings
Mark
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
...