Commit 7aba755e authored by Damien Naudet's avatar Damien Naudet

Updated tests.

parent ced4ca88
......@@ -530,8 +530,6 @@ class QSpaceConverter(object):
medfilt_dims = np.repeat(medfilt_dims, 2)
if np.any(np.less(medfilt_dims, [1, 1])):
raise ValueError('medfilt_dims values must be >= 1.')
if np.array_equal(medfilt_dims, [1, 1]):
medfilt_dims = None
ta = time.time()
......@@ -1195,7 +1193,7 @@ def _to_qspace(th_idx,
t0 = time.time()
# intensity = medfilt2d(intensity, 3)
if medfilt_dims is not None:
if medfilt_dims[0] != 1 or medfilt_dims[1] != 1:
intensity = medfilt2D(intensity,
kernel=medfilt_dims,
n_threads=None)
......
......@@ -164,7 +164,9 @@ class TestPeakFitter(ParametricTestCase):
keys = ['fit_f', 'qspace_f']
parameters = [
('gaussian_1.h5', 'qspace_1.h5'),
('gaussian_2.h5', 'qspace_2.h5')
('gaussian_2.h5', 'qspace_2.h5'),
('gaussian_3.h5', 'qspace_3.h5'),
('gaussian_4.h5', 'qspace_4.h5')
]
param_dicts = [dict(zip(keys, params)) for params in parameters]
......
......@@ -90,8 +90,8 @@ class TestQSpace(ParametricTestCase):
parameters = [
('qspace_1.h5', None, None),
('qspace_2.h5', [4, 4], None),
# ('qspace_3.h5', None, [3, 3]),
# ('qspace_4.h5', [4, 4], [3, 3]),
('qspace_3.h5', None, [3, 3]),
('qspace_4.h5', [4, 4], [3, 3]),
]
param_dicts = [dict(zip(keys, params)) for params in parameters]
......@@ -102,12 +102,15 @@ class TestQSpace(ParametricTestCase):
converter = QSpaceConverter(master_f,
qspace_dims=[28, 154, 60],
img_binning=params['img_binning'],
medfilt_dims=params['medfilt_dims'],
output_f=output_f)
self.assertEqual(converter.status, converter.READY)
converter.convert()
self.assertEqual(converter.status, converter.DONE)
self.assertEqual(converter.status,
converter.DONE,
msg=converter.status_msg)
q_ref = manager.get_file('qspace/{0}'
''.format(params['output_f']))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment