Skip to content

Commit

Permalink
Merge pull request #4 from teresamg/test_cc_snr
Browse files Browse the repository at this point in the history
Adds test_cc_snr
  • Loading branch information
arokem authored Feb 22, 2024
2 parents caf966c + 3d68097 commit 9b591e3
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions mriqc/qc/tests/test_diffusion.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
from dipy.data.fetcher import fetch_sherbrooke_3shell
from dipy.core.gradients import unique_bvals_magnitude, round_bvals
import os.path as op
from ..diffusion import noise_func, get_spike_mask, get_slice_spike_percentage, get_global_spike_percentage
from ..diffusion import noise_func, get_spike_mask, get_slice_spike_percentage, get_global_spike_percentage, cc_snr


class DiffusionData(object):
Expand Down Expand Up @@ -94,4 +94,13 @@ def test_get_global_spike_percentage(ddata):

def test_with_shelled_data(ddata):
shelled_data, gtab = ddata.shelled_data()
noise_func_for_shelled_data(shelled_data, gtab)
noise_func_for_shelled_data(shelled_data, gtab)


def test_cc_snr(ddata):
img, gtab = ddata.get_fdata()
cc_snr_worst, cc_snr_best = cc_snr(img, gtab)

assert cc_snr_best.shape == gtab.bvals.shape
assert cc_snr_worst.shape == gtab.bvals.shape
assert np.min(cc_snr_best - cc_snr_worst) >= 0

0 comments on commit 9b591e3

Please sign in to comment.