0162a1e774202c7336f1225957cb32d2d308bef5,dipy/reconst/tests/test_dti.py,,test_WLS_and_LS_fit,#,241

Before Change


    assert_almost_equal(tensor_est.md(), md)
    assert_array_almost_equal(tensor_est.lower_triangular(b0), D)

    tensor_est = dti.Tensor(y, bval, gtab.T, min_signal=1e-8, fit_method="LS")
    assert_equal(tensor_est.shape, tuple())
    assert_array_almost_equal(tensor_est.evals, evals)
    assert_array_almost_equal(tensor_est.D, tensor)
    assert_almost_equal(tensor_est.md(), md)

After Change



    ////// Testing WLS Fit on Single Voxel //////
    //Estimate tensor from test signals
    model = TensorModel(gtab, min_signal=1e-8, fit_method="WLS")
    tensor_est = model.fit(Y)
    assert_equal(tensor_est.shape, Y.shape[:-1])
    assert_array_almost_equal(tensor_est.evals[0], evals)
    assert_array_almost_equal(tensor_est.quadratic_form[0], tensor,
                              err_msg= "Calculation of tensor from Y does not "
                                       "compare to analytical solution")
    assert_almost_equal(tensor_est.md[0], md)

    // Test that we can fit a single voxel"s worth of data (a 1d array)
    y = Y[0]
    tensor_est = model.fit(y)
    assert_equal(tensor_est.shape, tuple())
    assert_array_almost_equal(tensor_est.evals, evals)
    assert_array_almost_equal(tensor_est.quadratic_form, tensor)
    assert_almost_equal(tensor_est.md, md)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 5

Instances


Project Name: nipy/dipy
Commit Name: 0162a1e774202c7336f1225957cb32d2d308bef5
Time: 2013-04-02
Author: mrbago@gmail.com
File Name: dipy/reconst/tests/test_dti.py
Class Name:
Method Name: test_WLS_and_LS_fit


Project Name: nipy/dipy
Commit Name: 07cc05e233b45d78435639b018d48a373af9e533
Time: 2012-11-29
Author: stefan@sun.ac.za
File Name: dipy/sims/tests/test_phantom.py
Class Name:
Method Name: test_phantom


Project Name: nipy/dipy
Commit Name: 0162a1e774202c7336f1225957cb32d2d308bef5
Time: 2013-04-02
Author: mrbago@gmail.com
File Name: dipy/reconst/tests/test_dti.py
Class Name:
Method Name: test_masked_array_with_Tensor