finsberg / ldrb

A software for assigning myocardial fiber orientations based on the Laplace Dirichlet Ruled-Based algorithm

Home Page:http://finsberg.github.io/ldrb

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

A potential bug in the code

wilburmao opened this issue · comments

Hi Finsberg,

When I run the demo_lv.py code, I find that the resulting fiber orientations are not entirely expected. For example, when I use these parameters: alpha_endo_lv=60, alpha_epi_lv=-60, the fiber angle in the mid-layer should be consistent. But you can see that the fiber changes direction in the mid-layer. Only the top layer fibers in the z-direction are shown for clarity.
image
Similarly, when alpha_endo_lv=0, alpha_epi_lv=-60, the mid-layer fibers also have inconsistent angles on the right.
image
When the alpha_endo_lv=-10, alpha_epi_lv=-60, the fibers in the mid-layer seem to be correct.
image

Thanks @wilburmao. I agree that this does looks strange. How does it look if you use another function space (say, CG2 or DG1)? Does this help?

The results are about the same for different function spaces.

@wilburmao Sorry for taking so long with fixing this one. I just submitted a bug fix. Would you be able to see if this problem is fixed now?

Hi Dr. Finsberg,

I have tested the updated version of ldrb. When I run the demo_lv.py code, some results of orientation are confused me. The fibers' orientation in the middle layer are expected as 0 degree, green arrows are what I expected. Below are my results.
example1
alpha_endo_lv=60, # Fiber angle on the endocardium
alpha_epi_lv=-60, # Fiber angle on the epicardium
beta_endo_lv=0, # Sheet angle on the endocardium
beta_epi_lv=0, # Sheet angle on the epicardium

image

example2
alpha_endo_lv=90, # Fiber angle on the endocardium
alpha_epi_lv=-90, # Fiber angle on the epicardium
beta_endo_lv=0, # Sheet angle on the endocardium
beta_epi_lv=0, # Sheet angle on the epicardium

image

Thank you in advanced for your help!

Best,
Jingbin

I agree that the fiber orientations in the middle layer, or to say it more precisely, at the point where the radius is half way between ends and epi should be zero. Whether it is actually zero in the mesh you are using will depend on whether the nodes between endo and epi are located exactly half way between ends and epi.

You can try to do this on a finer mesh and see if the problem still remains.

@wilburmao @jingbinzhao415 We just fixed a bug in ldrb. Could you check if the problem is fixed now, after upgrading to the latest version

python3 -m pip install ldrb --upgrade

Hi Dr. Finsberg,

@wilburmao I have checked it and the fiber looks good now. Thank you for your help!

Great! I am closing this now then