From e8461e22dd080fd48d24ca9c2eb0479a6a0298f6 Mon Sep 17 00:00:00 2001 From: Tony S Yu Date: Sun, 18 Dec 2011 13:37:31 -0500 Subject: [PATCH] Move template matching to feature subpackage --- doc/examples/plot_template.py | 2 +- skimage/detection/__init__.py | 1 - skimage/detection/setup.py | 31 ------------------- skimage/feature/__init__.py | 1 + skimage/{detection => feature}/_template.pyx | 0 skimage/feature/setup.py | 3 ++ skimage/{detection => feature}/template.py | 0 .../tests/test_template.py | 2 +- skimage/setup.py | 1 - 9 files changed, 6 insertions(+), 35 deletions(-) delete mode 100644 skimage/detection/__init__.py delete mode 100644 skimage/detection/setup.py rename skimage/{detection => feature}/_template.pyx (100%) rename skimage/{detection => feature}/template.py (100%) rename skimage/{detection => feature}/tests/test_template.py (97%) diff --git a/doc/examples/plot_template.py b/doc/examples/plot_template.py index e4a51787..3690b18e 100644 --- a/doc/examples/plot_template.py +++ b/doc/examples/plot_template.py @@ -13,7 +13,7 @@ a simple peak extraction algorithm. """ import numpy as np -from skimage.detection import match_template +from skimage.feature import match_template from numpy.random import randn import matplotlib.pyplot as plt diff --git a/skimage/detection/__init__.py b/skimage/detection/__init__.py deleted file mode 100644 index 3fdc2389..00000000 --- a/skimage/detection/__init__.py +++ /dev/null @@ -1 +0,0 @@ -from template import match_template diff --git a/skimage/detection/setup.py b/skimage/detection/setup.py deleted file mode 100644 index a5b7a6b4..00000000 --- a/skimage/detection/setup.py +++ /dev/null @@ -1,31 +0,0 @@ -#!/usr/bin/env python - -import os -from skimage._build import cython - -base_path = os.path.abspath(os.path.dirname(__file__)) - -def configuration(parent_package='', top_path=None): - from numpy.distutils.misc_util import Configuration, get_numpy_include_dirs - - config = Configuration('detection', parent_package, top_path) - config.add_data_dir('tests') - - cython(['_template.pyx'], working_path=base_path) - - config.add_extension('_template', sources=['_template.c'], - include_dirs=[get_numpy_include_dirs()]) - - return config - -if __name__ == '__main__': - from numpy.distutils.core import setup - setup(maintainer = 'scikits-image Developers', - author = 'scikits-image Developers', - maintainer_email = 'scikits-image@googlegroups.com', - description = 'detection', - url = 'https://github.com/scikits-image/scikits-image', - license = 'SciPy License (BSD Style)', - **(configuration(top_path='').todict()) - ) - diff --git a/skimage/feature/__init__.py b/skimage/feature/__init__.py index 4e5d6324..70c154b8 100644 --- a/skimage/feature/__init__.py +++ b/skimage/feature/__init__.py @@ -2,3 +2,4 @@ from .hog import hog from .greycomatrix import greycomatrix, greycoprops from .peak import peak_local_max from .harris import harris +from .template import match_template diff --git a/skimage/detection/_template.pyx b/skimage/feature/_template.pyx similarity index 100% rename from skimage/detection/_template.pyx rename to skimage/feature/_template.pyx diff --git a/skimage/feature/setup.py b/skimage/feature/setup.py index 626b2f5a..13d4fae5 100644 --- a/skimage/feature/setup.py +++ b/skimage/feature/setup.py @@ -12,9 +12,12 @@ def configuration(parent_package='', top_path=None): config.add_data_dir('tests') cython(['_greycomatrix.pyx'], working_path=base_path) + cython(['_template.pyx'], working_path=base_path) config.add_extension('_greycomatrix', sources=['_greycomatrix.c'], include_dirs=[get_numpy_include_dirs()]) + config.add_extension('_template', sources=['_template.c'], + include_dirs=[get_numpy_include_dirs()]) return config diff --git a/skimage/detection/template.py b/skimage/feature/template.py similarity index 100% rename from skimage/detection/template.py rename to skimage/feature/template.py diff --git a/skimage/detection/tests/test_template.py b/skimage/feature/tests/test_template.py similarity index 97% rename from skimage/detection/tests/test_template.py rename to skimage/feature/tests/test_template.py index a3dfbcde..e92672da 100644 --- a/skimage/detection/tests/test_template.py +++ b/skimage/feature/tests/test_template.py @@ -1,5 +1,5 @@ import numpy as np -from skimage.detection import match_template +from skimage.feature import match_template from numpy.random import randn diff --git a/skimage/setup.py b/skimage/setup.py index 752cdcc7..c26014f8 100644 --- a/skimage/setup.py +++ b/skimage/setup.py @@ -16,7 +16,6 @@ def configuration(parent_package='', top_path=None): config.add_subpackage('draw') config.add_subpackage('feature') config.add_subpackage('measure') - config.add_subpackage('detection') def add_test_directories(arg, dirname, fnames): if dirname.split(os.path.sep)[-1] == 'tests':