Skip to content

Commit

Permalink
added __all__ to all python files
Browse files Browse the repository at this point in the history
  • Loading branch information
rutgerfick committed Feb 2, 2018
1 parent 2836435 commit ded63fa
Show file tree
Hide file tree
Showing 19 changed files with 142 additions and 3 deletions.
5 changes: 5 additions & 0 deletions dmipy/core/fitted_modeling_framework.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@
estimate_spherical_mean_multi_shell)


__all__ = [
'FittedMultiCompartmentModel'
]


class FittedMultiCompartmentModel:
"""
The FittedMultiCompartmentModel instance contains information about the
Expand Down
10 changes: 10 additions & 0 deletions dmipy/core/gradient_conversions.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,16 @@
from .constants import CONSTANTS


__all__ = [
'q_from_b',
'b_from_q',
'q_from_g',
'g_from_q',
'b_from_g',
'g_from_b'
]


def q_from_b(
b, delta, Delta
):
Expand Down
9 changes: 9 additions & 0 deletions dmipy/core/modeling_framework.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,17 @@
'dmipy', 'signal_models'
)

__all__ = [
'ModelProperties',
'MultiCompartmentModelProperties',
'MultiCompartmentModel',
'homogenize_x0_to_data',
'ReturnFixedValue'
]


class ModelProperties:
"Contains various properties for CompartmentModels."
@property
def parameter_ranges(self):
"""Returns the optimization ranges of the model parameters.
Expand Down
12 changes: 9 additions & 3 deletions dmipy/data/saved_acquisition_schemes.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,14 @@
)


__all__ = [
'wu_minn_hcp_acquisition_scheme',
'duval_cat_spinal_cord_2d_acquisition_scheme'
]


def wu_minn_hcp_acquisition_scheme():
"Returns DmipyAcquisitionScheme of Wu-Minn HCP project."
_bvals = np.loadtxt(
join(_GRADIENT_TABLES_PATH,
'bvals_hcp_wu_minn.txt')
Expand All @@ -28,7 +35,8 @@ def wu_minn_hcp_acquisition_scheme():
_bvals, _gradient_directions, _delta, _Delta)


def duval_cat_spinal_cord_2d_acquisition_scheme():
def duval_cat_spinal_cord_2d_acquisition_scheme(bval_shell_distance=1e10):
"Returns DmipyAcquisitionScheme of cat spinal cord data."
scheme_name = 'tanguy_cat_spinal_cord/2D_qspace.scheme'
scheme = np.loadtxt(DATA_PATH + scheme_name, skiprows=3)

Expand All @@ -39,7 +47,5 @@ def duval_cat_spinal_cord_2d_acquisition_scheme():
delta = scheme[:, 5]
TE = scheme[:, 6]

bval_shell_distance = 1e10

return acquisition_scheme_from_gradient_strengths(
G, bvecs, delta, Delta, TE, min_b_shell_distance=bval_shell_distance)
11 changes: 11 additions & 0 deletions dmipy/data/saved_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,17 @@
'dmipy', 'data'
)

__all__ = [
'wu_minn_hcp_coronal_slice',
'duval_cat_spinal_cord_2d',
'synthetic_camino_data_parallel',
'synthetic_camino_data_dispersed',
'visualize_correlation_camino_and_estimated_fractions'
]


def wu_minn_hcp_coronal_slice():
"Returns example slice of Wu-Minn HCP data subject 100307."
data_path = join(
DATA_PATH, 'hcp', 'hcp_example_slice', 'coronal_slice.nii.gz')
try:
Expand All @@ -36,6 +45,7 @@ def wu_minn_hcp_coronal_slice():


def duval_cat_spinal_cord_2d():
"Returns 2D multi-diffusion time AxCaliber data of cat spinal cord."
msg = "This data was used by Duval et al. 'Validation of quantitative MRI "
msg += "metrics using full slice histology with automatic axon "
msg += "segmentation', ISMRM 2016. Reference at "
Expand Down Expand Up @@ -163,6 +173,7 @@ def __init__(self):

def visualize_correlation_camino_and_estimated_fractions(
estim_fractions_parallel, estim_fractions_dispersed):
"Function that visualizes Camino estimated results versus ground truth."

data_parallel = synthetic_camino_data_parallel()
data_dispersed = synthetic_camino_data_dispersed()
Expand Down
8 changes: 8 additions & 0 deletions dmipy/distributions/distribute_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,14 @@
import copy
import numpy as np

__all__ = [
'DistributedModel',
'SD1WatsonDistributed',
'SD2BinghamDistributed',
'DD1GammaDistributed',
'ReturnFixedValue'
]


class DistributedModel:
"Contains various properties of distributed models."
Expand Down
9 changes: 9 additions & 0 deletions dmipy/distributions/distributions.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,15 @@
}
BETA_SCALING = 1e-6

__all__ = [
'get_sh_order_from_odi',
'SD1Watson',
'SD2Bingham',
'DD1GammaDistribution',
'odi2kappa',
'kappa2odi'
]


def get_sh_order_from_odi(odi):
"Returns minimum sh_order to estimate spherical harmonics for given odi."
Expand Down
4 changes: 4 additions & 0 deletions dmipy/hcp_interface/downloader_aws.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@
'dmipy', 'data'
)

__all__ = [
'HCPInterface'
]


class HCPInterface:
"""
Expand Down
8 changes: 8 additions & 0 deletions dmipy/optimizers/brute2fine.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,14 @@
'dmipy', 'data/spheres'
)

__all__ = [
'GlobalBruteOptimizer',
'Brute2FineOptimizer',
'nested_to_normalized_fractions',
'normalized_to_nested_fractions_array',
'find_minimum_argument'
]


class GlobalBruteOptimizer:
r"""
Expand Down
7 changes: 7 additions & 0 deletions dmipy/optimizers/mix.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
import numpy as np
from scipy.optimize import differential_evolution, minimize, fmin_cobyla

__all__ = [
'MixOptimizer',
'nested_to_normalized_fractions',
'cobyla_positivity_constraint',
'cobyla_unity_constraint'
]


class MixOptimizer:
""" The stochastic Microstructure In Crossings (MIX) optimizer [1] uses a
Expand Down
4 changes: 4 additions & 0 deletions dmipy/signal_models/capped_cylinder_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
from ..core.constants import CONSTANTS
import numpy as np

__all__ = [
'CC3CappedCylinderCallaghanApproximation',
]


class CC3CappedCylinderCallaghanApproximation(ModelProperties):
r""" The Callaghan model [1]_ - a cylinder with finite radius - for
Expand Down
8 changes: 8 additions & 0 deletions dmipy/signal_models/cylinder_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,14 @@
A_SCALING = 1e-12


__all__ = [
'C1Stick',
'C2CylinderSodermanApproximation',
'C3CylinderCallaghanApproximation',
'C4CylinderGaussianPhaseApproximation'
]


class C1Stick(ModelProperties):
r""" The Stick model [1]_ - a cylinder with zero radius - typically used
for intra-axonal diffusion.
Expand Down
6 changes: 6 additions & 0 deletions dmipy/signal_models/gaussian_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,12 @@
DIFFUSIVITY_SCALING = 1e-9
A_SCALING = 1e-12

__all__ = [
'G1Ball',
'G2Zeppelin',
'G3RestrictedZeppelin'
]


class G1Ball(ModelProperties):
r""" The Ball model [1]_ - an isotropic Tensor with one diffusivity.
Expand Down
5 changes: 5 additions & 0 deletions dmipy/signal_models/plane_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@
DIAMETER_SCALING = 1e-6


__all__ = [
'P3PlaneCallaghanApproximation'
]


class P3PlaneCallaghanApproximation(ModelProperties):
r"""
The Callaghan model [1]_ of diffusion between two parallel infinite plates.
Expand Down
5 changes: 5 additions & 0 deletions dmipy/signal_models/sphere_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@

DIAMETER_SCALING = 1e-6

__all__ = [
'S1Dot',
'S2SphereSodermanApproximation'
]


class S1Dot(ModelProperties):
r"""
Expand Down
6 changes: 6 additions & 0 deletions dmipy/signal_models/spherical_mean_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@
DIFFUSIVITY_SCALING = 1e-9
A_SCALING = 1e-12

__all__ = [
'C1StickSphericalMean',
'G2ZeppelinSphericalMean',
'G3RestrictedZeppelinSphericalMean'
]


class C1StickSphericalMean(ModelProperties):
r"""
Expand Down
5 changes: 5 additions & 0 deletions dmipy/utils/spherical_convolution.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@
from dipy.utils.optpkg import optional_package
numba, have_numba, _ = optional_package("numba")

__all__ = [
'real_sym_rh_basis',
'sh_convolution'
]


def real_sym_rh_basis(sh_order, theta, phi):
r"""Samples a real symmetric rotational harmonic basis at point on the sphere
Expand Down
5 changes: 5 additions & 0 deletions dmipy/utils/spherical_mean.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
from dipy.reconst.shm import real_sym_sh_mrtrix
from . import utils

__all__ = [
'estimate_spherical_mean_multi_shell',
'estimate_spherical_mean_shell'
]


def estimate_spherical_mean_multi_shell(E_attenuation, acquisition_scheme,
sh_order=6):
Expand Down
18 changes: 18 additions & 0 deletions dmipy/utils/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,24 @@
SPHERE = get_sphere('symmetric362')
numba, have_numba, _ = optional_package("numba")

__all__ = [
'perpendicular_vector',
'rotation_matrix_around_100',
'rotation_matrix_100_to_theta_phi',
'rotation_matrix_100_to_xyz',
'rotation_matrix_001_to_xyz',
'rotation_matrix_100_to_theta_phi_psi',
'T1_tortuosity',
'parameter_equality',
'define_shell_indices',
'cart2sphere',
'cart2mu',
'R2mu_psi',
'sphere2cart',
'unitsphere2cart_1d',
'unitsphere2cart_Nd'
]


def perpendicular_vector(v):
"""Returns a perpendicular vector to vector "v".
Expand Down

0 comments on commit ded63fa

Please sign in to comment.