コード例 #1
0
def test_ShoreFit_deconvolution_no_constraint_delta():
    """ Here we test the deconvolution with the hpsd constraint.
    The result calculated with bonndit are compared to results from the old code
    """
    fit = ShResponse.load(SH_RESPONSE_PRECOMPUTED)
    out, wmout = fit.fodf(data, pos='none', kernel="delta")
    tensors, mask, meta = fields.load_tensor(CSD_ODF_NO_CONSTRAINT_DELTA)

    assert ((out - tensors) < ALLOWED_ERROR).all() \
           and ((wmout -
                 fields.load_scalar(os.path.join(DRD, 'wm_none_delta.nrrd'))[
                     0]) < ALLOWED_ERROR).all()
コード例 #2
0
ファイル: test_ShoreFitMt.py プロジェクト: MedVisBonn/bonndit
def test_ShoreFit_deconvolution_nonneg_delta():
    """ Here we test the deconvolution with the hpsd constraint.
    The result calculated with bonndit are compared to results from the old code
    """
    fit = bs.ShoreMultiTissueResponse.load(SHORE_FIT_PRECOMPUTED)
    out, wmout, gmout, csfout = fit.fodf(data, pos='nonneg', kernel="delta")
    tensors, mask, meta = fields.load_tensor(ODF_RESULT_NONNEG_DELTA)

    assert ((out - tensors) < ALLOWED_ERROR).all() \
           and ((wmout -
                 fields.load_scalar(os.path.join(DRD, 'wm_nonneg_delta.nrrd'))[
                     0]) < ALLOWED_ERROR).all() \
           and ((gmout -
                 fields.load_scalar(os.path.join(DRD, 'gm_nonneg_delta.nrrd'))[
                     0]) < ALLOWED_ERROR).all() \
           and ((csfout - fields.load_scalar(
        os.path.join(DRD, 'csf_nonneg_delta.nrrd'))[0]) < ALLOWED_ERROR).all()