Exemple #1
0
def test_SampleSizeBasedLikelihood_reml(testdata_ibma):
    """
    Smoke test for SampleSizeBasedLikelihood with REML.
    """
    meta = ibma.SampleSizeBasedLikelihood(method="reml")
    res = meta.fit(testdata_ibma)
    assert isinstance(meta.results, nimare.results.MetaResult)
    assert isinstance(res, nimare.results.MetaResult)
Exemple #2
0
def test_jackknife_with_custom_masker_smoke(testdata_ibma):
    """Ensure that Jackknife will work with NiftiLabelsMaskers.

    CBMAs don't work with NiftiLabelsMaskers and VarianceBasedLikelihood takes ~1 minute,
    which is too long for a single test, so I'm just using SampleSizeBasedLikelihood.
    """
    atlas = op.join(get_test_data_path(), "test_pain_dataset", "atlas.nii.gz")
    masker = NiftiLabelsMasker(atlas)

    meta = ibma.SampleSizeBasedLikelihood(mask=masker)
    res = meta.fit(testdata_ibma)

    jackknife = Jackknife(target_image="z", voxel_thresh=0.5)
    cluster_table, labeled_img = jackknife.transform(res)
    assert cluster_table.shape[0] == len(meta.inputs_["id"]) + 1

    # A Jackknife with a target_image that isn't present in the MetaResult raises a ValueError.
    with pytest.raises(ValueError):
        jackknife = Jackknife(target_image="doggy", voxel_thresh=0.5)
        jackknife.transform(res)