+ All Categories
Home > Documents > Thesis Frank - Final

Thesis Frank - Final

Date post: 12-Feb-2017
Category:
Upload: frank-marsman
View: 21 times
Download: 0 times
Share this document with a friend
40
Towards Automated Vortex Detection from Four-Dimensional Phase-Contrast MRI THESIS submitted in partial fullfillment of the requirements for the degree of BACHELOR OF S CIENCE in PHYSICS Author : Frank Marsman Student ID : 1081128 Supervisor : Mohammed ElBaz 2 nd corrector : Tjerk Oosterkamp Leiden, The Netherlands, August 19, 2014
Transcript
Page 1: Thesis Frank - Final

Towards Automated VortexDetection from Four-Dimensional

Phase-Contrast MRI

THESIS

submitted in partial fullfillment of therequirements for the degree of

BACHELOR OF SCIENCEin

PHYSICS

Author : Frank MarsmanStudent ID : 1081128Supervisor : Mohammed ElBaz2nd corrector : Tjerk Oosterkamp

Leiden, The Netherlands, August 19, 2014

Page 2: Thesis Frank - Final
Page 3: Thesis Frank - Final

Towards Automated VortexDetection from Four-Dimensional

Phase-Contrast MRI

Frank Marsman

Huygens-Kamerlingh Onnes Laboratory, Leiden UniversityP.O. Box 9500, 2300 RA Leiden, The Netherlands

August 19, 2014

Abstract

This thesis discusses the vortex analysis module added to thecurrently existing LAVA-Flow visualization software. LAVA-Flow

is a visualization program that provides flow-visualizationfunctionalities to help investigating and/or studying intracardiac

blood flow. Analyzing vortex formation inside the heart is anemerging technique for evaluating cardiac function. The objectiveof this work is to allow vortex analysis as an integrated module ofLAVA-Flow. Vortex analysis was based on the Lambda2 method,

which uses 4D-Flow MRI images to identify vortex cores. Theadded vortex visualization allows for investigating vortex

formation inside the human heart.

iii

Page 4: Thesis Frank - Final

iv

Page 5: Thesis Frank - Final

Contents

1 Introduction 11.1 Motivation 21.2 Objectives 2

2 Theory 32.1 Basic heart anatomy and cardiac flow 3

2.1.1 Anatomy of the human heart 32.1.2 Cardiac flow 4

2.2 Three-directional Phase-Contrast MRI 52.2.1 Basic physics of Phase-Contrast Imaging 5

2.3 The Lambda2 Method 62.3.1 Definition of the Lambda2 method 6

2.4 DICOM orientation 72.4.1 DICOM voxel to patient coordinate system mapping 7

3 Materials and methods 11

4 Implementing the Lambda2 method in LAVA-Flow 134.1 Calling Matlab functions from the C++ based LAVA-Flow

program 134.1.1 Parameters passed to the MatLab module 134.1.2 Returned variables of the MatLab module 144.1.3 Post processing the Lambda2 data generated by the

MatLab module 154.1.4 Aligning the Lambda2 image with the velocity images 16

4.2 Vortex Analysis Module in Lava-Flow 194.2.1 Creating the Lambda2 volume 194.2.2 Visualizing a Lambda2 volume 21

Version of August 19, 2014– Created August 19, 2014 - 17:16

v

Page 6: Thesis Frank - Final

4.3 Choosing Lambda2 Iso-value 234.3.1 The value of fiso. 24

5 Discussion 275.1 Possible improvements to the program 27

5.1.1 Parallel processing 275.1.2 The MatLab module 275.1.3 Vortices as seeding regions for particle tracing 28

6 Conclusion 29

7 Acronyms and definitions 31

vi

Page 7: Thesis Frank - Final

Chapter 1Introduction

This thesis is about the vortex analysis module added to the currently ex-isting LAVA-Flow visualization software. LAVA-Flow is a visualizationprogram that provides flow-visualization functionalities such as particletracing and streamlines, in order to study/investigate intracardiac bloodflow. To LAVA-Flow a new module is added, that provides additionalfunctionalities regarding the analysis of vortex structures inside the heart.The new functionalities include both the detection as well as the visualiza-tion of these intracardiac vortices. Another important new functionality isthe ability to batch process multiple PC-MRI images, which reduces theworkload on the user.

A vortex is a region within a fluid where the flow is mostly a spinningmotion about an imaginary axis. A vortex ring is a torus shaped vortex; aregion where the fluid spins around an (imaginary) axis line that forms aclosed loop. A common example of a visible vortex ring is a smoke ring,which some smokers are able to blow from their mouth. The smoke makesthe ring visible, but does not significantly affect the flow. The same phe-nomenon occurs with any fluid, creating vortex rings which are invisiblebut otherwise entirely similar to smoke rings. This is the case in the hu-man heart. Vortex rings are created in the LV during diastole, but are not‘optically’ visible like smoke rings. The reason for this is that the vortexrings are traveling trough as well as made of blood, whereas smoke ringsare made of air containing smoke particles, and are traveling through clearair.

Version of August 19, 2014– Created August 19, 2014 - 17:16

1

Page 8: Thesis Frank - Final

1.1 Motivation

Over the last few years the topic of vortex formation has received a lot ofattention. Vortices occur in many places, including the human heart in theform of vortex rings. It turns out that these vortices play fundamental rolesin the normal physiology. The existence of natural vortices in the heartinfluence the momentum transfer in the blood flow and decrease energydissipation. For instance, left ventricle (LV) diastolic (the period duringwhich the ventricle is relaxing) vortex formation has been suggested tocontribute to efficient blood pumping in multiple ways; by minimizingthe loss of the blood’s kinetic energy, by helping in efficient mitral valve(MV) closure and also preventing blood stagnation and thrombus (bloodclot) formation [7, 9].

Furthermore, an altered vortex flow has been shown to develop in pa-tients having heart diseases such as diastolic dysfunction. Also, an alteredLV vortex flow might precede measurable functional, anatomical or mor-phological LV alternations [3–5]. This makes cardiac vortex analysis a po-tential tool for evaluating cardiac (dys)function, early indication of cardiacchamber abnormality and also a tool for assessing the value or success ofa treatment strategy (or surgery) on LV flow.

1.2 Objectives

The objective of this thesis is adding to the program LAVA-Flow the func-tionality of analyzing and visualizing vortices inside the heart. Becausevortices are regions defined in terms of fluid flow, the velocity field of avolume of fluid can be used to analyze the vortices present within thisvolume. This is the case in this thesis; velocity images obtained usingPC-MRI are used to analyze the vortices (we are interested particularly invortex rings) in the heart. Velocity images are used to determine the 3Dvelocity flow field in the heart, after which the so called Lambda2 methodis applied to obtain a ‘Lambda2’ field, which is then visualized in the formof isosurfaces in this field.

2

Page 9: Thesis Frank - Final

Chapter 2Theory

2.1 Basic heart anatomy and cardiac flow

Figure 2.1: Diagram of the human heart. Source: Wikipedia. RetrievedJuly 7, 2014, from http://en.wikipedia.org/wiki/Mitral valve.

2.1.1 Anatomy of the human heart

The human heart contains four main chambers: two upper (smaller) cham-bers called atria and two lower (bigger) chambers called ventricles. Theleft ventricle (LV) is separated from the left atrium by the mitral valve(MV). Oxygen-depleted blood is received by the right ventricle and atrium.Oxygen-rich blood is received by the left atrium and ventricle.

Version of August 19, 2014– Created August 19, 2014 - 17:16

3

Page 10: Thesis Frank - Final

2.1.2 Cardiac flow

Diastole is the period in which the heart refills with blood after systole(contraction). In this thesis, we are mainly interested in venctricular diastole;the period during which the ventricles are relaxing. During ventriculardiastole, the pressure in both ventricles drop from the peak that it reachesin systole. As soon as the pressure in the LV drops below that of the leftatrium, the MV opens, which enables blood to flow from the left atriuminto the LV. Diastole consist of early and late diastole, these are two phasesin diastole. Early diastole is a suction mechanism [11]; the LV activelydraws blood into itself. During late diastole, both atria contract, causingan increase in blood pressure in the atria which forces additional bloodinto the ventricles. This is know as atrial kick. However, 80% of the bloodflows into the ventricles during early diastole [12].

Figure 2.2: Diagrams show that spins moving along an external magneticfield gradient acquire a difference in the phase of their rotation (right),whereas non moving spins do not (left). The amount of phase differenceis proportional to the velocity of the moving spin. t = time, V = velocity, Φ= phase shift.Source: Joachim Lotz, Christian Meier, Andreas Leppert, and MichaelGalanski, Cardiovascular flow measurement with phase-contrast mrimaging: Basic facts and implementation 1, Radiographics 22 (2002), no.3, 651–671.

4

Page 11: Thesis Frank - Final

2.2 Three-directional Phase-Contrast MRI

Phase-contrast magnetic resonance imaging (PC-MRI) is a method of ob-taining quantitative information on blood flow. PC-MRI can acquire allthe three velocity components of the blood and can therefore measure thefull (3 dimensional) velocity field [8].

2.2.1 Basic physics of Phase-Contrast Imaging

In the presence of a magnetic field gradient a moving magnetic moment(hereafter referred to as spins) acquire a phase shift in comparison to sta-tionary spins (see figure 2.2). For a linear field gradient, this phase shiftφ is proportional to the velocity of this moving spin. This fact by itselfdoes not help us measure the velocity since the linear gradient also causesa position dependent phase shift in stationary spins. In PC-MRI the phaseshift of stationary tissue are compensated by applying an inverted bipolargradient (a gradient equal in magnitude, but in the opposite direction) ofequal duration after the first one.

Let us look at an example; when a linear field gradient Gx is turned on,the resulting magnetic field (ignoring the main field B0) is given by

B(x) = Gxx (2.1)

For a stationary spin, x is constant. For a spin having a constant speed v,x = x0 + vt. If we apply the gradient Gx for a time T, the phase shift ∆φ1of the moving spin is given by:

∆φ1 = γGx

∫ T

0x0 + vt dt = γGx

(x0 +

12

vT2)

, (2.2)

where γ is the gyromagnetic ratio. If we apply the second gradient −Gxdirectly after the first, the spin acquires a second phase shift ∆φ2:

∆φ2 = γGx

∫ T

0x0 + vt dt = γGx

(x0 +

12

vT2)

(2.3)

which gives the spin a netto phase shift Σφ:

Σφ = ∆φ1 + ∆φ2 = −γGxvT2. (2.4)

Important to note is that this phase difference runs from -180 to 180,which means that there is a maximum velocity that will be correctly mapped.This velocity is called venc; a spin having velocity −venc will have a phaseshift of −180 and a spin having velocity venc will have a phase shift of

5

Page 12: Thesis Frank - Final

180. If a spins has a speed of, for example, 2venc, the phase difference willbe zero. In practice Gx is chosen such that venc is expected to be larger thanthe velocity of the fastest moving spins in the image. For stationary spins∆φ1 = −∆φ2 so that Σφ = 0.

Every MR imaging data acquisition yields information about the signalmagnitude as well as the phase of each voxel. In conventional imagingsequences, only the magnitude of the voxels is used to process into ananatomic image (the magnitude image). In phase-contrast measurement, thephase information is used to calculate the velocity in a certain direction ineach voxel in order to create a velocity image. When three velocity imagesare acquired (one for each direction in space), a three dimensional velocityfield can be constructed, which contains (an approximation to) the averagespin velocity (the direction and magnitude) of each voxel.

2.3 The Lambda2 Method

The Lambda2 method can be used to detect vortex cores from a (thee di-mensional) velocity field and is currently the most accepted vortex identi-fication technique [6]. The Lambda2 method is Galilean invariant, whichmeans it produces the same results when a uniform velocity field is addedto the existing velocity field or when the field is translated.

2.3.1 Definition of the Lambda2 method

The Lambda2 method consists of several steps [2]. First we define thegradient velocity tensor J;

J ≡ ∇u =

∂xux ∂yux ∂zux∂xuy ∂yuy ∂zuy∂xuz ∂yuz ∂zuz

, (2.5)

where u is the velocity field.The gradient velocity tensor is then decomposed into its symmetric

and antisymmetric parts:

S =J + JT

2and Ω =

J− JT

2, (2.6)

where T is the transpose operation.Next the three eigenvalues of S2 + Ω2 are calculated so that for each

point in the velocity field u we have three corresponding eigenvalues; λ1,λ2 and λ3. We order the eigenvalues in such a way that λ1 ≥ λ2 ≥ λ3.

6

Page 13: Thesis Frank - Final

A point in the velocity field is part of a vortex core only if at least two ofits eigenvalues are negative i.e. if λ2 < 0. This is what gave the Lambda2method its name.

2.4 DICOM orientation

Digital Imaging and Communications in Medicine (DICOM) is a standardfor handling, storing, printing, and transmitting information in medicalimaging. The four-dimensional phase-contrast MRI images used have theDICOM format.

Figure 2.3: DICOM orientation axes.

DICOM works with a standard patient-based coordinate system whichdefines the x, y and z−axes based on the orientation of the patient [10].The x−axis is increasing to the left hand side of the patient, the y−axis isincreasing to the posterior side of the patient and the z−axis is increasingtoward the head of the patient (see figure 2.3).

2.4.1 DICOM voxel to patient coordinate system mapping

A slice of an image is stored as a single DICOM file which contains variousobjects. One of these is the pixel array, which contains the values of the

7

Page 14: Thesis Frank - Final

pixels of the slice. In pixel coordinates, (c, r) is the pixel in row r andcolumn c. A slice also contains a Pixel Spacing attribute (∆r, ∆c). ∆r is therow spacing (in mm), that is the spacing between the centers of adjacentrows, or vertical spacing. ∆c is the column spacing (in mm), that is thespacing between the centers of adjacent columns, or horizontal spacing.In order to map the voxels of a slice of an image to the DICOM patientcoordinate system (DPCS), two objects are used; the Image Orientationand Image Position. The Image Orientation defines the ‘positive row axis’which has the direction of the last pixel in the first row from the first pixelin that row and the ‘positive column axis’, which describes the directionof the columns. The Image Orientation thus defines two axes, which arestored as the direction cosines of these axes with respect to the patientcoordinate system; the row axis is stored as (Xx, Xy, Xz) and the columnaxes as (Yx, Yy, Yz). Because the Image Orientation is stored as directioncosines, Xxyz and Yxyz are the values of the cosines of the angles betweenthe three patient coordinate axes and respectively the row and columndirections. The Image Position attribute contains three values (Sx, Sy, Sz),which is the position of the origin of the slice in mm from the origin of thepatient-based coordinate system. The mapping of pixel location (c, r) tothe patient coordinate system is calculated as follows [1]

PxPyPz1

=

Xx∆c Yx∆r 0 SxXy∆c Yy∆r 0 SyXz∆c Yz∆r 0 Sz

0 0 0 1

cr01

= A

cr01

(2.7)

Equation 2.8 defines a transformation that maps the voxels in a slice fromvoxel coordinates to the DICOM patient coordinate system. A volume isa set of (many) slices, which are stored as separate DICOM files. It isassumed that the Image Orientation is the same for each slice. In voxelcoordinates, the voxels coordinates are of form (c, r, s) - the column, rowand slice indices. In order to map the voxels from a volume to the DICOMpatient coordinate system, a modified version of equation 2.8 is needed.

In order to make the mapping three dimensional, we need to add val-ues to the first three rows of the third column of the matrix in equation 2.8.In a volume containing N slices, the slices numbers range from 0 to N− 1.

8

Page 15: Thesis Frank - Final

The transformation is now given by

PxPyPz1

=

Xx∆c Yx∆r k1 SxXy∆c Yy∆r k2 SyXz∆c Yz∆r k3 Sz

0 0 0 1

crs1

= Amulti

crs1

, (2.8)

where the vector k is obtained by subtracting the Image Position vector ofslice 0 from that of slice N − 1.

9

Page 16: Thesis Frank - Final

10

Page 17: Thesis Frank - Final

Chapter 3Materials and methods

The (PC-)MRI images used are obtained using a specific 4D Flow proto-col. For each subject, a 3D magnitude scan is made (a regular MRI scan)and three velocity encoding scans, using venc = 150cms−1 in each direc-tion. All of these scans where time-resolved. The resolution of the scans is2.3× 2.3× 3.0− 4.2 mm3. The scans used echo time TE = 3.2ms and rep-etition time TR = 7.7ms, flip angle 10 In order to create a time-resolvedimage, retrospective gating was used; this means MRI acquisition was com-bined with a simultaneous electrocardiogram (ECG) recording in order toreorganize the data during image reconstruction. Each image contains 30phases that are reconstructed over a heart cycle. Acquisition was done us-ing a 3 Tesla MRI scanner (Ingenia, Philips Medical Systems), which has amaximal amplitude of 45 mT m−1 and a slew rate of 200 T m−1 s−1.

In order to speed up the acquisition, echo planar imaging with factor 5is used

The size of each image (number of voxels) differs dataset, althougheach dataset contains 30 phases. One example is the ME dataset, whichcontains images having a resolution of 256× 256× 18× 30 = 35.389.440voxels (first two dimension are in-plane, third is number of slices and lastis number of phases).

Version of August 19, 2014– Created August 19, 2014 - 17:16

11

Page 18: Thesis Frank - Final

12

Page 19: Thesis Frank - Final

Chapter 4Implementing the Lambda2method in LAVA-Flow

4.1 Calling Matlab functions from the C++ basedLAVA-Flow program

LAVA-Flow is a program written in C++, but the vortex extraction moduleis written in MatLab. This section describes how the two modules worktogether in order to create a Lambda2 image that can be used in LAVA-Flow.

4.1.1 Parameters passed to the MatLab module

In order for the MatLab module to compute a Lambda2 volume, it needsto be provided with certain information. Firstly, the module is providedthree one-dimensional velocity images, which it uses to calculate a threedimensional velocity field. Instead of sending the velocity data directly,only the locations of the velocity images are sent to reduce both memoryusage and time.

In medical imaging, a patient is subject to an imaging study, which maycontain multiple series of images. Each series can have multiple relatedimages. In practice a single study is stored as a folder containing manyDICOM files (which represent slices). In LAVA-Flow the user can opensuch a folder, after which the program loops trough the files in order togroup them in individual series which are listed and shown. The MatLabmodule contains a similar function to extract and list the series in a study.One way of passing the address of a velocity image from LAVA-Flow to

Version of August 19, 2014– Created August 19, 2014 - 17:16

13

Page 20: Thesis Frank - Final

MatLab could therefore be done by passing the position of this image inthe list. The series in a study are unfortunately not always listed in thesame order by both modules. It can therefore happen that the n-th serieslisted in LAVA-Flow is not the same series as the n-th series listed by theMatLab module. A series can however be uniquely identified by lookingat the SeriesUID field contained in its meta-data, which is a string of char-acters unique to each series. The MatLab module is able to loop throughall series in a study in order to find the series having a certain SeriesUIDvalue. This process is however significantly more time consuming thatjust listing the series in a study.

In order to reduce time consumption, both the positions in the list, aswell as the SeriesUID values of the velocity images are provided to theMatLab module. The MatLab module will then first get only the SeriesUIDvalues of the series at the specified positions in the MatLab generated list.If these values correspond to the SeriesUID values it received from LAVA-Flow, it has found the images and can proceed. If they do not correspond,the list generated by MatLab is different from the one generated in LAVA-Flow. In this case the MatLab module uses on the more time consumingmethod of looping through all series and comparing their SeriesUID’s tothe ones received from LAVA-Flow.

Other parameters that are passed to the MatLab module are the socalled start and end phase numbers pstart and pend, which define the rangeof frames for which the Lambda2 image is computed. These are manuallypicked by the user. Also two manually chosen file paths are provided tothe MatLab module. The first file path refers to the contour file, whichdefines a region RL within the velocity images that needs to be analyzed.RL can be viewed as a set of voxels, or 3-tuples of integers (that specify thevoxel positions). The MatLab program will only compute the Lambda2values of the voxel within this regions. The second file path is optional. Ifit is passed, the MatLab program will also export the Lambda2 volume inMatLab format (.mat) at the given location.

4.1.2 Returned variables of the MatLab module

The MatLab module returns multiple objects to LAVA-Flow. First of all, itreturns the Lambda2 volume Ld, in the form of a four dimensional arrayof doubles (a 64 bit type of variable); Ld(x, y, z, p) refers to voxel (x, y, z)at phase p. The value of Ld(x, y, z, p) is equal to the Lambda2 value of thegiven voxel if it lies within the contour region; if (x, y, z) ∈ RL. Otherwisethe value is zero.

14

Page 21: Thesis Frank - Final

The MatLab module also returns three integers ∆x, ∆y and ∆z repre-senting the offset of the Lambda2 volume relative to the velocity volumesit is based on. The top left corner of the Lambda2 volume will in generalnot align with that of the velocity image, because the Lambda2 volumeis calculated for a certain region (RL) of the velocity volume. The offsetvalues are given in voxels of the velocity image. We thus need to knowthe dimension of the voxels of the velocity images in order to align theproduced Lambda2 volume correctly.

4.1.3 Post processing the Lambda2 data generated by theMatLab module

Scaling the Lambda2 values

The MatLab module returns the values of the voxels in the form of a four-dimensional array Ld of type double. Ld(i, j, k, p) refers to the value of avoxel in phase p, at position (i, j, k); this element is said to have (or isin) phase p. µd(p) is defined as the average value of all positive elementshaving phase p. L∗d is defined by:

L∗d(i, j, k, p) ≡ Ld(i, j, k, p)÷ µd(p). (4.1)

It follows that if L∗d(i, j, k, p) = x, then Ld(i, j, k, p) equals x times theaverage positive value µd(p) of the corresponding phase p. We definemax L∗d(p) as the largest value in L∗d in phase p. Next, parameter M isdefined by

M ≡ minp∈[pstart,pend]

(max L∗d(p)

). (4.2)

It follows that in every phase p there exists at least one element having avalue of at least M times the average positive value µd(p) for that phase.

The array (of type double) generated by the MatLab module need tobe converted to an array Ls of type short (a 16 bit type of variable), whichis the type LAVA-Flow uses for its images. A short variable can containonly integer values in the range ±32767, or ±SMAX. When convertingL∗d to Ls, elements having value M in L∗d get the value SMAX in Ls andvalues having value 0 in L∗d remain zero in Ls. Elements in L∗d that have avalue larger than M are treated as if they have value M and are thus alsomapped to SMAX. This mapping is used for reasons concerning resolutionand the drawing of isosurfaces. Isosurfaces of the Lambda2 volume havean iso value that is expressed in terms of the average positive value of each

15

Page 22: Thesis Frank - Final

phase (this will be covered in section 4.3). It is now possible to define Lsin terms of Ld:

Ls(i, j, k, p) =

SMAX

M · L∗d(i, j, k, p) if L∗d(i, j, k, p) ≤ MSMAX if L∗d(i, j, k, p) > M

. (4.3)

With this definition, an element of Ls having a value of x · SMAXM will (in

Ld) always have a value of x times the average positive value of the corre-sponding phase.

4.1.4 Aligning the Lambda2 image with the velocity im-ages

Symbols used in this section:

• xL, yL, zL are the vectors the Image Orientation of the Lambda2 vol-ume is composed of.

• rL is the Image Postion of the Lambda2 volume.

• xv, yv, zv are the vectors the Image Orientation of the velocity imageis composed of.

• rv is the Image Postion of the velcoity image.

• lv,x, lv,y and lv,z are the dimensions of the voxels of the velocity imagein respectively the x-, y- and z-direction.

After the Lambda2 volume is created and converted into a short array, itis aligned with the velocity images. At this point in the work flow, theLambda2 volume is still represented as a four dimensional array (of typeshort). In order to use the image in LAVA-Flow, it needs to be convertedinto an image object. This is an object that stores many properties otherthat just the voxel values. It also contains information about the size ofthe voxels, and the orientation of the object in general. First, the voxel di-mensions are set; these are 1 by 1 by 1 mm, regardless of the dimensionsof the voxels of the velocity image. The reason for this is that the MatLabmodule interpolates the velocity images in order to obtain a higher resolu-tion velocity field. Since time is also represented as a dimension, the timeresolution is simply another dimension of a voxel. The time resolution isnot interpolated, but is equal to the time resolution of the velocity images.This extra information can thus be obtained from the velocity image metadata.

16

Page 23: Thesis Frank - Final

Transforming and rotating the Lambda2 volume

y

x

Figure 4.1: Lambda2 image without applying any transform.

After the spacing (dimensions) of the Lambda2 volume is set, the im-ages do not align correctly yet. If the two images are rendered at thispoint (Lambda2 and the velocity image), the result would look like fig-ure 4.1. The orientation vector (called Image Orientation) xL, yL and zL ofthe Lambda2 volume is different from the orientation of the patient (Im-ageOrientationPatient) and the position rL of the Lambda2 volume is theorigin of the coordinate system of LAVA-Flow. The first step is to give theLambda2 image the same position as that of the velocity image (ImagePo-sitionPatient), rv.

y

x

Figure 4.2: Lambda2 image after applying initial transform. The positionsof the velocity and Lambda2 images are now identical (rL = rv), but theyhave different axes.

The corners of the images now align, but the orientation and offset arestill incorrect (as seen in figure 4.2). The next step is to give the Lambda2image the same ImageOrientation (described in section 2.4) as the velocity

17

Page 24: Thesis Frank - Final

image, which has axes xv, yv and zv. In LAVA-Flow, a volume has a setof three axes, that define in what orientation it is rendered. It is importantto note that volumes as a whole are not rotated around a certain axes. Avolume is in essence a single point in space. The coordinates of this objectare in world coordinates and have nothing to do with the axes of the object.This point is used as a starting point to render the whole volume. Thepoint is just the corner of the first slice of the volume. This slice is renderedwith the orientation of the axes (ImageOrientation) of the volume. Theother slices are rendered in a similar way, but translated with respect tothe first slice. The direction of the translation is in the z-axis of the volume.The magnitude of the translation is equal to the length of a voxel in the z-direction.

y

x

Figure 4.3: Lambda2 image after applying initial transform and after set-ting the correct axes; rL = rv and (xL, yL, zL) = (xv, yv, zv).

After the Lambda2 image is given the same ImageOrientation as thevelocity image, the situation looks like that in figure 4.3. If the Lambda2image had the same size as the velocity image, it would now align cor-rectly. However the Lambda2 image represents only a certain region ofthe velocity image. Therefore there is a certain offset between the Image-Position’s of the Lambda2 and the velocity image. The values of the offsetare returned by the MatLab program (see section 4.1.2). For instance, theoffset ∆x means that the Lambda2 image is shifted ∆x voxels in the x-direction (xv) of the velocity image. An offset ∆rL has to be added to theposition rL of the Lambda2 image:

∆rL = xv · lv,x · ∆x + yv · lv,y · ∆y + zv · lv,z · ∆z, (4.4)

where lv,x, lv,y and lv,z are the dimensions of the voxels of the velocityimage in respectively the x-, y- and z-direction. After this, the images aligncorrectly, as seen in figure 4.4.

18

Page 25: Thesis Frank - Final

y

x

Figure 4.4: Lambda2 image after applying initial transform plus the off-set transform, using the correct axes. rL = rv + ∆rL and (xL, yL, zL) =(xv, yv, zv).

4.2 Vortex Analysis Module in Lava-Flow

This section describes the way (the added functionality of) LAVA-Flow isused. The added functionality can be divided in two main parts; creatingthe Lambda2 image and visualizing it.

4.2.1 Creating the Lambda2 volume

Computing the Lambda2 volume is a relatively time consuming process.It takes roughly 30-60 seconds per frame (depending on the size of theROI) which results in a total time of 15-30 minutes for a typical image of30 frames. For this reason, creating Lambda2 volumes is done via batchprocessing, which enables the user to create a list of so-called jobs to beexecuted. Using batch processing, many Lambda2 images can be calcu-lated without any user interaction, which makes it possible, for instance,to calculate a list of images over night. A single job represents the compu-tation of one Lambda2 volume. It contains all the information necessaryto describe the computation, such as the velocity images to be used, whichframes to process, and what contour file to use. Also it contains informa-tion about where to save the resulting Lambda2 volume and what formatto save it in.

The batch processing dialog can be seen in figure 4.5. The dialog has sixbuttons. The buttons “Import batch...” and “Save current batch...” enablethe user to import and export the list of jobs. The “Add job...” buttonopens the job selection dialog (see figure 4.6), which is used to create a joband add it to the list. The jobs can be edited and deleted using the “Edit

19

Page 26: Thesis Frank - Final

Figure 4.5: The batch processing dialog.

job...” and “Delete job” buttons. When the user clicks the “Run” button,all jobs in the list are executed one by one.

20

Page 27: Thesis Frank - Final

Figure 4.6: The job selection dialog.

4.2.2 Visualizing a Lambda2 volume

The Lambda2 volume can be visualized by opening the visualization win-dow after loading the volume into LAVA-Flow. The visualization windowcontains a “Vortex ISO Surface Analysis” tab. In this tab, the Lambda2volume can be visualized by computing and displaying its isosurface. Theisosurface is computing when the user clicks the “Compute ISO Surface”

21

Page 28: Thesis Frank - Final

Figure 4.7: The Vortex ISO Surface Analysis tab.

button. The ISO factor can be chosen using a slider. After the isosurfaceis computed, the drop-down box right to the text “Select vortex:” is filledwith a list of regions. The volume of the selected region is shown belowthis box, as seen in figure 4.7. When the “Show n largest vortices.” check-box is checked, only the n largest regions are visible (n is chosen by theuser).

Furthermore, it is possible to export the generated isosurface(s). But-ton “Export current frame” exports the isosurface of the current frame andthe “Export all frames” exports all isosurfaces. It is possible to export theisosurface either as one Zip file or as a series of Vtk files (one file for eachframe). Besides exporting, the user can also import isosurfaces. Again im-porting is supported for both Vtk and Zip files. These import and exportfunctions make it possible for the user to (for example) first generate andexport an isosurface, modify (post-process) it using a different programand then import it again.

A Lambda2 volume can be visualized on its own, or together withother images. The latter is often useful to get information about the lo-cation of the vortex rings within the heart. An example of this can be seenin figure 4.8.

22

Page 29: Thesis Frank - Final

Figure 4.8: A Lambda2 isosurface visualized together with a slice of animage of the heart. Only a part of the vortex ring is visible as the bottomof it lies beneath the plane. The images are part of the ME dataset andfiso = 3.50. Only the largest region is shown.

4.3 Choosing Lambda2 Iso-value

In LAVA-Flow, a Lambda2 volume is visualized using isosurfaces. Theisosurfaces are computed using one parameter called the ISO factor fiso.All points on the isosurface have a value equal to fiso times the averagepositive value µ(p) of the corresponding phase. In practice, these pointsform many volume-enclosing surfaces, which we call regions (see figure4.9). During the process of computing these isosurfaces, the volumes ofeach region is calculated. The program uses two different techniques tocalculate the volume of a region. The first technique is based on countingthe number of voxels that lie within each region. The second techniqueis more accurate, but at the cost of being much more time expensive (inthe order of hundreds of times slower). In order to speed the isosurfacecomputation up, while keeping accurate volume information, the programuses both techniques.

During the calculation of the isosurfaces, the volume of each regionis calculated using the fast (less accurate) technique. This information isused to sort the regions based on their volume, which enables us to list the

23

Page 30: Thesis Frank - Final

Figure 4.9: Iso surface of Lambda2 volume with each region having a dif-ferent color.

regions from largest to smallest. This is justified for the largest regions;even though the calculated volumes are not accurate, the largest regionsare still correctly distinguished from the smaller ones. This means the nlargest regions in the list computed using the fast technique will containthe same regions that would be found using the slower technique, as longas n is small. Since the user is generally only interested in the few largestregions (which represent the vortex rings), this approach does not com-promise our goals.

Since the user can still be interested in the actual volume of a region,the program also uses the slow and accurate technique. However it onlycomputes the accurate volume of the (single) selected region, which takesonly a fraction of a second to compute.

4.3.1 The value of fiso.

The value of fiso is chosen by the user. It can take on any value in therange [0, M] (see the definition of M in equation 4.2). The reason that M ischosen as the maximum value of fiso is that for ISO factors up to M, eachframe (phase) of the Lambda2 volume contains at least one voxel havinga higher or equal value. This means that when fiso > M, there is at least

24

Page 31: Thesis Frank - Final

10

100

1 2 3 4 5 6

Ave

rage

num

ber

ofre

gion

spe

rfr

ame

ISO factor fiso

MEv08p11

Figure 4.10: Correlation between the average number of regions in eachframe and the ISO factor fiso for three different datasets.

one frame having no voxels with this value, which results in its isosurfacebeing empty. In practice this situation will of course occur also when fisostarts to approach M, but this is still far from the usual values used for fiso,which is 2-5 [2]. For instance, for the p11 and ME dataset M = 26 and forv8 M = 22.

The ISO factor affects the geometry of the generated isosurfaces. For in-stance, the number of regions of the isosurface decreases as fiso increases;this can be seen in figure 4.10. The initial average number of regions aredifferent per dataset because each dataset has a different ROI with a dif-ferent volume.

25

Page 32: Thesis Frank - Final

26

Page 33: Thesis Frank - Final

Chapter 5Discussion

5.1 Possible improvements to the program

5.1.1 Parallel processing

The modules added to LAVA-Flow do not make use of parallel process-ing. Many modules could however benefit from using parallel processing.Especially the modules that perform the most time consuming parts. Forinstance computing the isosurfaces takes a couple of seconds (dependingon fiso). This is already a big improvement compared to the initial attempt(which does not use the combination of the fast and slow algorithm, seesection 4.3), but could be made faster using parallel processing. Imple-menting parallel processing here is not trivial, since the Vtk library that isused for computing isosurfaces is not thread safe.

Post processing the Lambda2 volume can also benefit from parallelprocessing. Parts of the computations done during post processing is de-termining the average positive Lambda2 values in all frames, which is aprocess of adding numbers, which can be done in parallel.

5.1.2 The MatLab module

The added LAVA-Flow modules are designed in such a way that LAVA-Flow is in a sense ‘independent’ of the MatLab module. If changes aremade to the MatLab module, LAVA-Flow can still be run without recom-piling it; the MatLab module is recompiled independently from LAVA-Flow. The compilation of the MatLab module produces a .dll (DynamicLink Library) file, which needs to be placed in the folder where the ex-ecutable of LAVA-Flow is located. Only when the number (and type) of

Version of August 19, 2014– Created August 19, 2014 - 17:16

27

Page 34: Thesis Frank - Final

input and output variables of the MatLab module changes, LAVA-Flowneeds to be recompiled.

One improvement to the MatLab module is already being worked on atthe moment this thesis is written. It is about the interpolation method themodule uses to increase the resolution of the velocity images (described insection 4.1.4). Currently this is done linearly (CHECK!). However, sinceblood can be treated as an incompressible flow[6], the divergence of thevelocity field of this flow should be zero everywhere. This is a bound-ary condition that can be used to define more accurate interpolation tech-niques in order to obtain higher resolutions. Another improvement to theMatLab module can again be the implementation of parallel processing.

5.1.3 Vortices as seeding regions for particle tracing

LAVA-Flow supports particle tracing functionality. Particle tracing is basedon the velocity field (just as the Lambda2 method). It starts with placing(seeding) a large number of massless particles in some region of the veloc-ity field. The path each particles will travel is then calculated based on thevelocity of the blood flow at the position of the particle. The new LAVA-Flow functionality opens up new possibilities for particle tracing. Sincethe vortex cores represent regions where the particles are mostly spinningabout an imaginary axes, these regions are an interesting to use as regionsto seed the particles.

28

Page 35: Thesis Frank - Final

Chapter 6Conclusion

The main goal of adding the new modules to LAVA-Flow was to integratedifferent parts of research being done at LKEB into one program and tomake vortex analysis more user friendly. The latter can be considered tobe at least partly achieved; at the moment of writing the thesis, the newfunctions added to LAVA-Flow are being used at the pediatric cardiologydepartment as part of the procedure of analyzing cardiac vortices of pa-tients with Atrioventricula Septal Defects (ASVD).

The goal of integrating different techniques of analyzing cardiac floodflow can also be considered achieved, at least in principle. For instance, thecombination of visualizing the Lambda2 data in combination with particletracing gives promising results (see figure 6.1).

Version of August 19, 2014– Created August 19, 2014 - 17:16

29

Page 36: Thesis Frank - Final

Figure 6.1: Combined visualization of vortex isosurfaces and particle trac-ing. It is clearly visible that the particles are, as expected, spinning aboutthe vortex ring’s axes.

30

Page 37: Thesis Frank - Final

Chapter 7Acronyms and definitions

ROI Region of interest, defines the region of a velocity file for which tocompute the Lambda2 values.LV Left ventricle.MV Mitral valve.PC-MRI (Four-Dimensional) Phase-Contract MRI.Lambda2 method A method for computing a Lambda2 field from a veloc-ity field. The positive values in the Lambda2 volume correspond to pointsin the velocity field that are part of a vortex core.

Version of August 19, 2014– Created August 19, 2014 - 17:16

31

Page 38: Thesis Frank - Final

Acknowledgements

I would like to express my greatest gratitude to my research project su-pervisor Mohammed ElBaz for all his time and patience. He has givenme a lot of feedback during my time at LKEB and taught me a lot aboutprogramming, debugging, and working in a team in general. I would liketo offer my thanks to Patrick de Koning for helping me out many timeswith programming problems, and for helping me plan how to implementsome functionalities. Occasional advice on my research by Tjerk Oost-erkamp was also very helpful. I would like to thank Boudewijn Lelieveldtfor giving me the opportunity to work at LKEB in the first place. I wouldalso like to thank Emmeline Calkoen, for being the first external user ofthe new version of LAVA-Flow and providing me with useful feedback. Iwould also like to thank Jos Westenberg for helping me writing the sectionabout PC-MRI. Finally I would like to thank the rest of the group for theirsupport and the good times.

32

Page 39: Thesis Frank - Final

References

[1] Defining the dicom orientation, nipy.org/nibabel/dicom/dicom orientation.html,July 2014.

[2] Mohammed SM ElBaz, Boudewijn PF Lelieveldt, Jos JM Westenberg,and Rob J van der Geest, Automatic extraction of the 3d left ventriculardiastolic transmitral vortex ring from 3d whole-heart phase contrast mriusing laplace-beltrami signatures, Statistical Atlases and ComputationalModels of the Heart. Imaging and Modelling Challenges, Springer,2014, pp. 204–211.

[3] Erina Ghosh, Leonid Shmuylovich, and Sandor J Kovacs, Vortex for-mation time-to-left ventricular early rapid filling relation: model-based pre-diction with echocardiographic validation, Journal of Applied Physiology109 (2010), no. 6, 1812–1819.

[4] Geu-Ru Hong, Gianni Pedrizzetti, Giovanni Tonti, Peng Li, Zhao Wei,Jin Kyung Kim, Abinav Baweja, Shizhen Liu, Namsik Chung, HeleneHoule, et al., Characterization and quantification of vortex flow in the hu-man left ventricle by contrast echocardiography using vector particle imagevelocimetry, JACC: Cardiovascular Imaging 1 (2008), no. 6, 705–717.

[5] Panupong Jiamsripong, Anna M Calleja, Mohsen S Alharthi, MateDzsinich, Eileen M McMahon, Jeffrey J Heys, Michele Milano,Partho P Sengupta, Bijoy K Khandheria, and Marek Belohlavek, Im-pact of acute moderate elevation in left ventricular afterload on diastolictransmitral flow efficiency: analysis by vortex formation time, Journal ofthe American Society of Echocardiography 22 (2009), no. 4, 427–431.

[6] Arash Kheradvar and Gianni Pedrizzetti, Vortex formation in the car-diovascular system, Springer, 2012.

Version of August 19, 2014– Created August 19, 2014 - 17:16

33

Page 40: Thesis Frank - Final

[7] Philip J Kilner, Guang-Zhong Yang, A John Wilkes, Raad H Mohi-addin, David N Firmin, and Magdi H Yacoub, Asymmetric redirectionof flow through the heart, Nature 404 (2000), no. 6779, 759–761.

[8] Joachim Lotz, Christian Meier, Andreas Leppert, and Michael Galan-ski, Cardiovascular flow measurement with phase-contrast mr imaging: Ba-sic facts and implementation 1, Radiographics 22 (2002), no. 3, 651–671.

[9] Gianni Pedrizzetti and Federico Domenichini, Nature optimizes theswirling flow in the human left ventricle, Physical review letters 95(2005), no. 10, 108101.

[10] Oleg S Pianykh, Digital imaging and communications in medicine (di-com), Springer, 2012.

[11] HN Sabbah and PD Stein, Pressure-diameter relations during early di-astole in dogs. incompatibility with the concept of passive left ventricularfilling., Circulation research 48 (1981), no. 3, 357–365.

[12] Gareth Williams, Advanced biology for you, Nelson Thornes, 2000.

34


Recommended