mirror of
https://github.com/wassname/scikit-image.git
synced 2026-08-06 13:30:21 +08:00
@@ -0,0 +1,10 @@
|
||||
"""Functionality with an experimental API. Although you can count on the
|
||||
functions in this package being around in the future, the API may change with
|
||||
any version update **and will not follow the skimage two-version deprecation
|
||||
path**. Therefore, use the functions herein with care, and do not use them in
|
||||
production code that will depend on updated skimage versions.
|
||||
"""
|
||||
|
||||
from . import graph
|
||||
|
||||
__all__ = ['graph']
|
||||
@@ -0,0 +1,12 @@
|
||||
from .graph_cut import cut_threshold, cut_normalized
|
||||
from .rag import rag_mean_color, RAG, draw_rag
|
||||
from .graph_merge import merge_hierarchical
|
||||
ncut = cut_normalized
|
||||
|
||||
__all__ = ['rag_mean_color',
|
||||
'cut_threshold',
|
||||
'cut_normalized',
|
||||
'ncut',
|
||||
'draw_rag',
|
||||
'merge_hierarchical',
|
||||
'RAG']
|
||||
@@ -37,7 +37,8 @@ def cut_threshold(labels, rag, thresh, in_place=True):
|
||||
|
||||
Examples
|
||||
--------
|
||||
>>> from skimage import data, graph, segmentation
|
||||
>>> from skimage import data, segmentation
|
||||
>>> from skimage.future import graph
|
||||
>>> img = data.astronaut()
|
||||
>>> labels = segmentation.slic(img)
|
||||
>>> rag = graph.rag_mean_color(img, labels)
|
||||
@@ -107,7 +108,8 @@ def cut_normalized(labels, rag, thresh=0.001, num_cuts=10, in_place=True,
|
||||
|
||||
Examples
|
||||
--------
|
||||
>>> from skimage import data, graph, segmentation
|
||||
>>> from skimage import data, segmentation
|
||||
>>> from skimage.future import graph
|
||||
>>> img = data.astronaut()
|
||||
>>> labels = segmentation.slic(img, compactness=30, n_segments=400)
|
||||
>>> rag = graph.rag_mean_color(img, labels, mode='similarity')
|
||||
@@ -14,7 +14,7 @@ import numpy as np
|
||||
from scipy.ndimage import filters
|
||||
from scipy import ndimage as nd
|
||||
import math
|
||||
from .. import draw, measure, segmentation, util, color
|
||||
from ... import draw, measure, segmentation, util, color
|
||||
try:
|
||||
from matplotlib import colors
|
||||
from matplotlib import cm
|
||||
@@ -251,7 +251,8 @@ def rag_mean_color(image, labels, connectivity=2, mode='distance',
|
||||
|
||||
Examples
|
||||
--------
|
||||
>>> from skimage import data, graph, segmentation
|
||||
>>> from skimage import data, segmentation
|
||||
>>> from skimage.future import graph
|
||||
>>> img = data.astronaut()
|
||||
>>> labels = segmentation.slic(img)
|
||||
>>> rag = graph.rag_mean_color(img, labels)
|
||||
@@ -364,7 +365,8 @@ def draw_rag(labels, rag, img, border_color=None, node_color='#ffff00',
|
||||
|
||||
Examples
|
||||
--------
|
||||
>>> from skimage import data, graph, segmentation
|
||||
>>> from skimage import data, segmentation
|
||||
>>> from skimage.future import graph
|
||||
>>> img = data.coffee()
|
||||
>>> labels = segmentation.slic(img)
|
||||
>>> g = graph.rag_mean_color(img, labels)
|
||||
@@ -0,0 +1,30 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
from skimage._build import cython
|
||||
import os.path
|
||||
|
||||
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('graph', parent_package, top_path)
|
||||
config.add_data_dir('tests')
|
||||
|
||||
# This function tries to create C files from the given .pyx files. If
|
||||
# it fails, try to build with pre-generated .c files.
|
||||
cython(['_ncut_cy.pyx'], working_path=base_path)
|
||||
config.add_extension('_ncut_cy', sources=['_ncut_cy.c'],
|
||||
include_dirs=[get_numpy_include_dirs()])
|
||||
return config
|
||||
|
||||
if __name__ == '__main__':
|
||||
from numpy.distutils.core import setup
|
||||
setup(maintainer='scikit-image Developers',
|
||||
maintainer_email='scikit-image@googlegroups.com',
|
||||
description='Graph-based Image-processing Algorithms',
|
||||
url='https://github.com/scikit-image/scikit-image',
|
||||
license='Modified BSD',
|
||||
**(configuration(top_path='').todict())
|
||||
)
|
||||
@@ -1,5 +1,5 @@
|
||||
import numpy as np
|
||||
from skimage import graph
|
||||
from skimage.future import graph
|
||||
from skimage._shared.version_requirements import is_installed
|
||||
from numpy.testing.decorators import skipif
|
||||
from skimage import segmentation
|
||||
@@ -0,0 +1,12 @@
|
||||
|
||||
def configuration(parent_package='skimage', top_path=None):
|
||||
from numpy.distutils.misc_util import Configuration
|
||||
config = Configuration('future', parent_package, top_path)
|
||||
config.add_subpackage('graph')
|
||||
return config
|
||||
|
||||
if __name__ == "__main__":
|
||||
from numpy.distutils.core import setup
|
||||
|
||||
config = configuration(top_path='').todict()
|
||||
setup(**config)
|
||||
@@ -1,9 +1,5 @@
|
||||
from .spath import shortest_path
|
||||
from .mcp import MCP, MCP_Geometric, MCP_Connect, MCP_Flexible, route_through_array
|
||||
from .graph_cut import cut_threshold, cut_normalized
|
||||
from .rag import rag_mean_color, RAG, draw_rag
|
||||
from .graph_merge import merge_hierarchical
|
||||
ncut = cut_normalized
|
||||
|
||||
|
||||
__all__ = ['shortest_path',
|
||||
|
||||
@@ -17,7 +17,6 @@ def configuration(parent_package='', top_path=None):
|
||||
cython(['_spath.pyx'], working_path=base_path)
|
||||
cython(['_mcp.pyx'], working_path=base_path)
|
||||
cython(['heap.pyx'], working_path=base_path)
|
||||
cython(['_ncut_cy.pyx'], working_path=base_path)
|
||||
|
||||
config.add_extension('_spath', sources=['_spath.c'],
|
||||
include_dirs=[get_numpy_include_dirs()])
|
||||
@@ -25,8 +24,6 @@ def configuration(parent_package='', top_path=None):
|
||||
include_dirs=[get_numpy_include_dirs()])
|
||||
config.add_extension('heap', sources=['heap.c'],
|
||||
include_dirs=[get_numpy_include_dirs()])
|
||||
config.add_extension('_ncut_cy', sources=['_ncut_cy.c'],
|
||||
include_dirs=[get_numpy_include_dirs()])
|
||||
return config
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
||||
@@ -14,6 +14,7 @@ def configuration(parent_package='', top_path=None):
|
||||
config.add_subpackage('feature')
|
||||
config.add_subpackage('restoration')
|
||||
config.add_subpackage('filters')
|
||||
config.add_subpackage('future')
|
||||
config.add_subpackage('graph')
|
||||
config.add_subpackage('io')
|
||||
config.add_subpackage('measure')
|
||||
|
||||
Reference in New Issue
Block a user