diff --git a/dipy/align/_public.py b/dipy/align/_public.py index bc6903fdc6..95dd5b853e 100644 --- a/dipy/align/_public.py +++ b/dipy/align/_public.py @@ -212,10 +212,13 @@ def register_dwi_to_template( Returns ------- - warped_b0, mapping: The fist is an array with the b0 volume warped to the - template. If reg_method is "syn", the second is a DiffeomorphicMap class - instance that can be used to transform between the two spaces. Otherwise, - if reg_method is "aff", this is a 4x4 matrix encoding the affine transform. + warped_b0 : ndarray + b0 volume warped to the template. + mapping : DiffeomorphicMap or ndarray + If reg_method is "syn", a DiffeomorphicMap class instance that can be + used to transform between the two spaces. Otherwise, if reg_method is + "aff", a 4x4 matrix encoding the affine transform. + Notes ----- diff --git a/dipy/align/imaffine.py b/dipy/align/imaffine.py index bff198d07a..1f3b74e280 100644 --- a/dipy/align/imaffine.py +++ b/dipy/align/imaffine.py @@ -110,7 +110,7 @@ def __init__( sampling information needs to be specified each time the `transform` or `transform_inverse` is called to transform images. Note that such sampling information is not necessary to transform points defined in - physical space, such as stream lines. + physical space, such as streamlines. Parameters ---------- @@ -429,9 +429,9 @@ def transform( Returns ------- - transformed : array, shape `sampling_grid_shape` or - `self.codomain_shape` - the transformed image, sampled at the requested grid + transformed : array + the transformed image, sampled at the requested grid, with shape + `sampling_grid_shape` or `self.codomain_shape`. """ transformed = self._apply_transform( @@ -490,9 +490,9 @@ def transform_inverse( Returns ------- - transformed : array, shape `sampling_grid_shape` or - `self.codomain_shape` - the transformed image, sampled at the requested grid + transformed : array + the transformed image, sampled at the requested grid, with shape + `sampling_grid_shape` or `self.codomain_shape`. """ transformed = self._apply_transform( diff --git a/dipy/align/streamlinear.py b/dipy/align/streamlinear.py index d91dac4e2e..37f0897b58 100644 --- a/dipy/align/streamlinear.py +++ b/dipy/align/streamlinear.py @@ -329,10 +329,10 @@ def __init__( If 1D array with: a) 6 elements then only rigid registration is performed with - the 3 first elements for translation and 3 for rotation. + the 3 first elements for translation and 3 for rotation. b) 7 elements also isotropic scaling is performed (similarity). c) 12 elements then translation, rotation (in degrees), - scaling and shearing is performed (affine). + scaling and shearing is performed (affine). Here is an example of x0 with 12 elements: ``x0=np.array([0, 10, 0, 40, 0, 0, 2., 1.5, 1, 0.1, -0.5, 0])`` diff --git a/dipy/reconst/cti.py b/dipy/reconst/cti.py index 9791b19308..04213a2bb0 100644 --- a/dipy/reconst/cti.py +++ b/dipy/reconst/cti.py @@ -111,7 +111,7 @@ def split_cti_params(cti_params): 1. Three diffusion tensor's eigenvalues 2. Three lines of the eigenvector matrix each containing the - first, second and third coordinates of the eigenvector + first, second and third coordinates of the eigenvector 3. Fifteen elements of the kurtosis tensor 4. Twenty-One elements of the covariance tensor diff --git a/dipy/reconst/dki.py b/dipy/reconst/dki.py index 18f2a23288..4e968dc66b 100644 --- a/dipy/reconst/dki.py +++ b/dipy/reconst/dki.py @@ -1756,12 +1756,12 @@ def __init__(self, gtab, fit_method="WLS", return_S0_hat=False, *args, **kwargs) fit_method : str or callable, optional str be one of the following: - - 'OLS' or 'ULLS' for ordinary least squares. - - 'WLS', 'WLLS' or 'UWLLS' for weighted ordinary least squares. - See func:`dki.ls_fit_dki`. - - 'CLS' for LMI constrained ordinary least squares [3]_. - - 'CWLS' for LMI constrained weighted least squares [3]_. - See func:`dki.cls_fit_dki`. + - 'OLS' or 'ULLS' for ordinary least squares. + - 'WLS', 'WLLS' or 'UWLLS' for weighted ordinary least squares. + See func:`dki.ls_fit_dki`. + - 'CLS' for LMI constrained ordinary least squares [3]_. + - 'CWLS' for LMI constrained weighted least squares + [3]_. See func:`dki.cls_fit_dki`. callable has to have the signature: ``fit_method(design_matrix, data, *args, **kwargs)`` @@ -1958,7 +1958,7 @@ def predict(self, dki_params, S0=1.0): 1. Three diffusion tensor's eigenvalues 2. Three lines of the eigenvector matrix each containing the - first, second and third coordinates of the eigenvector + first, second and third coordinates of the eigenvector 3. Fifteen elements of the kurtosis tensor S0 : float or ndarray (optional) diff --git a/dipy/reconst/fwdti.py b/dipy/reconst/fwdti.py index 7f188effaf..0f24950c23 100644 --- a/dipy/reconst/fwdti.py +++ b/dipy/reconst/fwdti.py @@ -255,7 +255,7 @@ def wls_iter( Value of the free water isotropic diffusion. Default is set to 3e-3 $mm^{2}.s^{-1}$. Please adjust this value if you are assuming different units of diffusion. - mdreg : float, optimal + mdreg : float, optimal DTI's mean diffusivity regularization threshold. If standard DTI diffusion tensor's mean diffusivity is almost near the free water diffusion value, the diffusion signal is assumed to be only free water @@ -271,12 +271,15 @@ def wls_iter( Returns ------- - All parameters estimated from the free water tensor model. - Parameters are ordered as follows: - 1) Three diffusion tensor's eigenvalues - 2) Three lines of the eigenvector matrix each containing the - first, second and third coordinates of the eigenvector - 3) The volume fraction of the free water compartment + fw_params : ndarray + All parameters estimated from the free water tensor model. Parameters + are ordered as follows: + + 1) Three diffusion tensor's eigenvalues + 2) Three lines of the eigenvector matrix each containing the + first, second and third coordinates of the eigenvector + 3) The volume fraction of the free water compartment + """ W = design_matrix @@ -314,7 +317,7 @@ def wls_iter( FS, SI = np.meshgrid(fs, sig) SA = SI - FS * S0 * SFW.T # SA < 0 means that the signal components from the free water - # component is larger than the total fiber. This cases are present + # component is larger than the total fiber. These cases are present # for inappropriate large volume fractions (given the current S0 # value estimated). To overcome this issue negative SA are replaced # by data's min positive signal. @@ -382,6 +385,7 @@ def wls_fit_tensor( fw_params : ndarray (x, y, z, 13) Matrix containing in the last dimension the free water model parameters in the following order: + 1) Three diffusion tensor's eigenvalues 2) Three lines of the eigenvector matrix each containing the first, second and third coordinates of the eigenvector @@ -782,6 +786,7 @@ def nls_fit_tensor( fw_params : ndarray (x, y, z, 13) Matrix containing in the dimension the free water model parameters in the following order: + 1) Three diffusion tensor's eigenvalues 2) Three lines of the eigenvector matrix each containing the first, second and third coordinates of the eigenvector diff --git a/dipy/reconst/qti.py b/dipy/reconst/qti.py index 9dffad4030..4b38e16904 100644 --- a/dipy/reconst/qti.py +++ b/dipy/reconst/qti.py @@ -722,13 +722,12 @@ def __init__(self, gtab, fit_method="WLS", cvxpy_solver="SCS"): Gradient table with b-tensors. fit_method : str, optional Must be one of the following: - 'OLS' for ordinary least squares - :func:`qti._ols_fit` - 'WLS' for weighted least squares - :func:`qti._wls_fit` - 'SDPDc' for semidefinite programming with positivity - constraints applied [2]_ - :func:`qti._sdpdc_fit` + + - 'OLS' for ordinary least squares :func:`qti._ols_fit` + - 'WLS' for weighted least squares :func:`qti._wls_fit` + - 'SDPDc' for semidefinite programming with positivity constraints + applied [2]_ :func:`qti._sdpdc_fit` + cvxpy_solver: str, optionals solver for the SDP formulation. default: 'SCS' diff --git a/dipy/segment/bundles.py b/dipy/segment/bundles.py index dff54c4b56..1dff8bca03 100644 --- a/dipy/segment/bundles.py +++ b/dipy/segment/bundles.py @@ -407,12 +407,12 @@ def recognize( b) "similarity" ``x0 = np.array([0, 0, 0, 0, 0, 0, 1.])`` c) "affine" - ``x0 = np.array([0, 0, 0, 0, 0, 0, 1., 1., 1, 0, 0, 0]) - (default None) + ``x0 = np.array([0, 0, 0, 0, 0, 0, 1., 1., 1, 0, 0, 0])`` + slr_bounds : array, optional - (default None) + SLR bounds. slr_select : tuple, optional - Select the number of streamlines from model to neirborhood of + Select the number of streamlines from model to neighborhood of model to perform the local SLR. slr_method : string, optional Optimization method 'L_BFGS_B' or 'Powell' optimizers can be used. @@ -530,10 +530,10 @@ def refine( If 1D array with: a) 6 elements then only rigid registration is performed with - the 3 first elements for translation and 3 for rotation. + the 3 first elements for translation and 3 for rotation. b) 7 elements also isotropic scaling is performed (similarity). c) 12 elements then translation, rotation (in degrees), - scaling and shearing are performed (affine). + scaling and shearing are performed (affine). Here is an example of x0 with 12 elements: ``x0=np.array([0, 10, 0, 40, 0, 0, 2., 1.5, 1, 0.1, -0.5, 0])``