Analysis of Renal Diffusion-Weighted Imaging (DWI) Using Apparent Diffusion Coefficient (ADC) and Intravoxel Incoherent Motion (IVIM) Models

Analysis of renal diffusion-weighted imaging (DWI) data to derive markers of tissue properties requires careful consideration of the type, extent, and limitations of the acquired data. Alongside data quality and general suitability for quantitative analysis, choice of diffusion model, fitting algorithm, and processing steps can have consequences for the precision, accuracy, and reliability of derived diffusion parameters. Here we introduce and discuss important steps for diffusion-weighted image processing, and in particular give example analysis protocols and pseudo-code for analysis using the apparent diffusion coefficient (ADC) and intravoxel incoherent motion (IVIM) models. Following an overview of general principles, we provide details of optional steps, and steps for validation of results. Illustrative examples are provided, together with extensive notes discussing wider context of individual steps, and notes on potential pitfalls. This publication is based upon work from the COST Action PARENCHIMA, a community-driven network funded by the European Cooperation in Science and Technology (COST) program of the European Union, which aims to improve the reproducibility and standardization of renal MRI biomarkers. This analysis protocol chapter is complemented by two separate chapters describing the basic concepts and experimental procedure.


Introduction
Diffusion-weighted imaging (DWI) can be implemented in many forms, and similarly analysis of DWI data is more complex than for other common quantitative modalities such as T 1 , T 2 , and T 2 * [1,2]. The overall goal of deriving robust biomarkers for renal function, disease identification and response, as well as monitoring of transplants and so forth [3] relies not only on the suitability of the acquisition for the question being asked, but also how that data are handled in post-processing and analysis. The basic concepts underlying DWI, and example experimental protocols, are discussed in the chapters by Jerome NP et al. "Renal Diffusion-Weighted Imaging (DWI) for Apparent Diffusion Coefficient (ADC), Intravoxel Incoherent Motion (IVIM), and Diffusion Tensor Imaging (DTI): Basic Concepts" and by Periquito J et al. "Renal MRI Diffusion: Experimental Protocol" of this book. This chapter will cover general elements of data quality and analysis, with a view to providing example protocols for the main models employed for renal DWI. As mentioned in the chapter by Jerome NP et al. "Renal Diffusion-Weighted Imaging (DWI) for Apparent Diffusion Coefficient (ADC), Intravoxel Incoherent Motion (IVIM), and Diffusion Tensor Imaging (DTI): Basic Concepts," however, it is critical to note that analysis choices are intrinsically linked to the acquisition strategy itself, most prominently in number and direction of chosen b-values used, which means not only that the available choices of analysis are limited by the type of data collected but also that intended analysis should be an integral part of study planning. Analysis itself is naïve to the suitability of the choices of model and algorithm used, for example, and so this responsibility rests with the researcher.
Alternative diffusion models, as well as other mathematical signal representations without explicit physiological meaning, to the ones discussed here are numerous, and include the increasingly popular stretched exponential and kurtosis descriptions, and this field is constantly developing [4][5][6][7][8]. In addition to general considerations, this chapter provides explicit methods for two common diffusion models, namely, the apparent diffusion coefficient (ADC) and the intravoxel incoherent motion (IVIM) models, and describes the estimation of the corresponding diffusion parameters. While the assumption has been made that suitable data has been acquired (see the chapter by Periquito J et al. "Renal MRI Diffusion: Experimental Protocol"), no two datasets are alike, and these protocols are presented as guidelines that claim to be neither complete nor sufficient, and are intended only to provide a basic framework whereby a full analysis protocol can be developed. The advantages of more sophisticated algorithms than are presented here are becoming more apparent, and while the full details of these techniques are beyond the scope of this chapter, the reader is encouraged to investigate their potential when considering both analysis protocols and, where possible, study design. When retrospective analysis is performed outside the original study plan, understanding associated limitations and potential problems is crucial to delivering sound conclusions.
Once DWI data has been acquired, an appreciable portion of the available choices has already been made about how the data are presented and packaged. Analysis is thus a purely computational process that can be performed either "manually" using routines developed in-house, ideally in collaboration with specialist MR physicists or mathematicians, or by using commercially available software packages (including those available on the scanners themselves). The pros and cons of these two approaches are inversions of each other, essentially revolving around transparency of the processes and the ability to design bespoke interrogations of the data, versus using more developed and optimized analysis using tools that require less "up-front" investment of time but which can act as inscrutable "black boxes." While many of the same issues arise for renal imaging, is it useful to remember that much of current DWI acquisition and analysis development has been in the brain and for neurological applications. While this affords a large amount of literature and advanced techniques, translating from one tissue to another requires a certain degree of circumspection regarding assumptions and reoptimization, if not protocol redesign. Finally, it should be remembered that no level of analysis can ever provide more information than is contained in the data itself, and care should be taken to avoid over-interpretation.
This analysis protocol chapter is complemented by two separate chapters describing the basic concepts and experimental procedure, which are part of this book.
This chapter is part of the book Pohlmann A, Niendorf T (eds) (2020) Preclinical MRI of the Kidney-Methods and Protocols. Springer, New York.

Data Format and Quality
MRI, including DWI, data are stored as either a manufacturerspecific format (e.g., Bruker) or as a medical imaging standard (e.g., DICOM, NifTI), but in essence contains a series of matrices of intensity values constituting the images, with each image indexed against the acquisition parameters including the diffusion-weighting b-value. The exact details of where the b-value is stored varies by image format, or the b-value may need to be explicitly added (see Note 1). Commonly, DWI schemes acquire a set of three images for nonzero b-value magnitudes, with the diffusion-sensitizing gradients applied in orthogonal directions; this allows for calculation of a trace image, where any anisotropy of diffusion is averaged out by taking the geometric mean of the intensities. If possible, the separate images should be used for analysis, since this allows for finer quality control before processing, and will retain the intrinsic weighting (i.e., more data at nonzero points) assumed by fitting algorithms.
A brief visual inspection should identify corrupted data or individual images that need to be excluded on account of severe artifacts or signal dropout, or from insufficient signal-to-noise (SNR). Images and/or cases that display gross motion or distortion may require additional processing steps before being included [9], or can be excluded (see Fig. 1). Fig. 1 Examples of images that might be considered for exclusion from analysis. (a) Signal drop, which can be uneven across the image, may arise from excessive movement during image readout; these images are the same bvalue and were acquired in the same sequence, but show markedly different signal in each kidney. (b) Three images from the same sequence showing different degrees of distortion around the kidney edge; distortion is a dominant artifact in DWI where EPI is used, and is most prominent at magnetic susceptibility boundaries. (c) Imperfect fat suppression in the diffusion-weighted image across the body, combined with the chemical shift displacement of fat protons,

Software Requirements
Many common mathematical algorithms used for signal fitting are available across many software platforms with limited expertise needed to implement them, meaning analysis routines can be designed and written as needed. Commercial software such as Matlab include curve fitting toolboxes, whereas platforms such as Python and R contain equivalent functions and, being freely available, may present a more accessible or portable choice. In addition, these environments have the ability to handle image data (reading, sorting, displaying) and create figures, though a basic level of programming ability is required. The trade-off is more direct control versus the extra investment required to obtain proficiency with the software environment.
Several freely available software packages are able to perform both image processing and curve fitting, but attempt to give a more intuitive graphical user interface that allows out-of-the-box use, perhaps at the expense of tailored functionality. Environments such as Fiji (based on ImageJ, with additional plugins), as well as the brain-centric FSL and the OSX-only DICOM viewers Horos and OsiriX, provide different degrees of functionality and automation, and the option for bespoke plugins to at least some degree. The MR scanner itself and associated workstations also offer some options for processing of diffusion images, for example ParaVision on Bruker scanners or SyngoVia on Siemens, although the available choices and customizability on these systems can be limited.
In the following we present detailed instructions for implementing a custom-made analysis program.

Fitting Algorithms, Limits, and Initialization
In well-behaved systems with high quality data and appropriate models, choice of fitting algorithm is unlikely to influence the resulting parameters. In many cases, however, data are sufficiently noisy, or there may be cross-correlation between parameters in the model being used, which can mean that choice of fitting algorithm and initialization values can affect the result. These choices are subjective and are made as part of the analysis procedure, so should be reported in publications. Similarly, whether parameters are constrained to physical or anticipated physiological limits may have an effect on reported metrics. Analysis protocols should critically consider these choices as well as report them in scientific articles so that the results can be communicated within the appropriate context.
It is difficult to prescribe "best practice" in diffusion-weighted image processing, since organs and pathologies give a wide-ranging spectrum of situations. Given the highly perfused nature of the ä Fig. 1 (continued) may give incorrect intensities from overlap of fat signal with target areas; here, the subcutaneous fat around the abdomen (overlay in yellow; T1w is given for comparison) is shifted up in the image (overlay in red), and will alter the observed image intensity seen for part of the kidney kidney, together with the tubular structures, models such as IVIM that attempt to quantify pseudodiffusion (see Note 2) are potentially more informative than simple ADC measurements, although the analysis is more complex commensurate with the model, and may not give sufficient repeatability for detection of small changes [10]. Overall, standardization of protocols across studies has a value to be balanced against optimization at a local level, where translation of preclinical work into clinical use is the ultimate goal.

Generalized
Steps for Diffusion-Weighted Image Processing The steps listed here outline a general approach for DWI analysis (Fig. 2). The sections immediately following give more specific instructions for the ADC and IVIM models respectively, which are sufficiently different in complexity to warrant separate presentation and discussion. Notes at the end of the chapter, referenced throughout, give further detail on aspects that may need to be considered.

1.
Retrieve DWI data to analysis platform: verify b-value information, and expected number of images (see Note 1).
2. Initial quality check: SNR threshold (see Notes 3 and 4) for exclusion of poor images, excessive signal drop-out, distortion, motion, failed fat suppression, and so on.
4. Fitting of the model to observed signal intensities against their acquisition parameters, normally b-value magnitude (see Note 6). 6. Extraction of diffusion parameters. Summary statistics, histogram moments, and so on from a region of interest (see Notes 8 and 9).
The example protocols below are the constituent parts of a custom-made analysis program, designed to illustrate each step clearly and explicitly (and are thus not optimized for speed), and are presented in pseudo-code using functions and syntax in Matlab (Mathworks, Natick, USA). The wide number of equivalent choices and flexibility of some steps involved in DWI analysis are ignored in favor of presenting the main thread of a workflow that is easy to recreate, and so the reader is encouraged to appreciate the purpose of each step, which can usually be performed in a number of ways with different functions, rather than the specific implementation.

Preparation of Image Data for Fitting
1. Retrieve the data to the required folder structure and verify contents.
2. Load image data to matrix structure, aiming to create a 3D matrix of stacked images for each slice (a single slice is presented for simplicity here), with b-value in the 3 rd dimension (see Note 10).  Optional steps at this stage include distortion, eddy current, and motion correction, and image registration (see Notes 5 and 13).

Least Squares Fitting for Apparent Diffusion Coefficient ADC
1. Define the model for fitting, where the two variables in X are S0 and ADC (see Note 14): curveADC = @(X,bVals) (X(1)*exp(-bVals*X(2))); 2. Assign empty matrices for the two resulting maps, using the dimensions of the images (see Note 15): ADCmap(i,j) = res(2); end; end; % close the row/column loops Some of the options available for least-squares curve fitting include the choice of algorithm, boundary conditions, stopping criteria, number of iterations, and so forth. In general, for wellbehaved data the initial estimates will be good and the fitting should converge quickly.

Review the results maps to visually inspect the results. Data
plotted against a signal curve generated from the fitted values for any voxel in the image (i,j) should alert to any issues with either the fitting process or the data itself. 3. Extract the ADC values from the ROI to a single matrix for summarizing (mean, median, percentiles, etc.).

Linear Regression and Matrix Inversion for ADC
Fitting of DWI to the monoexponential ADC model can be achieved with either nonlinear fitting of the signal directly, as above, but can also be treated as a linear regression fitting problem (which is computationally faster) if the natural log of the signal intensities is used (see Note 17). For the minimal acquisition of Taking the signal logarithm also allows for the use of matrix manipulations to perform the linear fitting, which again is computationally faster and handles the whole image simultaneously (see Note 19).

Computed Diffusion Images
Following calculation of S0 and ADC maps, it becomes possible to create synthetic images at any desired b-value based on these values, which may increase conspicuity of lesions at higher b-values where noise would dominate in experimentally acquired images. Extension of this technique using an additional echo time TE allows similar control for computed T 2 weighting, which may assist with T 2 shine-through from fluid [11,12].

Intravoxel Incoherent Motion (IVIM)
Fitting of the more complex IVIM model introduces associated complexity on the analysis, in particular the initialization and algorithm used for fitting [13]. Notably, the fitting for IVIM is inherently nonlinear, and cannot be easily linearized for speed. While more advanced fitting routines become popular (see Subheading 3.3.6), the major obstacle to successful IVIM fitting is ultimately the appropriateness of the model to the quality of data available.
In the protocol below, which shares much with the ADC protocol in Subheading 3.2, we present the segmented method as a method of initializing a full least-squares fit. The segmented method benefits from speed and stability, and can be used as an estimator in its own right, although it relies on prior assumptions. Parameters from segmented fitting may be fixed for the subsequent least-squares fitting if desired [14][15][16]. In all cases, the user is strongly encouraged to critically examine the results from IVIM fitting.

Preparation of Image Data for Fitting
This is identical to the preparation steps for ADC in Subheading 3.2.1.
1. Retrieve the data to the required folder structure and verify contents.
2. Load image data to matrix structure, aiming to create a 3D matrix of stacked images for each slice (a single slice is presented for simplicity here), with b-value in the third dimension (see Note 10).  Optional steps at this stage include distortion, eddy current, and motion correction, and image registration (see Notes 5 and 13).

Segmented Fitting for Diffusion Coefficient D
This section is largely the same as fitting for ADC in Subheading 3.2.2, with the exception that it is on a subset of the data in order to derive D. The parameter SD is the equivalent of S0 but for the D compartment only, and is used to estimate f in the next section.

Fitting for Pseudodiffusion Coefficient D*
Having estimated D and f using the segmented method above, D* can be estimated by a second fitting process of the residuals after subtracting the calculated signal from the D component. Though not exactly equivalent, it is common to fix the D and f values and perform a least-squares fit only for D* using all the data (see Note 20). These estimates can be sufficient on their own to provide a result, or they can be used as initial estimates for subsequent nonlinear fitting of all the parameters in the IVIM model (see Subheading 3.3.5).
The dependency of IVIM parameters on the specific details of the fitting process is not simple [17], and pseudodiffusion parameters in particular are known to be less repeatable [18]. It is worth reiterating here that DWI acquisition and analysis are closely interwoven, and the utility of derived parameters is ultimately reliant on the acquisition of suitable data.

Least-Squares Fitting for Full IVIM Model
The segmented fitting described above should provide good initial values for a full least-squares fitting, using the same framework. Approximation of f and D* is more challenging than for D (Fig. 4).

Spatial Information and Bayesian Fitting Algorithms
Another class of algorithms that have found promising applications for IVIM data are Bayesian methods that utilize additional information not normally considered in conventional fitting strategies [19,20]. If each voxel is fitted independently, as for the segmented and least-squares approaches outlined above, it is implicitly assumed there is no interrelation between different voxels; in reality, voxels that are either adjacent or within the same tissue (or lesion) are likely to share diffusion and pseudodiffusion characteristics, at least to some degree.
The assumption of spatial similarity can be leveraged against the IVIM model with the view to improving the performance of the fitting, by allowing cross-talk between voxels throughout a series of iterations. These algorithms, by their nature, require many more calculations and so take substantially longer to run; nevertheless, they require no extra data to be acquired and so can be performed retrospectively, and have been shown to produce not only more visually appealing parameter maps but also more meaningful results [17,21].

Validation of Fitting Algorithm
One simple way to validate the fitting procedure is to run (and initially develop) the code on synthetic data, generated using known parameters, and to compare the results [21,22]. A more rigorous validation of the entire pipeline, including data acquisition and transfer, can be performed by scanning a test object with known diffusion parameters [23] using the study protocol.
Curve fitting routines should be able to supply additional output, such as stopping condition and number of iterations used, and these may be useful for troubleshooting, for example identifying where results have hit boundaries or found local minima.

Visualization of Fitted Curves
Generating signal curves using the derived parameters, and comparing against the original data, is a straightforward way of validating results, and allows examination of areas of interest or apparently spurious results (extreme or suspect values commonly arise from partial volume or motion in voxels at tissue boundaries, see Fig. 5). Identification of particular issues may suggest changes to the analysis routine or, in more severe cases, amendments to the analysis or acquisition protocols. In particular for IVIM results, if the underlying pseudodiffusion fraction is limitingly small (or very large, though this is not expected), the parameter D* can take essentially any value without affecting the associated signal curve and thus the quality of the fit. This is an intrinsic problem with the model performance in this region of the parameter space, and cannot be solved by acquiring better data.

Residuals and Systematic Bias
Examining the residuals from the fitting, which are expected to be normally distributed if the model correctly describes the underlying signal, may also highlight bias in the model. Systematic deviation of the residuals over b-values is an indication that the selected signal representation is not optimal, though this does not necessarily preclude it from providing useful parameters (Fig. 6).

Information Criteria and Model Selection
It may become apparent, from examination of the data, that original assumptions made about the applicability of different models may not be valid. Comparisons of different models must take account of the complexity of the model (number of variable parameters) as well as the number of samples, since additional parameters will always provide a better fit if only residual signal is considered.
There are several forms of such measures, the dominant one being the Akaike information criteria (AIC), formulated using the A voxel near the boundary is susceptible to respiratory motion, with some samples coming from within the liver tissue; the ADC from all the data (red curve) is an underestimation compared to excluding images with substantial motion (blue curve). (c) A similar effect is responsible for returning an incorrect curve for a voxel in the renal hilum. Note that exclusion of the same four images would avoid both of these problems, or alternatively registration may ameliorate it to some degree residual sum-of-squares differences between the observed data and the fitted values at those points (RSS) and the number of data points k: The AIC thus gives a numerical value that can be compared across models, with lower (or more negative) values being preferred, although the relationship of the AIC to model validation is not straightforward and is sometimes criticised for being too liberal in favoring overly complex models. Nevertheless, it can often provide evidence for questioning assumptions about suitability. Note that an assessment by AIC indicates only which model is best supported by the data, and is not a validation of the model (Fig. 7). Overfitting the data in (c) gives a visually acceptable curve and comparable residuals to ADC, but returns f ¼ 0.98, D* ¼ 0.0012 mm 2 /s, and D ¼ À0.005 mm 2 /s, which should be flagged as problematic; critical assessment of results should highlight such issues

Covariance and Repeatability
It is critical in quantitative studies to assess the robustness of the derived metrics, and the gold standard for this is to include repeatability studies where the same objects are measured (at least, but commonly only) twice in the same way, and the resulting metrics compared [24]. This is more achievable in preclinical studies, and helps to establish the scale of changes in metrics that can be reliably interpreted as arising from underlying physiological changes. Previous work on the ADC in extracranial cancer has shown it to be generally robust [25], whereas there is less certainty about the repeatability of parameters arising from more complex models [10,18].
Without the benefit of repeated measurements, analyzing the covariance matrix of fitted parameters-that is to say, the extent to which combinations of parameters have the same effect on the fitted curve, can be illuminating. The covariance matrix is a standard output from many fitting routines; high values indicate redundancy between parameters, which in itself is not disqualifying but may indicate a mis-match between the chosen model and the available information in the data.

Final Analysis Quality Check
Critical assessment of DWI results, no less than the principles of good study design, is essential to avoid wasted time and effort, not to mention the animals used for study, in generating meaningless results. Diffusion-weighted imaging is extremely sensitive to spin motion, which is not simple, and the complexity of the diffusion signal curve is compounded by the additional subtleties of modeling and analysis. In general, mistakes arise as a result of incorrect assumptions; a review of such assumptions-including attempting to identify those made unconsciously, for example the role of parameters automatically set by the scanner (see Note 22)-is therefore a vital part of any diffusion analysis protocol.

Notes
1. Location of b-values. For Bruker data, the method file in the experiment directory contains the full acquisition parameter list; this file is human-readable but is best treated as a reference list where b-values can be found by searching for the text "Bval." Export of Bruker data to DICOM varies by software version but may not include the b-value in the export. For DICOM files extracted from clinical scanners, the b-value is normally located in a private field-for example (0019,100c) in Siemens data-and can be accessed using functions such as dicominfo(<DICOM_filename>) with an appropriate dictionary file. NIfTI files do not contain b-value information as standard in their header.
2. Pseudodiffusion, rather than perfusion, is a more accurate name for the volume fraction and coefficient associated with the second compartment of the IVIM model, given that it describes only the phenomenon and avoids physiological inference. Particularly in the kidney, the pseudodiffusion observed may arise from both vascular and tubular structures. Even in tissues without the complication of tubular or ductal structures, the term pseudodiffusion should be used, since the apparent pseudodiffusion fraction is known to be dependent on acquisition parameters [26].

3.
A review of images prior to processing should be performed to ensure that assumptions made about the format and packaging of the data are valid. This includes any naming and/or export order conventions; incorrect assumptions about data presentation and provenance may also introduce errors into results or interfere with smooth processing.
4. Signal-to-noise (SNR) for the relevant region is calculated as the mean of the signal divided by the standard deviation of the background noise signal, found from a comparable region containing only noise (i.e., outside the object). This should be tested at the highest b-values in particular; it is common to require SNR above a suitable threshold (e.g., 5) for inclusion in the calculation, unless a noise contribution is explicitly included in the model. 5. Image registration to account for motion and distortion is a large topic in its own right and there are many strategies available, essentially divided into rigid and non-rigid techniques. It is useful to avoid averaging within the scanner, for example of separate diffusion directions to form trace images, which can lock in motion errors. Prospective motion correction acquisitions (e.g., gating to respiration) may still require motion correction; more efficient sampling with increased averaging alleviates this problem overall, and allows a wider range of processing options [27,28].
6. Conventionally, all parameters except b-value remain constant through the acquisition, and so b-value is the only independent variable. For more complex acquisitions, fitting across several parameters such at TE or Δ are needed [26,29]. For DTI, direction of diffusion-weighting is fitted as well as b-value.
7. An additional quality or "sanity" check is advised after the fitting procedure; invalid assumptions about model applicability or data quality should become apparent either in the resulting values, or from visual inspection of the parameter maps or fitted curves. Resulting values should always be critically assessed and not just accepted.
8. Region of interest definition. Depending on the research question, it may be appropriate to define a region of interest (ROI) based on a calculated parameter map (e.g., ADC) or a representative high-b-value image, or to transfer an ROI from another modality (e.g., DCE). In the latter cases, it is not necessary to perform diffusion modeling over the whole image, which can save considerable computation where more complex models and algorithms are used. In general, calculation of the parameter map across the whole image gives a better visual overview and may reveal features otherwise missed.
9. The definition of regions of interest (ROIs) can be done before or after the model fitting. If done before, the signal through the ROI can be summed (or averaged) and fitted to give a single parameter set to reflect the entire ROI. This approach minimizes the influence of noise, but is predicated on all ROI voxels being the same class of tissue and discards spatial information. Conversely, calculation of entire-image parameter maps can highlight spatial features and help guide to ROI definition. Summary statistics drawn from voxel-wise maps after fitting also discards spatial information, and each voxel fit will be subject to more noise but allows for reporting and analysis of ROI histogram moments. 10. Reading Bruker format data into Matlab is not a standard function; the read_2dseq suggested here is available for download from Mathworks [30]. Another alternative, with more direct equivalents in other programming languages, is to read the file directly: file = fopen('<2dseqFile>', 'r'); data = fread(file, 'int16'); img = reshape(data,imageDim1,imageDim2,nSlices,nBVals); thisSlice = squeeze(img(:,:,sliceNumber,:)); fclose(file); Other platforms are able to read Bruker format directly, or convert to a more accessible format (e.g., NIfTI).
11. The order of b-values is irrelevant for the fitting, but it is convention to handle them in a consistent (usually ascending) order. If the b-values are known but without assignation to specific images, the correct assignment can be inferred from the overall image signal intensity if there is sufficient change in contrast between successive images. b-value magnitude cannot be inferred from the images if the values are not recorded.
12. b-values are usually specified as nominal values entered on the console (e.g., 100 s/mm 2 ) but, in reality, are modified by the use of the imaging readout gradients themselves (which, like the diffusion-encoding gradients pulses, have both magnitude and direction). It is more correct to use the full b-value matrix in the fitting [31], although the imaging gradient contributions are often considered small (e.g., "100" ¼ 105 s/mm 2 ).
13. Registration and/or motion correction can be applied within the diffusion series, or to a separate reference image (e.g., T2w). Distortion correction from eddy currents in EPI images can also be ameliorated by registration to T2w images, or by using phase reversed image pairs if acquired [32].
14. The S0 maps from ADC and IVIM fitting are expected to be qualitatively similar to the b ¼ 0 s/mm 2 images (for DWI acquisitions with two b-values they are equivalent) and are often not considered to be interesting. Nevertheless, the S0 map is generated using all data and thus may have less influence from confounding factors (noise, distortion, etc.) and may highlight issues arising from the fitting process.
15. When using custom fitting routines, certain programming practices such as memory preallocation can save substantial computation time and are worth the extra investment of effort. Full optimization of code is a much larger task, and will give diminishing returns beyond a certain level. 16. Division by zero, for example in voxels outside the object (and which are not of interest), may result in infinities or errors that halt the routine. These can be excluded from the fitting loop, assigned an arbitrary default value, or values in Sb can be incremented to an arbitrary small value (e.g., 1) that will not appreciably affect the outcome. Sb = 1 + img(i,j,:); 17. Normalization of signal data to the b ¼ 0 s/mm 2 value is not necessary, and may introduce inaccuracy if the observed signal value at b ¼ 0 s/mm 2 is not representative of the underlying S0 (e.g., in the presence of appreciable perfusion).
18. Imposing limits on fitted variables, perhaps to physiological or physical, is possible in many fitting algorithms. One potential pitfall with this approach is if limit values returned from a failed fitting are treated as legitimate (i.e., converged) values, they may bias summary measures. This is an easy oversight if summary statistics are taken and parameter maps/histograms are not examined. 19. Matrix inversion is an efficient implementation of linear regression (using the log signal). The whole image can be used at once, although since the 3D data matrix is reshaped for the calculation, care must be taken to reconstruct the resulting maps with the correct dimensions. si = size(img); dataVect = reshape(img+1,(si(1)*si (2)),si (3)

20.
Segmented fitting for D* can take many flavors, essentially revolving around which parameters are allowed to be free and which are fixed. For example in this implementation, f is already fixed but could be recalculated following fitting for SDs. The use of the segmented method as initialization for a full least-squares fitting is an iterative process and can minimize the influence of noise in the b ¼ 0 s/mm 2 image, and uncertainty in choosing a suitable Bcut threshold [33].
21. One major need in the IVIM community is the standardization of terminology, including the exact formulation of the model, and even the parameter symbols. This article uses D* to denote pseudodiffusion coefficient, but owing to the use of the asterisk in Matlab to denote the product, D* is written Ds in the code.
22. The effect of diffusion time (delay between the gradientencoding pulses, Δ) is yet to be fully described, although it is known to influence IVIM parameters in a similar way to echo time, TE [26,29]. It is thus important to fix, record, and report this during acquisition, similar to TE. Open Access This chapter is licensed under the terms of the Creative Commons Attribution 4.0 International License (http://creativecommons.org/licenses/by/4.0/), which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons license and indicate if changes were made. The images or other third party material in this chapter are included in the chapter's Creative Commons license, unless indicated otherwise in a credit line to the material. If material is not included in the chapter's Creative Commons license and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder.