Skip to content

Commit

Permalink
Removes redundant lines
Browse files Browse the repository at this point in the history
  • Loading branch information
teresamg authored and arokem committed Feb 7, 2024
1 parent 2d780e8 commit bd65ab4
Showing 1 changed file with 28 additions and 2 deletions.
30 changes: 28 additions & 2 deletions mriqc/qc/tests/test_diffusion.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,34 @@ def ddata():


def test_noise_function(ddata):
data, gtab = ddata.get_data()
noise_func(data, gtab)
img, gtab = ddata.get_fdata()
noise_func(img, gtab)


def test_get_spike_mask(ddata):
img, gtab = ddata.get_fdata()
spike_mask = get_spike_mask(img, 2)

assert np.min(np.ravel(spike_mask)) == 0
assert np.max(np.ravel(spike_mask)) == 1
assert spike_mask.shape == img.shape


def test_get_slice_spike_percentage(ddata):
img, gtab = ddata.get_fdata()
slice_spike_percentage = get_slice_spike_percentage(img, 2, .2)

assert np.min(slice_spike_percentage) >= 0
assert np.max(slice_spike_percentage) <= 1
assert len(slice_spike_percentage) == img.ndim


def test_get_global_spike_percentage(ddata):
img, gtab = ddata.get_fdata()
global_spike_percentage = get_global_spike_percentage(img, 2)

assert global_spike_percentage >= 0
assert global_spike_percentage <= 1


def test_with_shelled_data(ddata):
Expand Down

0 comments on commit bd65ab4

Please sign in to comment.