Make m012 diffusion gradient definition more flexible
Right now, the timing is fixed inside cmrseq.seqedefs.diffusion.m012
. I propose to change the signature of this function to specify the rise time and flat duration of the first lobe, as all times are deducible from there. Furthermore either amplitude or b-value should be given to determine the maximal gradient. An ValueError should be raised if the resulting max gradient is too high.
As it is the usual thing to instantiate multiple diffusion waveforms at once, the method should take a sequence of (b-value/amplitude, direction) pairs and return a list of cmrseq.Sequences
if the sequence is longer than 1 element.
Additionally, It might be usefull to automatically determine the shortest possible waveform for a given maximal b-value for the specified system constraints.
In order to cleanly implement this I suggest following steps:
-
Add private function to evaluate the b-value analytically -
Add function to utils
to numerically evaluate the b-value -
Change m012
signature as described -
Add method to solve optimization problem