Advanced visualization using meshalyzer
Module: tutorials.visualization.meshalyzer_adv.run
Section author: Edward Vigmond <edward.vigmond@u-bordeaux.fr>
While everything is explained in the manual, no one ever wants to RTFM so a few features of meshalyzer are explained here to make life simpler.
First we need something to display. Generate the model and data with
./run.py [--np n] [--bidomain]
Use the bidomain flag if you want to look at extracellular potential data. This may take a while, especially if you have a low core count. This is a one time operation.
meshalyzer model data
key | action |
---|---|
c | Pops the control window puts it in the corner of the model window |
o | optimize colour scale |
p | select vertex |
r | reread the data. Good for monitoring long runs as they happen |
-> | advance in time one step |
<- | go back one time step |
Note
For flat surfaces, it is best to turn off lighting. Colours will be darker and more uniform.
Surface transparency is enabled by selecting the Fill colour
on the Surface
tab.
Picking an Opacity of less than one will result in transparency. This can be selected on a per surface basis.
As part of rendering transparent surfaces, elements are ordered by z, but only within each surface. Thus, if multiple surfaces are being rendered, results may not be as expected. In this case, you may try Images/Reverse draw order
to see if the rendering is improved.
Data/Cliiping
Intercept
. The up and down arrows move it 0.01 in the appropriate direction.One sometimes would like to compare two simulations, either different conditions on the same mesh or on different meshes. In such cases, it is important to have the exact same vantage, colour scale, time, etc. Synchronization is a way for passing these parameters between an arbitrary number of running meshalyzer instances. To use synchronization
Hint
you can enter all files on the command line starting with the model name. The points file basename may
have a trailing “.” so you can use tab-completion easily.
For example, if the name of the model is heart.pts, you can invoke meshalyzer heart
,
meshalyzer heart.
or meshalyzer heart.pts
.
File/Link
link selected
.
The process ID of the instance should move to the lower pane.What if the starting oreintations of the models are not the same? For example, maybe the Y and Z axes are swapped between models. To addres this situation, in each model
Image/Reset transform
Image/Sync/Reference view
Image/Sync/Set reference view
Now, manipulate a model view and sync the views. They should correspond. The key presses in the model window are helpful.
key | action |
---|---|
t | sync times |
v | sync viewport |
Sometimes we wish to display a more discrete colour scale and not a continuous range. In this case,
First we need to generate some data. Go to the basic Meshalyzer tutorial and run:
run.py --np=4 --monitor=10 --tend 150 --APD=8
Advance the time until the wavefront is part way across the slab. Save a PNG version of the image. Examine the metadata of the file with a program like identify or an Exif viewer:
identify -verbose image.png
You will see information regarding the data file used to create the image, the range of data displayed and number of colour levels, as well as the time frame.
When the simulatiobn has finished, load the activation data set meshalyzer_test/init_acts_vm_act-thresh.dat. Set the min and max colour values to 0 and 40, respectively, and choose a low number of colour levels, eg., 5.
Open the isolines widget under Data. Turn on isolines, change the start and end values and choose the number of lines to be one more than the number of colour levels. The lines and borders shoulmd match up exactly.
Output the colour bar, under Output/Colour Bar
. Look at the resulting file with the program eog for example.
Note how it has the correct number of levels. If the colours look different, it is due to lighting effects.
Going back to the isochrones, datify the isolines and save them. Change the dataset back to vm.igb.
File/Read Aux Grid
and find isoLines.pts_t. In the Aux Grid tab, datify the lines and adjust the colour scale.
The rotational angle is an example of a variable which wraps around so that for any integrer n. In this case, a branch cut is made at to restrict to the range . We cannot interpolate across the branch cut or we get nonsense, that is, if we simply average and , we get 0 instead of . Meshalyzer is branch cut aware.
Load the canine mesh with the coordinate (see Applying UVCs but take the 3rd field of dog_vtx.pts ):
meshalyzer canine dog_phi.dat
Display the zero isoline without a branch cut. Note how the line crosses the whole heart, even the region, which is spurious.
Turn on the branch cut: Data/Branch cut/[-pi,pi)
and see the proper isovalue line.
Sometimes data sets may contain spurious values, where a computation fails. An example of this is a map of activation times when propagation fails in part of the tissue. In this case, we define a dead range of data which will not be displayed.
Data/Dead range
Dead data
Apply
the changes.More details on how to use meshalyzer and its capabilities are found in the meshalyzer manual