diff options
author | Matthias Vogelgesang <matthias.vogelgesang@kit.edu> | 2014-11-25 17:19:18 +0100 |
---|---|---|
committer | Matthias Vogelgesang <matthias.vogelgesang@kit.edu> | 2014-11-25 17:20:24 +0100 |
commit | 840d6f0e09cdd840a7145de5321ac2f8fe7a1652 (patch) | |
tree | 04a1f0e9ce89cf5d9ff673191df236e013cf31a8 /tests | |
parent | d4125b68f96e9b3341ceeaa1ecdb60076bdd631d (diff) | |
download | ufo-filters-840d6f0e09cdd840a7145de5321ac2f8fe7a1652.tar.gz ufo-filters-840d6f0e09cdd840a7145de5321ac2f8fe7a1652.tar.bz2 ufo-filters-840d6f0e09cdd840a7145de5321ac2f8fe7a1652.tar.xz ufo-filters-840d6f0e09cdd840a7145de5321ac2f8fe7a1652.zip |
Remove unmaintained plugin tests
The test infrastructure is found at
https://github.com/ufo-kit/ufo-tests
Diffstat (limited to 'tests')
-rw-r--r-- | tests/data/sinogram-00000.tif | bin | 1049734 -> 0 bytes | |||
-rw-r--r-- | tests/data/sinogram-00001.tif | bin | 1049734 -> 0 bytes | |||
-rw-r--r-- | tests/data/sinogram-00002.tif | bin | 1049734 -> 0 bytes | |||
-rw-r--r-- | tests/data/sinogram-00003.tif | bin | 1049734 -> 0 bytes | |||
-rw-r--r-- | tests/data/sinogram-00004.tif | bin | 1049734 -> 0 bytes | |||
-rw-r--r-- | tests/data/sinogram-00005.tif | bin | 1049734 -> 0 bytes | |||
-rw-r--r-- | tests/data/sinogram-00006.tif | bin | 1049734 -> 0 bytes | |||
-rw-r--r-- | tests/data/sinogram-00007.tif | bin | 1049734 -> 0 bytes | |||
-rw-r--r-- | tests/data/sinogram-00008.tif | bin | 1049734 -> 0 bytes | |||
-rw-r--r-- | tests/data/sinogram-00009.tif | bin | 1049734 -> 0 bytes | |||
-rw-r--r-- | tests/data/sinogram-00010.tif | bin | 1049734 -> 0 bytes | |||
-rw-r--r-- | tests/data/sinogram-00011.tif | bin | 1049734 -> 0 bytes | |||
-rw-r--r-- | tests/data/sinogram-00012.tif | bin | 1049734 -> 0 bytes | |||
-rw-r--r-- | tests/data/sinogram-00013.tif | bin | 1049734 -> 0 bytes | |||
-rw-r--r-- | tests/data/sinogram-00014.tif | bin | 1049734 -> 0 bytes | |||
-rw-r--r-- | tests/data/sinogram-00015.tif | bin | 1049734 -> 0 bytes | |||
-rw-r--r-- | tests/expected/phantom-00000.tif | bin | 1049734 -> 0 bytes | |||
-rw-r--r-- | tests/expected/phantom-00001.tif | bin | 1049734 -> 0 bytes | |||
-rw-r--r-- | tests/expected/phantom-00002.tif | bin | 1049734 -> 0 bytes | |||
-rw-r--r-- | tests/expected/phantom-00003.tif | bin | 1049734 -> 0 bytes | |||
-rw-r--r-- | tests/expected/phantom-00004.tif | bin | 1049734 -> 0 bytes | |||
-rw-r--r-- | tests/expected/phantom-00005.tif | bin | 1049734 -> 0 bytes | |||
-rw-r--r-- | tests/expected/phantom-00006.tif | bin | 1049734 -> 0 bytes | |||
-rw-r--r-- | tests/expected/phantom-00007.tif | bin | 1049734 -> 0 bytes | |||
-rw-r--r-- | tests/expected/phantom-00008.tif | bin | 1049734 -> 0 bytes | |||
-rw-r--r-- | tests/expected/phantom-00009.tif | bin | 1049734 -> 0 bytes | |||
-rw-r--r-- | tests/expected/phantom-00010.tif | bin | 1049734 -> 0 bytes | |||
-rw-r--r-- | tests/expected/phantom-00011.tif | bin | 1049734 -> 0 bytes | |||
-rw-r--r-- | tests/expected/phantom-00012.tif | bin | 1049734 -> 0 bytes | |||
-rw-r--r-- | tests/expected/phantom-00013.tif | bin | 1049734 -> 0 bytes | |||
-rw-r--r-- | tests/expected/phantom-00014.tif | bin | 1049734 -> 0 bytes | |||
-rw-r--r-- | tests/expected/phantom-00015.tif | bin | 1049734 -> 0 bytes | |||
-rwxr-xr-x | tests/runtests.sh | 38 | ||||
-rw-r--r-- | tests/tests.py | 138 |
34 files changed, 0 insertions, 176 deletions
diff --git a/tests/data/sinogram-00000.tif b/tests/data/sinogram-00000.tif Binary files differdeleted file mode 100644 index b3b43c9..0000000 --- a/tests/data/sinogram-00000.tif +++ /dev/null diff --git a/tests/data/sinogram-00001.tif b/tests/data/sinogram-00001.tif Binary files differdeleted file mode 100644 index 405f725..0000000 --- a/tests/data/sinogram-00001.tif +++ /dev/null diff --git a/tests/data/sinogram-00002.tif b/tests/data/sinogram-00002.tif Binary files differdeleted file mode 100644 index 6b9ba8f..0000000 --- a/tests/data/sinogram-00002.tif +++ /dev/null diff --git a/tests/data/sinogram-00003.tif b/tests/data/sinogram-00003.tif Binary files differdeleted file mode 100644 index 8483be2..0000000 --- a/tests/data/sinogram-00003.tif +++ /dev/null diff --git a/tests/data/sinogram-00004.tif b/tests/data/sinogram-00004.tif Binary files differdeleted file mode 100644 index ced97f8..0000000 --- a/tests/data/sinogram-00004.tif +++ /dev/null diff --git a/tests/data/sinogram-00005.tif b/tests/data/sinogram-00005.tif Binary files differdeleted file mode 100644 index 25c7527..0000000 --- a/tests/data/sinogram-00005.tif +++ /dev/null diff --git a/tests/data/sinogram-00006.tif b/tests/data/sinogram-00006.tif Binary files differdeleted file mode 100644 index 11ea705..0000000 --- a/tests/data/sinogram-00006.tif +++ /dev/null diff --git a/tests/data/sinogram-00007.tif b/tests/data/sinogram-00007.tif Binary files differdeleted file mode 100644 index 00d994a..0000000 --- a/tests/data/sinogram-00007.tif +++ /dev/null diff --git a/tests/data/sinogram-00008.tif b/tests/data/sinogram-00008.tif Binary files differdeleted file mode 100644 index 03da0f2..0000000 --- a/tests/data/sinogram-00008.tif +++ /dev/null diff --git a/tests/data/sinogram-00009.tif b/tests/data/sinogram-00009.tif Binary files differdeleted file mode 100644 index 919d819..0000000 --- a/tests/data/sinogram-00009.tif +++ /dev/null diff --git a/tests/data/sinogram-00010.tif b/tests/data/sinogram-00010.tif Binary files differdeleted file mode 100644 index f9e95ab..0000000 --- a/tests/data/sinogram-00010.tif +++ /dev/null diff --git a/tests/data/sinogram-00011.tif b/tests/data/sinogram-00011.tif Binary files differdeleted file mode 100644 index f3288ce..0000000 --- a/tests/data/sinogram-00011.tif +++ /dev/null diff --git a/tests/data/sinogram-00012.tif b/tests/data/sinogram-00012.tif Binary files differdeleted file mode 100644 index a507b54..0000000 --- a/tests/data/sinogram-00012.tif +++ /dev/null diff --git a/tests/data/sinogram-00013.tif b/tests/data/sinogram-00013.tif Binary files differdeleted file mode 100644 index fe3de7d..0000000 --- a/tests/data/sinogram-00013.tif +++ /dev/null diff --git a/tests/data/sinogram-00014.tif b/tests/data/sinogram-00014.tif Binary files differdeleted file mode 100644 index 01facb6..0000000 --- a/tests/data/sinogram-00014.tif +++ /dev/null diff --git a/tests/data/sinogram-00015.tif b/tests/data/sinogram-00015.tif Binary files differdeleted file mode 100644 index a628731..0000000 --- a/tests/data/sinogram-00015.tif +++ /dev/null diff --git a/tests/expected/phantom-00000.tif b/tests/expected/phantom-00000.tif Binary files differdeleted file mode 100644 index c669db2..0000000 --- a/tests/expected/phantom-00000.tif +++ /dev/null diff --git a/tests/expected/phantom-00001.tif b/tests/expected/phantom-00001.tif Binary files differdeleted file mode 100644 index 37a4394..0000000 --- a/tests/expected/phantom-00001.tif +++ /dev/null diff --git a/tests/expected/phantom-00002.tif b/tests/expected/phantom-00002.tif Binary files differdeleted file mode 100644 index 22b2bbc..0000000 --- a/tests/expected/phantom-00002.tif +++ /dev/null diff --git a/tests/expected/phantom-00003.tif b/tests/expected/phantom-00003.tif Binary files differdeleted file mode 100644 index 9b771b9..0000000 --- a/tests/expected/phantom-00003.tif +++ /dev/null diff --git a/tests/expected/phantom-00004.tif b/tests/expected/phantom-00004.tif Binary files differdeleted file mode 100644 index 5ea52dd..0000000 --- a/tests/expected/phantom-00004.tif +++ /dev/null diff --git a/tests/expected/phantom-00005.tif b/tests/expected/phantom-00005.tif Binary files differdeleted file mode 100644 index 038461f..0000000 --- a/tests/expected/phantom-00005.tif +++ /dev/null diff --git a/tests/expected/phantom-00006.tif b/tests/expected/phantom-00006.tif Binary files differdeleted file mode 100644 index 5a89f04..0000000 --- a/tests/expected/phantom-00006.tif +++ /dev/null diff --git a/tests/expected/phantom-00007.tif b/tests/expected/phantom-00007.tif Binary files differdeleted file mode 100644 index 2099005..0000000 --- a/tests/expected/phantom-00007.tif +++ /dev/null diff --git a/tests/expected/phantom-00008.tif b/tests/expected/phantom-00008.tif Binary files differdeleted file mode 100644 index 892bc75..0000000 --- a/tests/expected/phantom-00008.tif +++ /dev/null diff --git a/tests/expected/phantom-00009.tif b/tests/expected/phantom-00009.tif Binary files differdeleted file mode 100644 index 0fbfe11..0000000 --- a/tests/expected/phantom-00009.tif +++ /dev/null diff --git a/tests/expected/phantom-00010.tif b/tests/expected/phantom-00010.tif Binary files differdeleted file mode 100644 index 35f7133..0000000 --- a/tests/expected/phantom-00010.tif +++ /dev/null diff --git a/tests/expected/phantom-00011.tif b/tests/expected/phantom-00011.tif Binary files differdeleted file mode 100644 index d530658..0000000 --- a/tests/expected/phantom-00011.tif +++ /dev/null diff --git a/tests/expected/phantom-00012.tif b/tests/expected/phantom-00012.tif Binary files differdeleted file mode 100644 index c72dff9..0000000 --- a/tests/expected/phantom-00012.tif +++ /dev/null diff --git a/tests/expected/phantom-00013.tif b/tests/expected/phantom-00013.tif Binary files differdeleted file mode 100644 index b65b6f1..0000000 --- a/tests/expected/phantom-00013.tif +++ /dev/null diff --git a/tests/expected/phantom-00014.tif b/tests/expected/phantom-00014.tif Binary files differdeleted file mode 100644 index 32f1353..0000000 --- a/tests/expected/phantom-00014.tif +++ /dev/null diff --git a/tests/expected/phantom-00015.tif b/tests/expected/phantom-00015.tif Binary files differdeleted file mode 100644 index 77f1c6b..0000000 --- a/tests/expected/phantom-00015.tif +++ /dev/null diff --git a/tests/runtests.sh b/tests/runtests.sh deleted file mode 100755 index c4e9bee..0000000 --- a/tests/runtests.sh +++ /dev/null @@ -1,38 +0,0 @@ -#!/bin/bash - -CUR=$(pwd) - -if [ ! -d "$CUR/venv" ]; then - echo "* Creating virtualenv ..." - virtualenv --system-site-packages -q $CUR/venv -fi - -echo "* Activate virtualenv ..." -source $CUR/venv/bin/activate - -# Install nose if not available -pip freeze | grep nose > /dev/null -RC=$? - -if [ "$RC" -ne "0" ]; then - echo "* Installing nose ..." - pip install nose nose-parameterized -fi - -# Install unittest2 if Python less than 2.7 -python -c 'import sys; v=sys.version_info; sys.exit((v[0], v[1]) < (2,7))' -RC=$? - -if [ "$RC" -ne "0" ]; then - pip freeze | grep unittest2 > /dev/null - RC=$? - - if [ "$RC" -ne "0" ]; then - echo "* Installing unittest2 ..." - pip install unittest2 - fi -fi - -echo "* Running tests ..." -export CUDA_VISIBLE_DEVICES=0,1 -nosetests tests.py diff --git a/tests/tests.py b/tests/tests.py deleted file mode 100644 index 851a3b5..0000000 --- a/tests/tests.py +++ /dev/null @@ -1,138 +0,0 @@ -import os -import shutil -import tempfile - -try: - import unittest2 as unittest -except ImportError: - import unittest - -import numpy as np -from nose_parameterized import parameterized -from gi.repository import Ufo -from libtiff import TIFF - - -def data_path(suffix=''): - return os.path.join(os.path.abspath('./data'), suffix) - - -def ref_path(suffix=''): - return os.path.join(os.path.abspath('./expected'), suffix) - - -class BasicTests(unittest.TestCase): - def setUp(self): - self.pm = Ufo.PluginManager() - self.graph = Ufo.TaskGraph() - self.sched = Ufo.Scheduler() - self.tmpdir = tempfile.mkdtemp() - - def tearDown(self): - shutil.rmtree(self.tmpdir) - - def tmp_path(self, suffix=''): - return os.path.join(self.tmpdir, suffix) - - def get_task(self, name, **kwargs): - plugin = self.pm.get_task(name) - plugin.set_properties(**kwargs) - return plugin - - def test_read_write(self): - reader = self.get_task('reader', path=data_path('sinogram-*.tif'), count=5) - writer = self.get_task('writer', filename=self.tmp_path('b-%05i.tif')) - - self.graph.connect_nodes(reader, writer) - self.sched.run(self.graph) - - expected = ['b-%05i.tif' % i for i in xrange(5)] - found = os.listdir(self.tmpdir) - - for fname in expected: - self.assertIn(fname, found) - - def test_roi(self): - R = {'x': 2, 'y': 13, 'width': 256, 'height': 128} - input_name = data_path('sinogram-00005.tif') - output_name = self.tmp_path('roi-00000.tif') - - reader = self.get_task('reader', path=input_name) - writer = self.get_task('writer', filename=self.tmp_path('roi-%05i.tif')) - roi = self.get_task('region-of-interest', **R) - - self.graph.connect_nodes(reader, roi) - self.graph.connect_nodes(roi, writer) - self.sched.run(self.graph) - - ref_img = TIFF.open(input_name, mode='r').read_image() - res_img = TIFF.open(output_name, mode='r').read_image() - - # Cut it manually - ref_img = ref_img[R['y']:R['y']+R['height'], R['x']:R['x']+R['width']] - - self.assertEqual(res_img.shape, ref_img.shape) - self.assertTrue((res_img == ref_img).all()) - - @parameterized.expand([(1, 0.5), (2, 0.5)]) - def test_fft(self, dimension, expected): - input_name = data_path('sinogram-00005.tif') - output_name = self.tmp_path('r-00000.tif') - - reader = self.get_task('reader', path=input_name) - writer = self.get_task('writer', filename=self.tmp_path('r-%05i.tif')) - fft = self.get_task('fft', dimensions=dimension) - ifft = self.get_task('ifft', dimensions=dimension) - - self.graph.connect_nodes(reader, fft) - self.graph.connect_nodes(fft, ifft) - self.graph.connect_nodes(ifft, writer) - self.sched.run(self.graph) - - ref_img = TIFF.open(input_name, mode='r').read_image() - res_img = TIFF.open(output_name, mode='r').read_image() - diff = np.sum(np.abs(ref_img - res_img)) - self.assertLess(diff, expected) - - def test_flatfield_correction(self): - input_name = data_path('sinogram-*.tif') - output_name = self.tmp_path('r-%i.tif') - flat = self.get_task('reader', path=input_name, count=2) - dark = self.get_task('reader', path=input_name, count=2) - proj = self.get_task('reader', path=input_name, count=10) - writer = self.get_task('writer', filename=output_name) - - flat_avg = self.get_task('averager', num_generate=10) - dark_avg = self.get_task('averager', num_generate=10) - ffc = self.get_task('flat-field-correction') - - self.graph.connect_nodes(dark, dark_avg) - self.graph.connect_nodes(flat, flat_avg) - self.graph.connect_nodes_full(proj, ffc, 0) - self.graph.connect_nodes_full(dark_avg, ffc, 1) - self.graph.connect_nodes_full(flat_avg, ffc, 2) - self.graph.connect_nodes(ffc, writer) - self.sched.run(self.graph) - - # def test_filtered_backprojection(self): - # reader = self.get_task('reader', path=data_path('sinogram*.tif')) - # fft = self.get_task('fft') - # ifft = self.get_task('ifft') - # fltr = self.get_task('filter') - # bp = self.get_task('backproject') - # writer = self.get_task('writer', filename=self.tmp_path('r-%05i.tif')) - - # self.graph.connect_nodes(reader, fft) - # self.graph.connect_nodes(fft, fltr) - # self.graph.connect_nodes(fltr, ifft) - # self.graph.connect_nodes(ifft, bp) - # self.graph.connect_nodes(bp, writer) - # self.sched.run(self.graph) - - # refs = sorted((ref_path(d) for d in os.listdir(ref_path()))) - # results = sorted((os.path.join(self.tmpdir, d) for d in os.listdir(self.tmpdir))) - - # for ref, res in zip(refs, results): - # ref_img = TIFF.open(ref, mode='r').read_image() - # res_img = TIFF.open(res, mode='r').read_image() - # self.assertLess(np.sum(np.abs(res_img - ref_img)), 0.01) |