1 Introduction

Since the first report by Lauterbur (1973), magnetic resonance imaging is increasingly being used to visualize fluid dynamical processes (Crooks and Singer 1983; Bryant et al. 1984; Hammer et al. 1990; Elkins and Alley 2007). Its noninvasive nature makes MRI ideal for the purpose, and the methodology is increasingly being used to verify computational fluid dynamics codes, especially for complex flows (Botnar et al. 2000; Glor et al. 2002; Zhao et al. 2003; Ooij et al. 2012). Conversely, computational tools can help to understand and plan complex MRI processes, by capturing the essential dynamical processes of both flow and MRI within a single framework. Thus, the development of MRI is being accelerated through support from MRI simulation.

Some of the examples where MRI simulation is playing a significant role are: as an educational tool in medicine and radiology (Torheim et al. 1994; Rundle et al. 1990); for a blood flow pattern assessments in various vascular geometries (Canstein et al. 2008; Boussel et al. 2009; Papathanasopoulou et al. 2003); in the design and optimization of MR sequences (Brenner et al. 1997; Stöcker et al. 2010); in the investigation of the effect of in-plane flow and diffusion on MRI (Marshall 1999; Jochimsen et al. 2006; Azhar et al. 2016); in the study and diagnosis of a broad range of cardiovascular flow related diseases (Giddens et al. 1993; Steinman 2004; Boussel et al. 2009).

MRI simulation methods can be roughly separated into two categories. The first category deals with the numerical analysis of the flow dynamics through different geometries by means of computational fluid dynamics (CFD). CFD is well capable of estimating flow fields for arbitrarily complex vessel geometries. It is extensively used to predict flow patterns in a number of vascular forms, including the thoracic aorta (Canstein et al. 2008), the intracranial aneurysms (Boussel et al. 2009), and the carotid bifurcation (Milner et al. 1998; Thomas et al. 2003; Long et al. 2000). CFD is established as a strong research tool in the field of MRI. The accuracy of a flow field estimation through CFD depends on the assumptions in the selected model. This sometimes suffers from partial volume effects and limited resolution (Harloff et al. 2010). Although different CFD models include thermal fluctuations, so far the method has only been used to predict convection along the velocity direction in MRI. In many situations, a simple continuum description based on the Navier–Stokes equation is not sufficient, since details at the molecular level, including thermal fluctuations, play a central role in the MRI process.

The second category deals with investigation of the causes of artifacts, enhancement of images, and the study of MRI sequences through MRI simulators. These simulators are developed using three different approaches. The first approach uses proton density maps to synthesize new images for different pulse sequences (Riederer et al. 1984; Ortendahl et al. 1984; Bobman et al. 1985). This method does not simulate a complete MRI process, nor is it able to simulate artifacts and flow dynamics. The second approach is a k-space formalism (Ljunggren 1983; Twieg 1983; King and Moran 1984). Here, the Fourier transform of a user-defined object is computed first, then the data are multiplied on a point-by-point basis, with the k-space trajectories obtained using a pulse sequence. The motion propagates through several sampling periods. MR tagging is also successfully implemented with this approach (Crum et al. 1997, 1998). Although an efficient computational technique for a single excitation, but it fails at the choice of MRI sequences and parameters. Different parameters must be treated separately, which make it difficult to apply to, for example, different tissue characteristics. The most realistic approach is based on an isochromat summation method (Bittoun and Taquin 1982; Summers et al. 1986; Petersson et al. 1985). Here the ‘object’ is a two- or three-dimensional array of spin elements with different MRI parameters attached to it, such as spin density and relaxation times. The evolution of spins or magnetizations in time is calculated by solving the Bloch equations (Bloch 1946). This method is close to reality as it can simulate most of the phenomena encountered during MR imaging, but so far few attempts have been made to include explicit fluid models that can capture diffusion effects on images. Jochimsen et al. (2006) modeled the effect of self-diffusion by continuous damping of the magnetization at each iteration of the solution of the Bloch equations with diffusion terms by Torrey (1956). The computational complexity of isochromat method is twofold: the number of time step increases with the square of the image size and with the number of spin elements, making it difficult to use for velocity imaging. Ian Marshall (1999, 2010) used the isochromat method at first for in-plane flow and subsequently for fluid flow in carotid bifurcation geometries. In both cases, the flow was modeled using CFD to obtain positions and velocities of the particles. These positions and velocities were then fed into a simulator for post processing.

An alternative way of solving the Navier–Stokes equations and its generalization could be particle-based schemes where flow is simulated at mesoscopic levels. Smoothed particle hydrodynamics (SPH) (Gingold and Monaghan 1977; Lucy 1977; Monaghan 2005) performs discretization of the Navier–Stokes equation based on the interpolation on particles, but only multi-particle collision dynamics (MPCD) (Malevanets and Kapral 1999, 2000) and dissipative particle dynamics (DPD) (Hoogerbrugge and Koelman 1992; Español and Warren 1995; Groot and Warren 1997) allow a direct simulation of diffusive hydrodynamics with explicit representation of thermal fluctuations. These methods have already been successfully applied to a number of NMR flow problems (Cenova et al. 2011; Soares et al. 2013; Yazdani and Karniadakis 2016; Tosenberger et al. 2011).

The purpose of this article is to introduce an efficient and more realistic imaging simulation tool, which not only retains the essence of real experiments, but also provides rich information for future design of new MRI experiments at little extra computational expense. This is achieved by coupling MRI with DPD at the mesoscopic level. A spin echo single-sided bipolar gradient (SE-SBP) pulse sequence is successfully applied and studied for different flow velocities and geometries.

2 Methods

To achieve an efficient simulation of flow-MRI, we integrate dissipative particle dynamics into the isochromat summation method. The result: a versatile simulator shown schematically in Fig. 1, which is capable of simulating different pulse sequences, flow dynamics and different geometries with obstacles.

Fig. 1
figure 1

Schematic representation of the image construction process using the coupling of MRI and DPD. (a) A control volume showing a DPD liquid that produces hydrodynamic behavior through pair interaction forces \(\varvec{F}_{ij}\); (b) application of a spin echo sequence on the particles manipulating their magnetic vector \(\varvec{M}\); (c) storage of the MRI signals in \(\varvec{k}\)-space; (d) 2D Fourier transform to form the images from \(\varvec{k}\)-space

2.1 The isochromat summation method

In an isochromat summation or time-domain method, spin dynamics is fully monitored throughout the image formation process using Bloch’s equations (Bloch 1946), where the time evolution of the spin magnetization vector \(\varvec{M}=(M_{x},M_{y},M_{z})^{T}\) is given as

$$\begin{aligned} \frac{{\text {d}}\varvec{M}}{{\text {d}}t}=\gamma (\varvec{M} \times \varvec{B}) - \begin{pmatrix} M_{x}/T_{2} \\ M_{y}/T_{2} \\ (M_{z}-M_{0})/T_{1} \end{pmatrix}, \end{aligned}$$
(1)

where \(M_{0}\) is the net equilibrium polarization, \((T_{1},T_{2})\) are the spin–lattice relaxation and spin–spin relaxation constants, respectively, and \(\gamma\) is the gyromagnetic ratio of the sample fluid. The total magnetic field \(\varvec{B}\) of a sample fluid under the influence of a gradient and RF pulse in an arbitrary direction will be

$$\begin{aligned} \varvec{B}(\varvec{r,t}) = B_{0}\varvec{z} + \Delta B(\varvec{r})\varvec{z} + (\varvec{G}(t).\varvec{r}) \varvec{z} + \varvec{B_{1}}(t). \end{aligned}$$
(2)

where \(B_{0}\) is a static magnetic field, \(\Delta B(\varvec{r})\) is the local magnetic field inhomogeneity, \(\varvec{G}(t)\) is the applied field gradient, and \(\varvec{B_{1}}(t)\) is the radio frequency (RF) pulse at a spatial coordinate \(\varvec{r}\). The MRI simulator kernel is based on the discrete time solution of the Bloch equations where the magnetization vector coupled with the particle is iteratively computed by means of rotation matrices and exponential scaling. There are four main events occurring on the magnetization vector namely, the RF pulse, the application of a gradient and the precession of a spin with relaxation. The effect of all these events on the magnetization vector can be summed up with the following equation:

$$\begin{aligned} \varvec{M}(\varvec{r},t+\Delta t) = R(\theta _{\omega })R(\theta _{G})R_{\text { relax}}R_{RF}\varvec{M}(\varvec{r},t), \end{aligned}$$
(3)

where \(R(\theta )\) is a rotation matrix for precession of the spins in a chosen axis. Choosing the z-axis and the angle \(\theta\) it will be

$$\begin{aligned} R(\theta ) = \begin{pmatrix} \cos \theta &{} \sin \theta &{} 0\\ -\sin \theta &{} \cos \theta &{} 0\\ 0 &{} 0 &{} 1 \end{pmatrix}, \end{aligned}$$
(4)

where \(\theta _{\omega }\) is associated with the field inhomogeneities by

$$\begin{aligned} \theta _{\omega } = \gamma \Delta B(\varvec{r}) \Delta t. \end{aligned}$$
(5)

and \(\theta _{G}\) is linked to the applied gradient rotation depending upon the strength and duration of the gradient

$$\begin{aligned} \theta _{G} = \gamma \varvec{r} \int _{t}^{t+\Delta t} \varvec{G}(\tau ) {\text {d}}\tau . \end{aligned}$$
(6)

\(R_{\text { relax}}\) in Eq. (3) describes the relaxation effects given by the following matrix:

$$\begin{aligned} R_{\text{ relax}} = \begin{pmatrix} {\text {e}}^{-\Delta t / T_{2}(\varvec{r})} &{} 0 &{} 0\\ 0 &{} {\text {e}}^{-\Delta t / T_{2}(\varvec{r})} &{} 0\\ 0 &{} 0 &{} 1-{\text {e}}^{-\Delta t / T_{1}(\varvec{r})} \end{pmatrix}. \end{aligned}$$
(7)

\(R_{RF}\) represents the discrete ‘delta’ pulses for \(90^\circ\) and \(180^\circ\) flip. These pulses are applied on single component of magnetization on resonance during which the gradient pulses are switched off. The MR signal is acquired by two orthogonally placed coils, i.e., xy plane. It is a one-dimensional discrete complex signal, which is used to fill the single line of a \(\varvec{k}\)-space volume at a given excitation. The one point S(t) of the MR signal is obtained by summation of local magnetization over the entire fluid sample. The real and imaginary parts of the complex signal are given as

$$\begin{aligned} S(t) = \sum _{\varvec{r}} \varvec{M}(\varvec{r},t)\varvec{x} + j\sum _{\varvec{r}} \varvec{M}(\varvec{r},t)\varvec{y}. \end{aligned}$$
(8)

The next point of MR signal is obtained after the evolution of the magnetization according to the Eq. (3) with a time step \(\Delta t\). The Fourier transform is used to construct an image from the \(\varvec{k}\)-space data.

2.2 SE-SBP sequence

There are a number of MR sequences that show sensitivity to flow in non-contrast magnetic resonance angiography, but they also lead to artifacts in many applications. The flow-compensated gradient-echo sequence in the time of flight method is optimized to favor the vascular signal over that of the surrounding tissue, but it is not suitable for a slow flow due to signal loss. A pulsed field gradient spin echo sequence can be used to image slow flow and diffusion (Stejskal and Tanner 1965; Scheenen et al. 2001) where unipolar diffusion gradients induce signal attenuation and diffusivity in each voxel, which can be estimated by

$$\begin{aligned} S(b) = S(0) {\text {e}}^{-bD}\,;\, b=\gamma ^{2}G^{2}\delta ^{2}\left[ \Delta - \frac{\delta }{3}\right] , \end{aligned}$$
(9)

where S(b) is the observed signal, S(0) is the signal in the absence of diffusion, and D is the apparent diffusion coefficient. G is the magnitude of gradient pulse with duration \(\delta\) and diffusion time \(\Delta\).

Phase-contrast sequence is more resourceful; it cannot only be used to image vessels but can also be used to quantify the blood flow and obtain diffusion-weighted images (Freidlin et al. 2012). As the local magnetization is a vector quantity, it gains phase when subjected to flow under gradients. There are three contributions to the phase of MR signal according to Eq. (2). The first phase contribution is due to static field \(B_{0}\), which is zero in a rotating frame; the second phase contribution is due to field inhomogeneities \(\Delta B_{0}\); and the third contribution is due to the applied magnetic gradient in the direction of motion, which gives rise to time-dependent and spatially varying phase. In the imaging signal, static spins and moving spins give rise to time-dependent and spatially varying phase. So the total phase gain in a rotating frame at echo time \(t_{\text{ echo}}\) is

$$\begin{aligned} \Phi (\varvec{r},t) = \Phi _{0} + \gamma \varvec{r}\int _{0}^{t_{\text{ echo}}} \varvec{G}(t){\text {d}}t + \gamma \varvec{v}\int _{0}^{t_{\text{ echo}}} \varvec{G}(t)t{\text {d}}t, \end{aligned}$$
(10)

where \(\Phi _{0}\) is the unknown background phase; the second and third components describe the influence of static spins at \(\varvec{r}\) and moving spins with velocities \(\varvec{v}\) on the phase components, respectively. Velocity encoding is performed using bipolar gradients that results in zero phase contribution due to stationary spins. The moving spins will experience linear phase change dependent on the velocity given as

$$\begin{aligned} \Phi _{1} (\varvec{v}) = -\gamma \varvec{v} \int _{0}^{t_{\text{ echo}}} \varvec{G}(t)t{\text {d}}t = \gamma G(T/2)^{2} v, \end{aligned}$$
(11)

where T is the total bipolar gradient duration and G is the strength of the gradient. However, the background phase effect \(\Phi _{0}\) cannot be refocused using a single bipolar gradient. Therefore, two datasets of signal phase are acquired using two loops of sequence with the appropriate velocity encoding gradients. The subtraction of the two resulting phase images allows the quantitative assessment of velocities and diffusion in the fluid. A complete spin echo single-sided bipolar gradient (SE-SBP) sequence is shown in Fig. 2.

Fig. 2
figure 2

A basic spin echo imaging sequence—with two added bipolar gradient sets of opposite polarity—is used for one direction flow encoding. Each set uses a repetition of \(90^\circ\) and \(180^\circ\) pulses for phase encoding steps

2.3 Flow dynamics

The fluid in the MRI–DPD simulator is modeled using dissipative particle dynamics (DPD) (Hoogerbrugge and Koelman 1992), where a set of interacting point particles represent the material under observation. This method has been successfully applied to simulate the hydrodynamic behavior of real fluids. This is achieved through pairwise interactions, composed of conservative, dissipative and random forces exerted on particle i by particle j, respectively. The positions and momenta of the particles are updated at discrete time steps. The updates are computed based on Newton’s second law with equations of motion for particle i reads as

$$\begin{aligned} \frac{{\text {d}}\varvec{r}_{i}}{{\text {d}}t}= &\, {} \varvec{v}_i; \end{aligned}$$
(12)
$$\begin{aligned} m_i\frac{{\text {d}}\varvec{v}_i}{{\text {d}}t}= & \,{} \varvec{F}_{i}(t)=\sum _{j\ne i}(\varvec{F}_{ij}^{{\text {C}}}+\varvec{F}_{ij}^{\text{D}}+\varvec{F}_{ij}^{\text{R}}), \end{aligned}$$
(13)

where \(\varvec{r}_{i}\) and \(\varvec{v}_{i}\) are the position and velocity vectors of particle i. \(\varvec{F}_{ij}^{\text{C}}\) is a conservative force, \(\varvec{F}_{ij}^{\text{D}}\) is a dissipative force, and \(\varvec{F}_{ij}^{\text{R}}\) is a random force. The conservative force is a soft repulsion acting along the line of centers and is usually given by (Hoogerbrugge and Koelman 1992; Groot and Warren 1997)

$$\begin{aligned} \varvec{F}_{ij}^{\text{C}}= {\left\{ \begin{array}{ll} a_{ij}(1-{r_{ij}}/{r_{\text{c}}})\varvec{e}_{ij},&{} r_{ij}< r_{\text{c}}^{\text{C}};\\ 0, &{} {\text{otherwise}}, \end{array}\right. } \end{aligned}$$
(14)

where \(a_{ij}\) is the maximum repulsion between particle i and j, with \(\varvec{r}_{ij}=\varvec{r}_{i}-\varvec{r_{j}}\); \(r_{ij}=|\varvec{r}_{ij}|\), and \(\varvec{e}_{ij}=\varvec{r}_{ij}/r_{ij}\). \(r_{\text{c}}^{\text{C}}\) is the so-called cutoff radius of the interaction. The remaining two forces, dissipative and a random, are given by

$$\begin{aligned} \varvec{F}_{ij}^{\text{D}}= & {} -\gamma w(r_{ij})^{\text{D}}(\varvec{e}_{ij}\varvec{v}_{ij})\varvec{e}_{ij};\nonumber \\ \varvec{F}_{ij}^{\text{R}}= & \;{} \sigma w(r_{ij})^{\text{R}}\varvec{e}_{ij}\theta _{ij}, \end{aligned}$$
(15)

where \(w^{\text{D}}\) and \(w^{\text{R}}\) are the r-dependent weight functions that vanish for \(r>r_{\text{c}}\) with \(v_{\text{ij}}=v_{i}-v_{j}\), and \(\theta _{ij}(t)\) is a randomly fluctuating variable with Gaussian statistics: \(<\theta _{ij}(t)>=0\) and \(\langle \theta _{ij}(t)\theta _{kl}(t')\rangle =(\delta _{ik}\delta _{jl}+\delta _{il}\delta _{jk})\delta (t-t')\). These forces conserve angular momentum since they act along the line of centers. The random and dissipative forces are not independent but coupled through a fluctuation–dissipation theorem. Espanol and Warren showed that there are two necessary conditions that must be fulfilled to keep the system in thermodynamic equilibrium. First requirement allows us to choose one of the two weight functions appeared in Eq. (15). Second requirement relates their amplitude and \(k_{\text {B}}T\). Precisely as

$$\begin{aligned} w^{{\text{D}}}(r)= & \; {} [w^{\text{R}}(r)]^{2};\nonumber \\ \sigma ^{2}= & \; {} 2\gamma k_{\text {B}}T. \end{aligned}$$
(16)

A flow chart showing the complete MRI–DPD scheme is depicted in Fig. 3. It shows a spin echo sequence with two bipolar gradient loops being executed during a simultaneously running fluid dynamics defined by DPD.

Fig. 3
figure 3

The flow chart of the complete MRI–DPD method with spin echo sequence added two bipolar gradients. After coupling of the flow dynamics with the spin dynamics, the sequence is applied on DPD particles. \(2\times N\) samples are acquired after \(2\times N\) phase encoding steps to get two sets of phases. These two sets of phases are then subtracted to construct the phase image

2.4 Scaling

The fluid flow behavior was based on a standard DPD scheme for water with the parameters as defined by Groot and Warren (1997). A repulsive parameter \(a_{ij}=75k_{\text {B}}T/\rho\) was chosen to simulate the compressibility of the water model. The velocity Verlet scheme was used with \(\lambda =0.5\) and noise amplitude \(\sigma =3\). All simulations were performed on a three-dimensional box with various sizes defined as per the needs of the experiments. We use the notation \(u=u_{\text {DPD}}*[u]\) to relate SI units to DPD units. Here the left hand side denotes a variable u in SI-units, [u] denotes the unit of u as used in the simulation, while \(u_{\text {DPD}}\) is a numerical unit-less value of u when expressed in the DPD unit. We fixed the length of our system by choosing the pixel size. We fixed the mass unit [m] by comparing the fluid density with the density of water of \(\rho = \rho _{\text {water}}[\rho ]\) at room temperature. Upon choosing the temperature as \(1[T]=298\,\,{\text {K}}\), the unit of time [t] is fixed through the unit of energy \([\varepsilon ]= k_{\text {B}}T\). We also required the unit of magnetic field [B] to be specified as

$$\begin{aligned}{}[B]=\dfrac{[m]}{[I][t]^{2}}. \end{aligned}$$
(17)

Since there is no interaction between the magnetic field and the DPD forces, the current unit is independently chosen.

Fig. 4
figure 4

Geometry used for PC-MRI of flow crossing an obstacle. The schematic shows a parabolic flow approaching a rectangular obstacle located in the middle of the channel. Dashed lines indicate the only area where magnetization is applied to the imaging particles

Table 1 Fluid properties for water and DPD parameters

Laminar flow, with a parabolic and shear velocity profiles, was imposed as initial condition on the flow in the channel. Water flows along the x-axis from left to right in the channel and does not encounter periodic boundary conditions until one phase step of the image sequence depicted in Fig. 2 is completed. Periodic boundary conditions were applied along the y-axis (perpendicular to the flow) and the particle velocities were restored to the pre-applied initial conditions upon re-entering the channel. A no-slip boundary condition was modeled along the x- and z-axis. However, the effect of a no-slip boundary condition was intentionally unaccounted for in phase-contrast imaging. The imaging was conducted on an area around the center, which was sufficiently far away from the no-slip boundary. A rectangular obstacle was constructed in the flow path located in the middle of the channel as shown in Fig. 4. The dimension of the obstacle was \(84\,{\upmu }{\text {m}} \times 84\,{\upmu }{\text {m}}\). The obstacle walls acted as reflectors for the approaching DPD particles, achieved by implementing bounce back boundary conditions. Here we avoided implementing DPD interaction forces between the fluid and the wall particles, as these soft interaction forces will not prevent the fluid from entering the obstacle.

3 Results

The MRI–DPD simulator code was written and implemented in MATLAB version 2015a and ran on a PC with a 4-core i7-2600 CPU processor. The general MRI and DPD parameters used for all the simulations are listed in Table 1. Further case-specific parameters are mentioned in the respective section. The simulated cases are MR imaging of a parabolic flow, shear flow, diffusive flow, and flow through an obstacle.

3.1 Phase-contrast imaging of laminar flow

A parabolic flow phase image with a peak velocity of \(18\,\,{\upmu }{\text {m}}/{\text {s}}\) is shown in Fig. 5. The field of view (FOV) is \(0.57 \,\,{\text {mm}} \times 0.42\,\, {\text {mm}}\) with a matrix size of \(100 \times 100\) and with a slice thickness of \(0.1{\text { mm}}\). There were roughly 30,000 DPD particles flowing, but only 2700 particles used for imaging. The spin echo sequence with bipolar gradients was applied along the flow direction (x-direction) with a strength of \(1.6{\text { mT}}/{\text {m}}\) and duration of \(30{\text { ms}}\). The repetition TR and echo time TE were \(210{\text { ms}}\) and \(150{\text { ms}}\), respectively. Similar parameters were used for a shear velocity profile shown in Fig. 6.

Fig. 5
figure 5

(a) In-plane laminar flow encoded phase image with peak velocity of \(18\,\,{\upmu }{\text {m}}/{\text {s}}\) in the x-direction. Bipolar gradient was applied along the flow direction. (b) A plot showing velocity measurement of the particles (each averaged along the x-axis) relative to their position in the channel across the y-axis. The reference velocity profile (red curve) is obtained through DPD calculations without magnetization, while the (blue curve) is obtained through PC-MRI. There is good agreement between both measurements

Fig. 6
figure 6

(a) Phase magnitude image of an in-plane shear flow with the same peak velocity of \(18\,\,{\upmu }{\text {m}}/{\text {s}}\) in the x-direction with bipolar gradient applied along the flow direction. (b) A plot showing velocity measurement of the particles (each averaged along the x-axis) relative to their position in the channel across the y-axis. The reference velocity profile (red curve) is obtained through DPD calculations without magnetization, while the (blue curve) is obtained through PC-MRI. There is good agreement between both measurements

3.2 Diffusion weighted image using SE-SBP sequence

On decreasing the peak velocity from 18 to \(3.15\, \upmu {\text {m}}/{\text {s}}\), we are able to record the effect of thermal fluctuations on MRI images. At lower velocities, the phase gain due to diffusive motion of particles becomes prominent on MR images manifested by pixelation. Due to the velocity-dependent phase shift, we switched to higher bipolar gradient strength, i.e., \(1.9{\text { mT/m}}\) for slower velocities while the rest of the MRI parameters were kept the same as applied before. An effect of diffusion on the image is visible in Fig. 7. This is in contrast to the image with the faster parabolic flow, where the gain in the phase magnitude due to higher velocity is larger than the phase accumulation due to diffusive motion. An image with similar effect of diffusion was captured when the flow channel was subjected to shear flow. The obtained diffusion-weighted image is shown in 8 clearly depicting the thermal fluctuation, which was obtained by lowering the rate of advection relative to the rate of diffusion. The velocities were measured using PC-MRI up to a duration of one imaging sequence with field of view \(0.57{\text { mm}} \times 0.42{\text { mm}}\); they are plotted in Figs. 7b and 8b.

Fig. 7
figure 7

(a) Phase image of a slow parabolic flow profile, with peak velocity of \(3.15\,\,{\upmu }{\text{m}}/{\text{s}}\) in the x-direction. A prominent thermal fluctuation effects becoming visible on the phase image. (b) A plot showing the phase gain values of the particles (each averaged along the x-axis) relative to their position across the y-axis. A variation in phases acquired due to diffusion are clear in this plot

Fig. 8
figure 8

(a) Phase image of a shear velocity flow profile with peak velocity of \(3.15\,\,{\upmu }{\text{m}}/{\text{s}}\) in the x-direction. A prominent thermal fluctuation effects become visible on the phase image. (b) A plot showing the phase gain values of the particles (each averaged along the x-axis) relative to their position across the y-axis. A variation in phases acquired due to diffusion are clear in this plot

3.3 PC-MRI of flow crossing an obstacle

We further imaged the effect of an obstacle on PC-MRI for four relatively slow flow velocities. Fluid entered the channel with different velocities \(v1=6.3\,\,{\upmu }{\text {m}}/{\text {s}}, v2=10.5\,\,{\upmu }{\text {m}}/{\text {s}}, v3=14.7\,\,{\upmu }{\text {m}}/{\text {s}}\) in Fig. 9a–c, respectively. The channel width was \(0.55{\text { mm}}\) with FOV \(=0.42 \times 0.34{\text { mm}}\). The strength of bipolar gradient was kept the same, i.e., \(1.9{\text { mT}}/{\text {m}}\) because this gradient value was well suited for imaging faster as well as slower velocities. As the fluid flow exceeded a certain threshold velocity, which in this case was \(18\,\,{\upmu }{\text {m}}/{\text {s}}\), the phase image was pixelated (Fig. 9d). As the flow profiles did not indicate any flow turbulence, the pixelation of the image must have been due to only choosing unsuitable sequence parameters. For such slow flows, therefore, different parameters for bipolar gradients are required to get proper phase image.

Fig. 9
figure 9

Phase images of particles on the left and velocity profiles on the right, bypassing an obstacle for various flow velocities. Fluid is entering the channel from the left, bypassing the obstacle that is positioned in the middle of the channel. For the case of the phase images with slow velocity profile (a, b), diffusion-loaded image is recorded with particles stuck at the obstacle for a while before leaving, thus contributing to the bright spots at the left wall of the obstacle. For the case of the phase image with higher velocity profile (c), initially a smooth phase magnitude is visible on the left side of the obstacle; but soon after colliding with the obstacle, the fluid particles disperse giving a distortion in the image. For the case of the phase image with even higher velocity (d), the complete phase image becomes pixelated due to inappropriate values of the parameters in the SE-SBP sequence. In this case, different values of the bipolar gradient strength and duration need to be tested

4 Discussion and conclusions

We successfully visualize flows in the form of parabolic and shear profile shown in Figs. 5 and 6 and quantitatively analyzed using phase-contrast MRI method. In the simple spin echo bipolar (SE-SBP) sequence, we did not encounter spurious signals to disrupt the image considerably. As the flow along the x-axis dominates, a small phase variation due to thermal noise was averaged out using low pass filter.

The effect of thermal fluctuations on the flow images is shown in Figs. 7 and 8, which was possible by choosing the velocity \(3.15 \,\, \upmu {\text {m}}/{\text {s}}\). By imaging the parabolic profile at slow speed, the impact of flow on the phase gain becomes nearly indistinguishable from the impact of diffusion, because the particles start obtaining similar phase values for both cases of either moving in one velocity layer or diffusing between different velocity layers.

DPD gave us realistic aspect in simulating flow by incorporating thermal fluctuations, and made possible imaging a slow flow passing by an obstacle (Fig. 9). In contrast, it is difficult in CFD to realistically simulate spins moving around curved paths at slow flow. In Fig. 9c, it is clearly visible that the image at higher flow rate is smoother before the particles strike the obstacle and dispersion effects come about. However, increasing the flow velocity further to \(18\,\, \upmu {\text {m}}/{\text {s}}\) (Fig. 9d) results in the failure of the SE-SBP sequence and the whole image becomes pixelated in random brightness. In this case, other bipolar gradient parameters should be applied.

In the SE-SBP sequence, there were two sequence loops, from which we obtained two complex images data and these two acquisitions were directly subtracted on pixel-by-pixel basis. Freidlin et al. (2012) used only one part of the sequence loop to get diffusion-weighted images in moving media. Since diffusion is a random motion, subtraction of phases will not affect the randomness, so this sequence is not only valid for slow flow but also for diffusion measurement. A diffusion constant can be calculated using Eq. (9) (Freidlin et al. 2012).

The MRI–DPD simulator code was written in MATLAB script. Total time for simulating 30,000 fluid particles with 2700 image particles for a single set of a pulse sequence was 8 h on a 4-core processor. This time is less than previously recorded time for isochromat summation of flow measurements (Marshall 1999), where in one of the cases the computations were spread over 100 processors in a cluster (Marshall 2010). Although the isochromat summation method is computationally relatively complex, it has the advantage that it simulates MRI phenomena close to reality. The computational complexity of the isochromat method is of fourth order \(O(n^{4})\). The computational cost depends on the square of the number of particles \(O(n^{2})\), which further increases to \(O(n^{4})\) on implementation of gradients. However, we can speed up computation of the spin dynamics by implementing a vectorized code instead of a scalar code. We compared both scalar and vectorized codes to image 2000 stationary spins. The former took 5 h to obtain the image, while the latter merely 23 s. As discussed by (Martin 1989; Brown and Martin 1984), the scalar code’s execution is slow as compared to vector codes due to the overheads associated with implementing the for-loops; and the same applies in our case, since updating the particle magnetization necessitates calculating the gradient values in each inner loops. In the vectorized code, gradient values are calculated in matrix form thus avoiding excessive overheads and magnetizations are updated by matrix multiplication. Vectorization is well placed in MATLAB, making it our first choice for implementing the vectorized isochromat as well as DPD algorithm. Other reasons of choosing MATLAB was the ease and availability of better graphics and signal processing tools.

We presented here a proof of concept of MRI–DPD scheme. Here fixing the transport properties of the fluid was not a prerequisite. DPD enables the choice of diffusion constants and viscosity values for the desired fluid. Even though the self-diffusion constant of a DPD particle is generally not equal to the self-diffusion constant of the real fluid that it should represent, it is possible, at least for simple fluids, to establish a connection between the two (Azhar et al. 2016). The two diffusion constants are proportional, and the proportionality constant is the third root of the number of microscopic objects (e.g., water molecules for the self-diffusion of water) contained in one DPD particle according to the mass assigned to it. Multi-particle collision dynamics (MPCD), on the other hand, is also a suitable candidate for slow flow and diffusion-weighted MRI simulation, but it yet misses the simplicity and freedom that DPD provides for the choice of transport properties as well as its implementation.

Recently, we published a study on the effect of thermal fluctuations on NMR signals (Azhar et al. 2016). To our best knowledge, no report exists on the effect of thermal fluctuations on MR images at mesoscopic level. Current model is very simple but efficient. Choosing simple spin echo sequence with the essence of reality is well preserved. Azhar et al. (2016) so far coupled DPD with NMR by introducing extra degrees of freedom for magnetization, and solved Bloch equations for these extra degrees of freedom using the particle dynamics code SYMPLER (Kauzlarić et al. 2014). Here, however, we chose a different approach for coupling thermal motion with MRI. Computational cost for solving the Bloch equations with sophisticated integrator such as Runge–Kutta of higher order was simply avoided without losing any important effect on the results. Time discrete solution of Bloch equations is also the preferred choice in the design of MRI simulator, not only to avoid high computational cost but to also enjoy more flexibility for the implementation of different pulse sequences.

This technique opened new possibilities for simulating flow and diffusion MRI at mesoscopic level. This MRI–DPD simulator is also better suited to study DW-MRI. All types of pulse sequences, targeting solely either diffusion or flow imaging can be easily implemented with this DPD–MRI simulator. This new method can be used to image restricted diffusion of intracellular molecules, can also be used for flow imaging of cardiovascular disorders, such as stenosis. Furthermore, the DPD–MRI method can also simulate an aorta artery for assessing vessel patency and can even be expanded to model blood flow phenomena such as coronary slow flow, moving arteries and non-Newtonian flow. There is a strong need for better filter design, which could single out diffusion from noise due to discrete frequency spectrum. Computational time for larger geometries could be an issue in the future. It will be addressed either by writing a DPD algorithm on lower level languages such as C++/Python and then linking it with MRI MATLAB script or by saving positions and velocities of DPD particles [e.g., computed with SYMPLER (Kauzlarić et al. 2014] for post processing through MRI simulator. A high-performance DPD end or a post processing will surely speed up the overall time needed for simulating the complex and larger geometries. Further improvement entails simulating artifacts encountered in images such as chemical shift, intra-voxel dephasing, imperfection of slice selection but this is beyond the scope of the present article.

In conclusion, we have successfully demonstrated the mesoscopic simulation of MRI of slow flow and diffusion, including the test of SE-SBP sequence and the effect on flow images due to an obstacle. The simulator developed, provides a complete work station that can be used for simulating a variety of MRI experiments depending on the desired experiment with little modification. We believe the method effectively combines the MRI simulator with flow dynamics to simulate MRI experiments for different geometries.