Package generic_fns :: Module diffusion_tensor :: Class Diffusion_tensor
[hide private]
[frames] | no frames]

Class Diffusion_tensor

source code

Instance Methods [hide private]
 
__init__(self, relax)
Class containing the function for setting up the diffusion tensor.
source code
 
copy(self, run1=None, run2=None)
Function for copying diffusion tensor data from run1 to run2.
source code
 
data_names(self)
Function for returning a list of names of data structures associated with the sequence.
source code
 
default_value(self, param)
Diffusion tensor parameter default values ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
source code
 
delete(self, run=None)
Function for deleting diffusion tensor data.
source code
 
display(self, run=None)
Function for displaying the diffusion tensor.
source code
 
ellipsoid(self)
Function for setting up ellipsoidal diffusion.
source code
 
fold_angles(self, run=None, sim_index=None)
Wrap the Euler or spherical angles and remove the glide reflection and translational symmetries.
source code
 
init(self, run=None, params=None, time_scale=1.0, d_scale=1.0, angle_units='deg', param_types=0, spheroid_type=None, fixed=1)
Function for initialising the diffusion tensor.
source code
 
map_bounds(self, run, param)
The function for creating bounds for the mapping function.
source code
 
map_labels(self, run, index, params, bounds, swap, inc)
Function for creating labels, tick locations, and tick values for an OpenDX map.
source code
 
return_conversion_factor(self, param)
Function for returning the factor of conversion between different parameter units.
source code
 
return_data_name(self, name)
Diffusion tensor parameter string matching patterns ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
source code
 
return_eigenvalues(self, run=None)
Function for returning Dx, Dy, and Dz.
source code
 
return_units(self, param)
Function for returning a string representing the parameters units.
source code
 
set(self, run=None, value=None, param=None)
Diffusion tensor set details ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
source code
 
sphere(self)
Function for setting up spherical diffusion.
source code
 
spheroid(self)
Function for setting up spheroidal diffusion.
source code
 
test_params(self, num_params)
Function for testing the validity of the input parameters.
source code
 
unit_axes(self)
Function for calculating the unit axes of the diffusion tensor.
source code
Method Details [hide private]

default_value(self, param)

source code 

Diffusion tensor parameter default values
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

________________________________________________________________________
|                        |                    |                        |
| Data type              | Object name        | Value                  |
|________________________|____________________|________________________|
|                        |                    |                        |
| tm                     | 'tm'               | 10 * 1e-9              |
|                        |                    |                        |
| Diso                   | 'Diso'             | 1.666 * 1e7            |
|                        |                    |                        |
| Da                     | 'Da'               | 0.0                    |
|                        |                    |                        |
| Dr                     | 'Dr'               | 0.0                    |
|                        |                    |                        |
| Dx                     | 'Dx'               | 1.666 * 1e7            |
|                        |                    |                        |
| Dy                     | 'Dy'               | 1.666 * 1e7            |
|                        |                    |                        |
| Dz                     | 'Dz'               | 1.666 * 1e7            |
|                        |                    |                        |
| Dpar                   | 'Dpar'             | 1.666 * 1e7            |
|                        |                    |                        |
| Dper                   | 'Dper'             | 1.666 * 1e7            |
|                        |                    |                        |
| Dratio                 | 'Dratio'           | 1.0                    |
|                        |                    |                        |
| alpha                  | 'alpha'            | 0.0                    |
|                        |                    |                        |
| beta                   | 'beta'             | 0.0                    |
|                        |                    |                        |
| gamma                  | 'gamma'            | 0.0                    |
|                        |                    |                        |
| theta                  | 'theta'            | 0.0                    |
|                        |                    |                        |
| phi                    | 'phi'              | 0.0                    |
|________________________|____________________|________________________|

fold_angles(self, run=None, sim_index=None)

source code 
Wrap the Euler or spherical angles and remove the glide reflection and translational symmetries.

Wrap the angles such that

    0 <= theta <= pi,
    0 <= phi <= 2pi,

and

    0 <= alpha <= 2pi,
    0 <= beta <= pi,
    0 <= gamma <= 2pi.


For the simulated values, the angles are wrapped as

    theta - pi/2 <= theta_sim <= theta + pi/2
    phi - pi <= phi_sim <= phi + pi

and

    alpha - pi <= alpha_sim <= alpha + pi
    beta - pi/2 <= beta_sim <= beta + pi/2
    gamma - pi <= gamma_sim <= gamma + pi

return_conversion_factor(self, param)

source code 

Function for returning the factor of conversion between different parameter units.

For example, the internal representation of tm is in seconds, whereas the external representation is in nanoseconds, therefore this function will return 1e-9 for tm.

return_data_name(self, name)

source code 

Diffusion tensor parameter string matching patterns
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

____________________________________________________________________________________________
|                                                        |              |                  |
| Data type                                              | Object name  | Patterns         |
|________________________________________________________|______________|__________________|
|                                                        |              |                  |
| Global correlation time - tm                           | 'tm'         | '^tm$'           |
|                                                        |              |                  |
| Isotropic component of the diffusion tensor - Diso     | 'Diso'       | '[Dd]iso'        |
|                                                        |              |                  |
| Anisotropic component of the diffusion tensor - Da     | 'Da'         | '[Dd]a'          |
|                                                        |              |                  |
| Rhombic component of the diffusion tensor - Dr         | 'Dr'         | '[Dd]r$'         |
|                                                        |              |                  |
| Eigenvalue associated with the x-axis of the diffusion | 'Dx'         | '[Dd]x'          |
| diffusion tensor - Dx                                  |              |                  |
|                                                        |              |                  |
| Eigenvalue associated with the y-axis of the diffusion | 'Dy'         | '[Dd]y'          |
| diffusion tensor - Dy                                  |              |                  |
|                                                        |              |                  |
| Eigenvalue associated with the z-axis of the diffusion | 'Dz'         | '[Dd]z'          |
| diffusion tensor - Dz                                  |              |                  |
|                                                        |              |                  |
| Diffusion coefficient parallel to the major axis of    | 'Dpar'       | '[Dd]par'        |
| the spheroid diffusion tensor - Dpar                   |              |                  |
|                                                        |              |                  |
| Diffusion coefficient perpendicular to the major axis  | 'Dper'       | '[Dd]per'        |
| of the spheroid diffusion tensor - Dper                |              |                  |
|                                                        |              |                  |
| Ratio of the parallel and perpendicular components of  | 'Dratio'     | '[Dd]ratio'      |
| the spheroid diffusion tensor - Dratio                 |              |                  |
|                                                        |              |                  |
| The first Euler angle of the ellipsoid diffusion       | 'alpha'      | '^a$' or 'alpha' |
| tensor - alpha                                         |              |                  |
|                                                        |              |                  |
| The second Euler angle of the ellipsoid diffusion      | 'beta'       | '^b$' or 'beta'  |
| tensor - beta                                          |              |                  |
|                                                        |              |                  |
| The third Euler angle of the ellipsoid diffusion       | 'gamma'      | '^g$' or 'gamma' |
| tensor - gamma                                         |              |                  |
|                                                        |              |                  |
| The polar angle defining the major axis of the         | 'theta'      | 'theta'          |
| spheroid diffusion tensor - theta                      |              |                  |
|                                                        |              |                  |
| The azimuthal angle defining the major axis of the     | 'phi'        | 'phi'            |
| spheroid diffusion tensor - phi                        |              |                  |
|________________________________________________________|______________|__________________|

return_units(self, param)

source code 

Function for returning a string representing the parameters units.

For example, the internal representation of tm is in seconds, whereas the external representation is in nanoseconds, therefore this function will return the string 'nanoseconds' for tm.

set(self, run=None, value=None, param=None)

source code 

Diffusion tensor set details
~~~~~~~~~~~~~~~~~~~~~~~~~~~~

If the diffusion tensor has not been setup, use the more powerful function
'diffusion_tensor.init' to initialise the tensor parameters.

The diffusion tensor parameters can only be set when the run corresponds to model-free
analysis.  The units of the parameters are:

    Inverse seconds for tm.
    Seconds for Diso, Da, Dx, Dy, Dz, Dpar, Dper.
    Unitless for Dratio and Dr.
    Radians for all angles (alpha, beta, gamma, theta, phi).


When setting a diffusion tensor parameter, the residue number has no effect.  As the
internal parameters of spherical diffusion are {tm}, spheroidal diffusion are {tm, Da,
theta, phi}, and ellipsoidal diffusion are {tm, Da, Dr, alpha, beta, gamma}, supplying
geometric parameters must be done in the following way.  If a single geometric parameter is
supplied, it must be one of tm, Diso, Da, Dr, or Dratio.  For the parameters Dpar, Dper, Dx,
Dy, and Dx, it is not possible to determine how to use the currently set values together
with the supplied value to calculate the new internal parameters.  For spheroidal diffusion,
when supplying multiple geometric parameters, the set must belong to one of

    {tm, Da},
    {Diso, Da},
    {tm, Dratio},
    {Dpar, Dper},
    {Diso, Dratio},

where either theta, phi, or both orientational parameters can be additionally supplied.  For
ellipsoidal diffusion, again when supplying multiple geometric parameters, the set must
belong to one of

    {tm, Da, Dr},
    {Diso, Da, Dr},
    {Dx, Dy, Dz},

where any number of the orientational parameters, alpha, beta, or gamma can be additionally
supplied.

unit_axes(self)

source code 
Function for calculating the unit axes of the diffusion tensor.

Spheroid
~~~~~~~~

The unit Dpar vector is

             | sin(theta) * cos(phi) |
    Dpar  =  | sin(theta) * sin(phi) |
             |      cos(theta)       |


Ellipsoid
~~~~~~~~~

The unit Dx vector is

           | -sin(alpha) * sin(gamma) + cos(alpha) * cos(beta) * cos(gamma) |
    Dx  =  | -sin(alpha) * cos(gamma) - cos(alpha) * cos(beta) * sin(gamma) |
           |                    cos(alpha) * sin(beta)                      |

The unit Dy vector is

           | cos(alpha) * sin(gamma) + sin(alpha) * cos(beta) * cos(gamma) |
    Dy  =  | cos(alpha) * cos(gamma) - sin(alpha) * cos(beta) * sin(gamma) |
           |                   sin(alpha) * sin(beta)                      |

The unit Dz vector is

           | -sin(beta) * cos(gamma) |
    Dz  =  |  sin(beta) * sin(gamma) |
           |        cos(beta)        |