#include "ksscan.h"
Data Structures | |
struct | KSDIFF_CONTROL_DESIGN |
struct | KSDIFF_CONTROL |
Macros | |
#define | KSDIFF_MAX_SCHEME_LENGTH 512 |
#define | KSDIFF_MAXBVALS 10 |
#define | KSDIFF_INIT_SCHEME {{0,0,0}} |
#define | KSDIFF_INIT_CONTROL_DESIGN {1, 0, KSDIFF_LOGICAL, KSDIFF_CUBOID, KS_MAT3x3_IDENTITY, 0, {0}, {0}} |
#define | KSDIFF_INIT_CONTROL {1, 0, 0, 0, {0}, {0}, KSDIFF_INIT_SCHEME, 0.0, {0}, {0}} |
Typedefs | |
typedef float | KSDIFF_SCHEME[KSDIFF_MAX_SCHEME_LENGTH][3] |
Enumerations | |
enum | ksdiff_coordinate_system { KSDIFF_LOGICAL, KSDIFF_PHYSICAL } |
enum | ksdiff_physical_bound_type { KSDIFF_ISO, KSDIFF_CUBOID } |
Functions | |
STATUS | ksdiff_eval_design (KSDIFF_CONTROL *diff_control, const KSDIFF_CONTROL_DESIGN *design) |
s64 | ksdiff_schemeloop (const KSDIFF_CONTROL *diff_control, const KSSCAN_LOOP_CONTROL *loop_control, KS_DYNAMIC_STATE *dynamic, KS_CORESLICETIME coreslice(const SCAN_INFO *slice_pos, KS_DYNAMIC_STATE *dynamic)) |
void | ksdiff_plotloop (const KSDIFF_CONTROL *diff_control, KS_CORESLICETIME coreslice(const SCAN_INFO *slice_pos, KS_DYNAMIC_STATE *dynamic), const SCAN_INFO *scan_info) |
#define KSDIFF_MAX_SCHEME_LENGTH 512 |
Maximum 512 diffusion directions
#define KSDIFF_MAXBVALS 10 |
10 different b-values > 0
#define KSDIFF_INIT_SCHEME {{0,0,0}} |
#define KSDIFF_INIT_CONTROL_DESIGN {1, 0, KSDIFF_LOGICAL, KSDIFF_CUBOID, KS_MAT3x3_IDENTITY, 0, {0}, {0}} |
#define KSDIFF_INIT_CONTROL {1, 0, 0, 0, {0}, {0}, KSDIFF_INIT_SCHEME, 0.0, {0}, {0}} |
typedef float KSDIFF_SCHEME[KSDIFF_MAX_SCHEME_LENGTH][3] |
2D matrix holding the b0 volumes followed by diffusion directions
STATUS ksdiff_eval_design | ( | KSDIFF_CONTROL * | diff_control, |
const KSDIFF_CONTROL_DESIGN * | design | ||
) |
This function computes the scaling factors needed for the desired diffusion scheme to be executed taking into accout the limits of the gradient system according to design->physical_bound_type. The actual shape and timing of the diffusion gradients are not needed to be known, in fact, this function must be called before setting up the module that includes the diffusion gradients. In particular diff_control->bvalue and diff_control->max_magnitude_amp are to be used as inputs to design the diffusion gradients (see below for an example). Additionally, diff_control->RMS_amp_scale and diff_control->max_power_amp_scale are to be used for setting the diffusion gradients scaling factors for gradient heating calculations for average and maximum power respectively.
NOTE* that it is assumed that the diffusion gradients are generated with a maximum amplitude equal for each board equal to that board's maximum amplitude, possibly scaled down by a common factor. Each board's mximum amplitude is stored in tx, ty and tz from loggrd. In particular, one waveform (trapezoid or wave) per board is needed since those values are not necessarily equal. Specifically, the maximum amplitude of the diffusion gradients on the X logical board should be equal to alpha*loggrd.tx where alpha is a scaling factor (0 < alpha <= 1). Similarly, the maximum amplitude of the diffusion gradients on the Y and Z logical boards should be equal to alpha*loggrd.ty and alpha*loggrd.tz respectively.
For instance, in the case of standard diffusion gradients, the maximum amplitude is achieved during the plateau of the trapezoids. In order to design the shape of those trapezoids, a ramp time must be chosen first. If in doubt ks_syslimits_ramptimemax(loggrd) is always feasible as it represents the time for the slowest board to reach its maximum amplitude. Then the plateau time and the time separation between the two trapezoids should be chosen so that a plateau amplitude equal to alpha*diff_control->max_magnitude_amp results in a b-value equal to diff_control->bvalue. Finally, the actual trapezoids for the X, Y and Z boards need to be generated with a plateau amplitude equal to alpha*loggrd.tx, alpha*loggrd.ty and alpha*loggrd.tz respectively.
[out] | diff_control | |
[in] | design |
s64 ksdiff_schemeloop | ( | const KSDIFF_CONTROL * | diff_control, |
const KSSCAN_LOOP_CONTROL * | loop_control, | ||
KS_DYNAMIC_STATE * | dynamic, | ||
KS_CORESLICETIME | coresliceconst SCAN_INFO *slice_pos, KS_DYNAMIC_STATE *dynamic | ||
) |
The index dynamic->vol is incremented for each b0 and each diffusion volumes. This corresponds to a total number of sampled volumes equal to nb0 + numbvals*ndirs for each invocation of ksdiff_schemeloop.
Note that dynamic->vol is not reset to zero so that, if the diffusion scheme is repeated, all volumes have different index.
[in] | diff_control | |
[in] | loop_control | |
[in,out] | dynamic | |
[in] | coreslice |
void ksdiff_plotloop | ( | const KSDIFF_CONTROL * | diff_control, |
KS_CORESLICETIME | coresliceconst SCAN_INFO *slice_pos, KS_DYNAMIC_STATE *dynamic, | ||
const SCAN_INFO * | scan_info | ||
) |
All loops other than the one over all diffusion directions are collapsed.
[in] | diff_control | |
[in] | coreslice | |
[in] | scan_info | Optional slice position, can be NULL |