Tutorial: Manipulate bend¶
The goal of morphman-bend
, is to alter one specific bend in the
vasculature, like shown in Figure 1. This can be performed by running morphman-bend
in the terminal,
followed by the respective command line arguments. Alternatively, you can execute the Python script directly,
located in the morphman
subfolder, by typing python manipulate_bend.py
. We have also created a
demo folder where we show how to run this tutorial from a Python script, please check out the code from GitHub to
run the demos.
As shown in Figure 1, we have defined two directions to move a bend in:
\(\alpha\) and \(\beta\). The input parameters --alpha
and
--beta
control the distance to move the geometry in each direction,
respectively. For a detailed description on how we have defined of the
vectors \(\alpha\) and \(\beta\), see [1].
In this tutorial, we are using the model with ID C0005 from the Aneurisk database. For the commands below we assume that there is a folder a ./C0005/surface/model.vtp, relative to where you execute the command.
The region of interest can be set by controlling --region-of-interest
with three different options:
manual
, provide the start and end of the bend by selecting points interactivelycommandline
, provide two points on the commandline through--region-points
landmarking
, only valid for the internal carotid artery, executeautomated_landmarking.py
in misc prior to runningmanipulate_bend.py
, see Landmarking of the internal carotid artery.
Figure 2 depicts an example of modifying the input surface in the \(\alpha\) (‘vertical’) direction only.
To recreate the surfaces shown in Figure 2, run the following two commands:
morphman-bend --ifile C0005/surface/model.vtp --ofile C0005/surface/bend_vertical_plus.vtp --alpha 0.4 --region-of-interest commandline --region-points 49.8 49.7 36.6 53.1 41.8 38.3 --poly-ball-size 250 250 250
morphman-bend --ifile C0005/surface/model.vtp --ofile C0005/surface/bend_vertical_minus.vtp --alpha -0.4 --region-of-interest commandline --region-points 49.8 49.7 36.6 53.1 41.8 38.3 --poly-ball-size 250 250 250
Shown in Figure 3 is the output of changing the surface in the \(\beta\) (‘horizontal’) direction only. This can be reproduced by running the following two commands:
morphman-bend --ifile C0005/surface/model.vtp --ofile C0005/surface/bend_horizontal_plus.vtp --beta 0.4 --region-of-interest commandline --region-points 49.8 49.7 36.6 53.1 41.8 38.3 --poly-ball-size 250 250 250
morphman-bend --ifile C0005/surface/model.vtp --ofile C0005/surface/bend_horizontal_minus.vtp --beta -0.4 --region-of-interest commandline --region-points 49.8 49.7 36.6 53.1 41.8 38.3 --poly-ball-size 250 250 250
Finally, we can extend the movement to both directions by setting both \(\alpha\) and \(\beta\) as command line arguments. An example, where the bend has been moved in both directions, is illustrated in Figure 4. In order to reproduce this result, you can run the following commands:
morphman-bend --ifile C0005/surface/model.vtp --ofile C0005/surface/bend_plus.vtp --alpha 0.4 --beta 0.4 --region-of-interest commandline --region-points 49.8 49.7 36.6 53.1 41.8 38.3 --poly-ball-size 250 250 250
morphman-bend --ifile C0005/surface/model.vtp --ofile C0005/surface/bend_minus.vtp --alpha -0.4 --beta -0.4 --region-of-interest commandline --region-points 49.8 49.7 36.6 53.1 41.8 38.3 --poly-ball-size 250 250 250
As shown above, the scripts changes the bend as expected, but in general
what would be natural to control is not the distances, but rather a
morphological parameter like the maximum curvature, or the ‘angle’ between
the segments. We have therefore added an extra script estimate_alpha_and_beta.py
that can a priori find appropriate values for \(\alpha\) and \(\beta\) given a
target change in maximum curvature or angle. Please see Compute alpha and beta for more information.
For additional information, beyond this tutorial, on the script and input parameters,
please run morphman-bend -h
or confer with the manipulate_bend()
.
[1] | Kjeldsberg, Henrik Aasen. Investigating the Interaction Between Morphology of the Anterior Bend and Aneurysm Initiation. MS thesis. 2018. |