Exemplo n.º 1
0
 def get_pmf(self, point):
     """Produces an ODF from a SH bootstrap sample"""
     where_dwi = self.where_dwi
     bootdata = trilinear_interpolate4d(self.data, point)
     dwidata = bootdata[where_dwi]
     dwidata = shm.bootstrap_data_voxel(dwidata, self.H, self.R)
     bootdata[where_dwi] = dwidata
     fit = self.model.fit(bootdata)
     return fit.odf(self.sphere)
Exemplo n.º 2
0
def test_bootstrap_array():
    B = np.array([[4, 5, 7, 4, 2.], [4, 6, 2, 3, 6.]])
    H = hat(B.T)

    R = np.zeros((5, 5))
    d = np.arange(1, 6)
    dhat = np.dot(H, d)

    assert_array_almost_equal(bootstrap_data_voxel(dhat, H, R), dhat)
    assert_array_almost_equal(bootstrap_data_array(dhat, H, R), dhat)
Exemplo n.º 3
0
def test_bootstrap_array():
    B = np.array([[4, 5, 7, 4, 2.],
                  [4, 6, 2, 3, 6.]])
    H = hat(B.T)

    R = np.zeros((5, 5))
    d = np.arange(1, 6)
    dhat = np.dot(H, d)

    assert_array_almost_equal(bootstrap_data_voxel(dhat, H, R), dhat)
    assert_array_almost_equal(bootstrap_data_array(dhat, H, R), dhat)