|
AdvSimTutorialWalker, there is no pathway, the pathway comes while you go - Antonio Machado Tutorial: More Advanced SimulationsThe Data Synthesis tutorial introduces the Camino simulation capabilities and shows how to run some simple simulations, but the simulation is capable of a lot more than this. This tutorial describes some of its more advanced features and how to simulations that use them. In particular, the simulation allows the diffusion environment to be modelled in quite complicated ways, these environments are called "substrates" and in this tutorial we'll be covering how to run several different substrates such as
A substrate is envisaged to sit inside a single voxel, with spins diffusing across it. The boundaries of the voxel are ususally periodic so that the substrate defines an environment made up of an infinite, 3D array of whatever you specify. The measurement model in the simulation does not capture the trade-off between voxel size and SNR and hence simulation "voxels" can be quite a bit smaller than those in actual scans. The simulation is, and has always been, intended as a tool to simulate signals due to sub-voxel structure, rather than large spatially-extended structures. Running simulations and common optionsSimulations are all run via the Half a CommandPutting this together, we can go a long way towards running a simulation. In fact, we can specify everything in a simulation except the substrate. In fact, although it usually the best thing to do, it is not always appropriate to specify a scheme file. The next section describes running simulations with and without scheme files. Scheme files and simulationsAs previously mentioed, a scheme file defines a pulse sequence used by the simulation to generate synthetic data. There are several different formats of scheme file which describe different kinds of pulse sequences at different levels of complexity. The simulation can make use of any of them, although in the case of very simple scheme files, assumptions will be made about the specifics of the sequence.
The simulation needs to run at least one set of dynamics to generate a set of synthetic measurements. Simulations are complex and can take anything from minutes to days depending on complexity and hardware. The longer a schemefile is, the more memory will be required by the simulation, since each spin stores a phase shift for each entry in the scheme file. For this reason, it may not be advisable to put hundreds of measurements into a single scheme file but rather split them across different simulations. Trajectories filesIn some applications, however, we might want to synthesise many different sets of measurements from the same simulation. For example, I might want to compare the sensitivity of different acquisitions to a partticular parameter, or to investigate the behaviour of the diffusion signal as a function of one or more scan parameter. In this case, it may not be appropriate or even feasible to run a separate simulation for every protocol used and for this reason it is possible to separate the simulation dynamics from the data synthesis phase. This is done using an intermediate file called a trajectories (or traj) file. A traj file contains the complete trajectories of all spins in a given simulation and may be parsed into a set of measurents at a later date. In order to run a simulation in this way, use the trajfiles are parsed into data using a separate command called Different SubstratesAt its heart, the diffusion simulation is a model of diffusion in an environment that restricts the motion of spins. Data are generated by simulating the action of a pulse sequence on the spins, and hence data is a function of spin trajectories, which are themselves strongly influenced by the environment. The structure contained in the environemtn is called the "substrate" and it is important to choose a substrate that is appropriate for the study you are interested in. New substrates are being added to the simulation all the time, but this tutorial covers the most useful and flecible types provided by the simulation. Since diffusion MRI has historically been concerned with imaging white matter, many of the substrates supported by the simulation are designed to model white matter structure and are hence composed of cylinders. However, more recently the limitations of cylinders have started to become important and so a more general form of substrate was implemented that deascribes the environment with arbitrary triangle meshes, making it possible to simulate diffusion in extremely detailed tissue environments. Empty substratesThe absolute simplest simulation possible is in an empty environment without any restricting structures at all. This is called an Empty substrate, and it's the simulation's equivalent of putting a bottle of water in the scanner, i.e. it's a model of free diffusion. Empty substrates can be surprisingly useful for testing purposes and are also very fast to run because of the lack of intersection checking. To run and empty substrate use: Regular-packed cylindersThe simplest non-trivial simulation that is supported is an environment containing regularly packed cylinders of constant radius. In this situation, the environment is composed of an infinite array of cylinders parallel to the z-axis. There are two ways of arranging cylinders in this way: square-packing, in which cylinders are placed at the intersections on a square grid, and hexagonal-packing in which they are placed on the intersections of a triangular grid. From a data-synthesis perspective there is not a great deal of difference between the two of these packings but it is worth noting that a hexagonal packing is more effiecient at filling space than square pavking. The maximum intracellular volume fraction from non-overlapping square packed cylinders is around 71% whereas from hexagonal packing it is 92%. The simulation supports both of these configurations, they are specified by the An example command to run a simulation with a regular-packed cylinder substrate is: Crossing CylindersA situation that is often of interest in diffusion MR research is where we have more than one principle fibre direction. The simulation is able to model crossing fibres with a specified crossing angle. This substrate contains two populations of fibres in interleaved planes. One population is parallel to the z-axis and another is rotated about the y-axis by a given angle with respect to the first. Cylinders on this substrate are arranged in parallel in the xz-plane in parallel layers one cylinder thick. I.e. a plane of cylinders parallel to the z-axis, with a rotated with respect the first, then another parallel z-axis and so on. Cylinders are all of a constant radius. An example command to use here is Irregularly Packed, Distributed Radius CylindersUseful as they are, regularly packed cylinders of constant radius do not capture much of the compleity of white matter tissue, and in fact we can do quite a bit better. In this section we describe a more realistic type of substrate. Parallel cylinders with gamma-distributed radius and not symmetry in their arrangement. For brevity we refer to this substrate as gamma-cylinders. For historical reasons, it is referred to on the commandline as an "imflammation" substrate (see Hall & Alexander IEEE TMI 2009). The gamma cylinder substrate contains a specified number of cylinders whose radii are drawn from a gamma distribution. This distribution is specified by two parameters, which may also be given on the command line. Cylinders are placed randomly in a square region of a given size such that no two overlap and that the edges of the square are periodic: a cylinder that overlaps an edge is repeated on the oppiste side of the square. An example command for simulating diffusion with gamma distributed cylinders is A more complex substrate also brings other considerations. Firstly, it may be necessary to model a larger number of spins in order to probe its complexity. Here we have used 100000, but for more demanding simulations including high b-value measurements it may be neccessary to increase this substantially. It is not uncommon to use 500000 spins and 2000 or more timesteps in order to obtain good convergence of results. Furthermore, a disordered substrate means that in order to eliminate bias in simulations it is necessary to run several simulations on different realisations of the same substrate. This means different sets of cylinders with the same statistical properties arranged in different ways in space. Fortunately, this is simple to do. The seed for the random number generator can be changed using the Mesh substratesThe most flexible and realistic type of substrate currently supported by the simulation is the Mesh Substrate. Mesh substrates model the environment as a collection of triangles and as such can model almost any shape in three dimensions. Mesh substrates have been successfully used to simulate diffusion in environments constructed from micrograph images (see Panagiotaki et al 2010) and to explore structures whose radius varies along their length. Mesh substrates are constructed using a PLY file. This is a simple file format used for 3D geometry. They are simple to construct, and the format is described here. is an example of the format as parsed by the simulation. In common with everything else in Camino, all distances in the PLY file used will be assumed to be in meters. A basic example command for running a simulation on a mesh substrate is Because meshes are very complicated, simulations with meshes can be very computationally demanding. Previous work (see Panagiotaki et al MICCAI 2010) has employed meshes with as many as 200000 triangles, simulating 80000 spins and 1250 updates required around 24hours on a 3.2GHz dual-core linux PC. It is important to run with a large number of spins and updates in order to achieve unbiased results with good convergence. Other OptionsThis section describe some other miscellanious features of the simulation that may be useful. Different pulse sequencesFirst of all, it's worth mentioning that the simulation can work with a variety of scheme file formats. In addition to the standard version 1 scheme file that describes standard PGSE acquisitions, the simulation can work with twice refocussed spin-echo (TRSE)sequences using version 3 scheme files and completely general gradient waveforms using gradient waveform schemes (see tutorial on general waveform scheme files which can express, for example, double wave-vector or oscillating gradients.). A general waveform scheme can be used to describe arbitrary, 3 dimensional pulse shapes and so are able to describe almost any conceivable sequence. The simulation will work seamlessly with any of these schemes, simply specify a scheme file of the appropriate format on the command line. PermeabilityIn all commands given previously, membrane permeability was set to zero via the Stats filesIn addition to generating synthetic MRI signals, the simulation is capable of generating statistics directly from the dynamics. These are generated in stats files. To generate a stats file, just specify its name from the command line using That about covers things. Have fun in Monte-Carlo. |