|
Man /
DatasynthContent-type: text/html datasynthSection: User Commands (1)Index Return to Main Contents NAMEdatasynth - Generates synthetic diffusion MRI data.SYNOPSISdatasynth [-options]DESCRIPTIONGenerates synthetic diffusion MRI data either using a test function or a Monte-Carlo simulation for the spin-displacement density and an image acquisition scheme. The program outputs data in the format required by fitting programs such as dtfit, so the output of datasynth can be piped straight into these programs. By default the output is voxel-order four-byte floating point data.If a scheme file is specified, it must either be in SI units for the standard test functions to work (since they use tensors in SI units). You may use scheme files in other units if you specify the full diffusion tensor to be used in the test function. EXAMPLESGenerate 10000 voxels of synthetic data from a zero-mean Gaussian test function with diffusion tensor diag(17, 2, 2)*10^{-10} m^2 s^{-1} and signal to noise ratio 16 (Rician noise: see -noisetype) with no diffusion weighting using the acquisition scheme specified in A.scheme and store the data in file P1_A10000.Bfloat:
Generate 10000 voxels of data from a mixture of two zero-mean Gaussians with diffusion tensors diag(30, 6, 6)*10^{-10} m^2 s^{-1} and diag(6, 30, 6)*10^{-10} m^2 s^{-1} and signal to noise ratio of 16 at q=0 using a spherical acquisition scheme with M=8 measurements at b=0, N=61 gradient directions, radial wavenumber |q|=200000 m^{-1} and diffusion time tau=0.04:
Equivalently,
datasynth can also read input data, such as diffusion-tensor data or two-tensor data in the format output by modelfit, dtfit or twotenfit. Given input data, datasynth generates synthetic diffusion-weighted MRI measurements for each voxel using the input data to specify the test function. For example:
creates a data set of synthetic measurements from the diffusion tensor data in DiffTensorA.Bdouble. Here is a slightly pathological example to illustrate how this feature can be used:
Note that only one voxel of data is produced per test function when the -inputmodel option is used. The -voxels option is not used in this case. If we wanted 1000 voxels of data from DiffTensorA.Bdouble, we write 1000 voxels containing the same information to DiffTensorA.Bdouble. MONTE-CARLO SIMULATION EXAMPLESdatasynth can also synthesise data using a Monte-Carlo simulation of spins executing brownian motion on a specified substrate which restricts the motion of their excursions. Specifying any simulation-realted option will cause datasynth to use a simulation instead of a test function. Monte-Carlo simulation requires more information about scan parameters than is contained in a schemefile, and so gradient strength G, gradient pulse duration delta and pulse interval DELTA should ALL be specified from the commandline. The type and size of substrate should also be specified. If the commandline values of delta, DELTA and G are different from those in the schemefile, commandline values will be used. To synthesise 10000 voxels of data using the schemefile A.scheme, with gradient strength with gradient strength G=0.022Tm-1, gradient block duration delta=0.032s and gradient block interval DELTA=0.04s with 10000 spins on a substrate with one principal direction and 1000 timesteps in the scan, use datasynth -schemefile tensorDirs_b=500.scheme -voxels 10000 -walkers 100000 -tmax 1000 -p 0.0 -initial uniform -snr 16.0 -G 0.022 -del 0.032 -DEL 0.04 -geometry cylinder -packing SQUARE -cylinderrad 1.9E-6 -cylindersep 4E-6 > MCdata.Bfloat we have also specified that spins are initially uniformly distributed across the substrate with impermeable barriers, and an SNR of 16. The diffusion environment here is a set of cylinders parallel to the z-axis with radius and separation given by the -cylinderrad and -cylindersep options. -packing SQUARE causes cylinders to be square packed, substituting HEX will cause hexagonal packing. the limit of close-packing will be acheived by specifying a cylinder radius equal to half the separation. Monte-Carlo simulations of cylinders with distributed radii are also possible. Radii are draw from a gamma distribution with specified parameters. Cylinders are oriented parallel to the z-axis, and are packed into a region of specified size. Cylinders will be packed in a disordered but non-overlapping pattern. If the specified region is too small to contain the number of cylinders specified an warning will be generated. The following command specifies 100000 spins, 5000 timesteps, 100 cylinders with radii drawn from a gamma distribution with scale parameter 1.065E-7 and shape parameter 5.9242 packed into a cubic region 1.4E-5m x 1.4E-5m x 1.4E-5m in size. datasynth -walkers 100000 -tmax 5000 -geometry inflammation -numcylinders 100 -p 0.0 -initial uniform -voxels 1 -increments 1 -separateruns -latticesize 1.4E-5 -schemefile STscheme.scheme -gamma 5.9242 1.065E-7 The locations and radii of cylinders can be output to a csv file of specified name by adding -cylfile testcyls.csv to the above command.
Crossing fibres can be simulated using datasynth -schemefile tensorDirs_b=500.scheme -voxels 10000 -walkers 100000 -tmax 1000 -p 0.0 -initial uniform -snr 16.0 -G 0.022 -del 0.032 -DEL 0.04 -geometry crossing -cylinderrad 1.9E-6 -cylindersep 4E-6 > MCdata.Bfloat here cylinders are arranged in alternate sheets with principle axes parallel to the z- and x-axis in successive layers
It is also possible to separate the dymanics of the Monte-Carlo simulation from the synthetic measurements. In this case a simulation duration (the duration, in seconds, of the simulated diffusion. In practice this should be long enough to accomodate your scan sequence) and a traj file, which stores spin trajectories and is used by the scan module to generate synthetic measurements. To generate spin trajectories from a monte-carlo simulation: datasynth -schemefile tensorDirs_b=500.scheme -voxels 10000 -walkers 100000 -tmax 1000 -p 0.0 -initial uniform -geometry cylinder -packing SQUARE -cylinderrad 1.9E-6 -cylindersep 4E-6 -duration 0.07 -trajFile MC.traj In this case, no data will be written to stdout at the end of the simulation and instead the traj file is produced as the simulation progresses. The traj file contains ALL the trajectory information for every spin in the simulation and as such will be very large. File size is proportional to (number of spins) x (number of timesteps) and the trajfile from the about command will be over 300Mbytes, so caution is required in setting the number of walkers and timesteps. Howevere, if a wide range of scan parameters is required, this approach can save a lot of time.
REPETITION BOOTSTRAP EXAMPLESRepetition bootstrap data is generated by taking a number of repeated measurements of some data and then randomly sampling (with replacement) these repeated measurements to generate new combinations of the data. Let the (M+N) measurements be repeated R times and stored in an array data with dimensions (R, M+N). Each bootstrap sample b is an array of dimension (1, M+N) and each element b(i) = data(r(i), i), where 1 <= i <= M+N and r is a vector of random integers uniformly distributed between 1 and R. In other words, each element of the bootstrap sample, b(i), is randomly chosen from one of the R repeats of the measurement i. The following examples show the different ways to obtain bootstrap data. Synthesize 1000 bootstrap samples from a standard test function with 6 repeats. datasynth -testfunc 1 -schemefile A.scheme -snr 16 -bootstrap 6 -voxels 1000 > r6_b1000.Bfloat Synthesize 500 bootstrap samples from Gaussian test functions, where the diffusion tensors are stored in the file tensors.Bdouble, using 8 repeats. The output is
[ [bootstrap 0 (test func 0)] [bootstrap 1 (test function 0)]... datasynth -inputmodel dt -inputfile tensors.Bdouble -schemefile A.scheme -snr 16 -bootstrap 8 -voxels 500 > r6_b1000.Bfloat Generate 1000 bootstrap samples of each voxel of DW-MR data, stored in the files A_1.Bfloat through A_7.Bfloat: datasynth -bsdatafiles A_1.Bfloat A_2.Bfloat A_3.Bfloat A_4.Bfloat A_5.Bfloat A_6.Bfloat A_7.Bfloat -voxels 1000 -schemefile A.scheme -inputdatatype float > A_b1000.Bfloat Simulate bootstrapping with 12 repeats using monte-carlo simulation as the test function. datasynth -schemefile tensorDirs_b=500.scheme -bootstrap 12 -voxels 10000 -walkers 10000 -tmax 100000 -p 0.0 -initial uniform -steptype fixedlength -snr 16.0 -G 0.022 -del 0.032 -DEL 0.04 -geometry cell-striped -stripethickness 1 -latticesize 200 -cellsize 2E-5 > bs_simdata.Bfloat WILD BOOTSTRAP EXAMPLESWild bootstrap data is generated by fitting a linear model to the data and then resampling. Using DTI as an example, the Gaussian model of diffusion predicts
where q is the wavenumber of the measurement, D is the diffusion tensor, and e is the residual error on measurement i after finding the least-squares fit of D to the data. A wild bootstrap data sample of measurement i is then
where r is chosen at random from the set [-1, 1], and a is a correction factor applied to produce a heteroscedasticity consistent covariance matrix estimator. More details may be found in [Whitcher et al, Human Brain Mapping 29(3):346-62, 2008]. The following examples show different ways to obtain wild bootstrap data. Generate bootstrap samples of FA from a single data set.
As with the repetition bootstrap, we get 1000 voxels of data for each voxel of input. Generate bootstrap samples of FA from diffusion tensor input.
The above example produces one voxel of data (at SNR = 20) from a Gaussian test function, and then produces 1000 voxels of wild bootstrap data. This is repeated for each tensor in the file dt.Bdouble. OPTIONS
AUTHORSDaniel Alexander <camino@cs.ucl.ac.uk>SEE ALSOmodelfit(1)BUGS
Index
This document was created by man2html, using the manual pages. Time: 02:07:11 GMT, December 04, 2017 |